OmniWeb Module Reference

New in version 0.3.0.

Control OmniWeb using JXA-like syntax.

Classes:

XAOmniWebApplication(properties)

A class for managing and interacting with OmniWeb.app.

XAOmniWebBookmark(properties)

A bookmark in OmniWeb.app.

XAOmniWebBookmarkList(properties[, filter])

A wrapper around lists of OmniWeb bookmarks that employs fast enumeration techniques.

XAOmniWebBookmarksDocument(properties)

A bookmarks document in OmniWeb.app.

XAOmniWebBookmarksDocumentList(properties[, ...])

A wrapper around lists of OmniWeb bookmarks documents that employs fast enumeration techniques.

XAOmniWebBrowser(properties)

A browser in OmniWeb.app.

XAOmniWebBrowserList(properties[, filter])

A wrapper around lists of OmniWeb browsers that employs fast enumeration techniques.

XAOmniWebDocument(properties)

A document of OmniWeb.app.

XAOmniWebDocumentList(properties[, filter])

A wrapper around lists of OmniWeb documents that employs fast enumeration techniques.

XAOmniWebTab(properties)

A tab in OmniWeb.app.

XAOmniWebTabList(properties[, filter])

A wrapper around lists of OmniWeb tabs that employs fast enumeration techniques.

XAOmniWebWindow(properties)

A window of OmniWeb.app.

XAOmniWebWorkspace(properties)

A workspace in OmniWeb.app.

XAOmniWebWorkspaceList(properties[, filter])

A wrapper around lists of OmniWeb workspaces that employs fast enumeration techniques.

class PyXA.apps.OmniWeb.XAOmniWebApplication(properties)[source]

Bases: XASBApplication, XACanOpenPath, XACanPrintPath

A class for managing and interacting with OmniWeb.app.

New in version 0.3.0.

Classes:

ObjectType(value)

Types of objects that can be created using XAOmniWebApplication.make().

Attributes:

active_workspace

The currently active workspace.

favorites

The bookmark item whose contents are displayed in the Favorites bar.

frontmost

Whether OmniWeb is the frontmost application.

full_version

The complete version string for this instance of OmniWeb.

name

The name of the application.

personal_bookmarks

The default bookmarks document.

version

The version of OmniWeb.app.

Methods:

bookmarks_documents([filter])

Returns a list of bookmarks documents, as PyXA-wrapped objects, matching the given filter.

browsers([filter])

Returns a list of browsers, as PyXA-wrapped objects, matching the given filter.

documents([filter])

Returns a list of documents, as PyXA-wrapped objects, matching the given filter.

get_window_info()

Returns a dictionary containing information about the frontmost window.

list_windows()

Returns a list of the numeric IDs of all open browser windows.

make(specifier[, properties, data])

Creates a new element of the given specifier class without adding it to any list.

open(target)

Opens the file/website at the given filepath/URL.

workspaces([filter])

Returns a list of workspaces, as PyXA-wrapped objects, matching the given filter.

class ObjectType(value)[source]

Bases: Enum

Types of objects that can be created using XAOmniWebApplication.make().

Attributes:

Bookmark

BookmarksDocument

Browser

Document

Tab

Window

Workspace

Bookmark = 'bookmark'
BookmarksDocument = 'bookmarks_document'
Browser = 'browser'
Document = 'document'
Tab = 'tab'
Window = 'window'
Workspace = 'workspace'
property active_workspace: XAOmniWebWorkspace

The currently active workspace.

bookmarks_documents(filter: dict | None = None) XAOmniWebBookmarksDocumentList | None[source]

Returns a list of bookmarks documents, as PyXA-wrapped objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned bookmarks documents will have, or None

Returns:

The list of bookmarks documents

Return type:

XAOmniWebBookmarksDocumentList

Example:

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> print(app.bookmarks_documents())
<<class 'PyXA.apps.Bike.XABikeBookmarksDocumentList'>['Untitled', 'PyXA Notes.bike']>

New in version 0.3.0.

browsers(filter: dict | None = None) XAOmniWebBrowserList | None[source]

Returns a list of browsers, as PyXA-wrapped objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned browsers will have, or None

Returns:

The list of browsers

Return type:

XAOmniWebBrowserList

Example:

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> print(app.browsers())
<<class 'PyXA.apps.Bike.XABikeBrowserList'>['Untitled', 'PyXA Notes.bike']>

New in version 0.3.0.

documents(filter: dict | None = None) XAOmniWebDocumentList | None[source]

Returns a list of documents, as PyXA-wrapped objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned documents will have, or None

Returns:

The list of documents

Return type:

XAOmniWebDocumentList

Example:

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> print(app.documents())
<<class 'PyXA.apps.Bike.XABikeDocumentList'>['Untitled', 'PyXA Notes.bike']>

New in version 0.3.0.

property favorites: XAOmniWebBookmark

The bookmark item whose contents are displayed in the Favorites bar.

property frontmost: bool

Whether OmniWeb is the frontmost application.

property full_version: str

The complete version string for this instance of OmniWeb.

get_window_info() dict[source]

Returns a dictionary containing information about the frontmost window.

Returns:

The window’s information

Return type:

dict

New in version 0.3.0.

list_windows() list[int][source]

Returns a list of the numeric IDs of all open browser windows.

Returns:

The list of IDs

Return type:

list[int]

New in version 0.3.0.

make(specifier: str | ObjectType, properties: dict | None = None, data: Any | None = None) XAObject[source]

Creates a new element of the given specifier class without adding it to any list.

Use XABase.XAList.push() to push the element onto a list.

Parameters:
  • specifier (Union[str, XAOmniWebApplication.ObjectType]) – The classname of the object to create

  • properties (dict) – The properties to give the object

  • data (Any, optional) – The data to give the object, defaults to None

Returns:

A PyXA wrapped form of the object

Return type:

XABase.XAObject

Example 1:

Add new rows to the current document

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> front_doc_rows = app.front_window.document.rows()
>>>
>>> row1 = app.make("row", {"name": "This is a new row!"})
>>> row2 = app.make("row", {"name": "This is another new row!"})
>>> row3 = app.make("row", {"name": "This is a third new row!"})
>>>
>>> front_doc_rows.push(row1) # Add to the end of the document
>>> front_doc_rows.insert(row2, 0) # Insert at the beginning of the document
>>> front_doc_rows.insert(row3, 5) # Insert at the middle of the document

New in version 0.3.0.

property name: str

The name of the application.

open(target: XAURL | XAPath | str) None[source]

Opens the file/website at the given filepath/URL.

Parameters:

target (Union[XABase.XAURL, XABase.XAPath, str]) – The path to a file or the URL to a website to open.

Example 1:

Open files from file paths

>>> import PyXA
>>> app = PyXA.Application("VLC")
>>> app.open("/Users/exampleUser/Downloads/Example.avi")
>>> 
>>> path = PyXA.XAPath("/Users/exampleUser/Documents/Example.m4v")
>>> app.open(path)
Example 2:

Open URLs

>>> import PyXA
>>> app = PyXA.Application("VLC")
>>> app.open("https://upload.wikimedia.org/wikipedia/commons/transcoded/0/0f/Baby_pelican.ogg/Baby_pelican.ogg.mp3")
>>> 
>>> url = PyXA.XAURL("https://www.youtube.com/watch?v=e9B3E_DnnWw")
>>> app.open(url)

New in version 0.0.8.

property personal_bookmarks: XAOmniWebBookmarksDocument

The default bookmarks document.

property version: str

The version of OmniWeb.app.

workspaces(filter: dict | None = None) XAOmniWebWorkspaceList | None[source]

Returns a list of workspaces, as PyXA-wrapped objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned workspaces will have, or None

Returns:

The list of workspaces

Return type:

XAOmniWebWorkspaceList

Example:

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> print(app.workspaces())
<<class 'PyXA.apps.Bike.XABikeWorkspaceList'>['Untitled', 'PyXA Notes.bike']>

New in version 0.3.0.

class PyXA.apps.OmniWeb.XAOmniWebBookmark(properties)[source]

Bases: XAObject, XACloseable, XAPrintable, XADeletable

A bookmark in OmniWeb.app.

New in version 0.3.0.

Attributes:

address

The URL of the bookmark.

check_interval

The number of seconds between checks for updates to the bookmark.

is_new

Whether the bookmark has been added since the last time it was checked for updates.

is_reachable

Whether this page could be retrieved last time it was checked.

last_checked_date

The date and time the bookmark was last checked for updates.

name

The label text of the bookmark item.

note

The annotation text of the bookmark item.

Methods:

bookmarks([filter])

Returns a list of bookmarks, as PyXA-wrapped objects, matching the given filter.

check_for_updates([including_children])

Checks the bookmark for updates of its resources.

property address: XAURL

The URL of the bookmark.

bookmarks(filter: dict | None = None) XAOmniWebBookmarkList | None[source]

Returns a list of bookmarks, as PyXA-wrapped objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned bookmarks will have, or None

Returns:

The list of bookmarks

Return type:

XAOmniWebBookmarkList

Example:

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> print(app.bookmarks())
<<class 'PyXA.apps.Bike.XABikeBookmarkList'>['Untitled', 'PyXA Notes.bike']>

New in version 0.3.0.

check_for_updates(including_children=False) None[source]

Checks the bookmark for updates of its resources.

Parameters:

including_children (bool, optional) – Whether to check all of the bookmark’s children for updates as well, defaults to False

New in version 0.3.0.

property check_interval: int

The number of seconds between checks for updates to the bookmark.

property is_new: bool

Whether the bookmark has been added since the last time it was checked for updates.

property is_reachable: bool

Whether this page could be retrieved last time it was checked.

property last_checked_date: datetime

The date and time the bookmark was last checked for updates.

property name: XAText

The label text of the bookmark item.

property note: XAText

The annotation text of the bookmark item.

class PyXA.apps.OmniWeb.XAOmniWebBookmarkList(properties: dict, filter: dict | None = None)[source]

Bases: XAList, XACanOpenPath, XAClipboardCodable

A wrapper around lists of OmniWeb bookmarks that employs fast enumeration techniques.

All properties of bookmarks can be called as methods on the wrapped list, returning a list containing each bookmark’s value for the property.

New in version 0.3.0.

Methods:

address()

bookmarks()

Returns a list of all bookmarks contained by the bookmarks documents in the list.

by_address(address)

by_check_interval(check_interval)

by_is_new(is_new)

by_is_reachable(is_reachable)

by_last_checked_date(last_checked_date)

by_name(name)

by_note(note)

check_interval()

is_new()

is_reachable()

last_checked_date()

name()

note()

address() XAURLList[source]
bookmarks() XAOmniWebBookmarkList[source]

Returns a list of all bookmarks contained by the bookmarks documents in the list.

Returns:

The list of bookmarks

Return type:

XAOmniWebBookmarkList

New in version 0.3.0.

by_address(address: str | XAURL) XAOmniWebBookmark | None[source]
by_check_interval(check_interval: int) XAOmniWebBookmark | None[source]
by_is_new(is_new: bool) XAOmniWebBookmark | None[source]
by_is_reachable(is_reachable: bool) XAOmniWebBookmark | None[source]
by_last_checked_date(last_checked_date: datetime) XAOmniWebBookmark | None[source]
by_name(name: str | XAText) XAOmniWebBookmark | None[source]
by_note(note: str | XAText) XAOmniWebBookmark | None[source]
check_interval() list[int][source]
is_new() list[bool][source]
is_reachable() list[bool][source]
last_checked_date() list[datetime][source]
name() XATextList[source]
note() XATextList[source]
class PyXA.apps.OmniWeb.XAOmniWebBookmarksDocument(properties)[source]

Bases: XAObject, XACloseable, XAPrintable, XADeletable

A bookmarks document in OmniWeb.app.

New in version 0.3.0.

Attributes:

address

The URL at which these bookmarks are stored.

is_read_only

Whether the bookmarks document is read-only.

Methods:

bookmarks([filter])

Returns a list of bookmarks, as PyXA-wrapped objects, matching the given filter.

property address: XAURL

The URL at which these bookmarks are stored.

bookmarks(filter: dict | None = None) XAOmniWebBookmarkList | None[source]

Returns a list of bookmarks, as PyXA-wrapped objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned bookmarks will have, or None

Returns:

The list of bookmarks

Return type:

XAOmniWebBookmarkList

Example:

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> print(app.bookmarks())
<<class 'PyXA.apps.Bike.XABikeBookmarkList'>['Untitled', 'PyXA Notes.bike']>

New in version 0.3.0.

property is_read_only: bool

Whether the bookmarks document is read-only.

class PyXA.apps.OmniWeb.XAOmniWebBookmarksDocumentList(properties: dict, filter: dict | None = None)[source]

Bases: XAList, XACanOpenPath, XAClipboardCodable

A wrapper around lists of OmniWeb bookmarks documents that employs fast enumeration techniques.

All properties of bookmarks documents can be called as methods on the wrapped list, returning a list containing each bookmarks document’s value for the property.

New in version 0.3.0.

Methods:

address()

bookmarks()

Returns a list of all bookmarks contained by the bookmarks documents in the list.

by_address(address)

by_is_read_only(is_read_only)

is_read_only()

address() XAURLList[source]
bookmarks() XAOmniWebBookmarkList[source]

Returns a list of all bookmarks contained by the bookmarks documents in the list.

Returns:

The list of bookmarks

Return type:

XAOmniWebBookmarkList

New in version 0.3.0.

by_address(address: str | XAURL) XAOmniWebBookmarksDocument | None[source]
by_is_read_only(is_read_only: bool) XAOmniWebBookmarksDocument | None[source]
is_read_only() list[bool][source]
class PyXA.apps.OmniWeb.XAOmniWebBrowser(properties)[source]

Bases: XAObject, XACloseable, XAPrintable, XADeletable

A browser in OmniWeb.app.

New in version 0.3.0.

Attributes:

active_tab

The tab currently being displayed in the browser.

address

The URL currently being displayed in the browser.

has_favorites

Whether the browser window displays the favorites shelf.

has_tabs

Whether the browser window displays the tabs drawer.

has_toolbar

Whether the browser window displays the toolbar.

is_busy

Whether the browser is currently loading a page.

shows_address

Whether the browser window displays the address (URL) field.

Methods:

tabs([filter])

Returns a list of tabs, as PyXA-wrapped objects, matching the given filter.

property active_tab: XAOmniWebTab

The tab currently being displayed in the browser.

property address: XAURL

The URL currently being displayed in the browser.

property has_favorites: bool

Whether the browser window displays the favorites shelf.

property has_tabs: bool

Whether the browser window displays the tabs drawer.

property has_toolbar: bool

Whether the browser window displays the toolbar.

property is_busy: bool

Whether the browser is currently loading a page.

property shows_address: bool

Whether the browser window displays the address (URL) field.

tabs(filter: dict | None = None) XAOmniWebTabList | None[source]

Returns a list of tabs, as PyXA-wrapped objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned tabs will have, or None

Returns:

The list of tabs

Return type:

XAOmniWebTabList

Example:

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> print(app.tabs())
<<class 'PyXA.apps.Bike.XABikeTabList'>['Untitled', 'PyXA Notes.bike']>

New in version 0.3.0.

class PyXA.apps.OmniWeb.XAOmniWebBrowserList(properties: dict, filter: dict | None = None)[source]

Bases: XAList, XACanOpenPath, XAClipboardCodable

A wrapper around lists of OmniWeb browsers that employs fast enumeration techniques.

All properties of browsers can be called as methods on the wrapped list, returning a list containing each browser’s value for the property.

New in version 0.3.0.

Methods:

active_tab()

address()

by_active_tab(active_tab)

by_address(address)

by_has_favorites(has_favorites)

by_has_tabs(has_tabs)

by_has_toolbar(has_toolbar)

by_is_busy(is_busy)

by_shows_address(shows_address)

has_favorites()

has_tabs()

has_toolbar()

is_busy()

shows_address()

tabs()

Returns a list of all tabs contained by the browsers in the list.

active_tab() XAOmniWebTabList[source]
address() XAURLList[source]
by_active_tab(active_tab: XAOmniWebTab) XAOmniWebBrowser | None[source]
by_address(address: str | XAURL) XAOmniWebBrowser | None[source]
by_has_favorites(has_favorites: bool) XAOmniWebBrowser | None[source]
by_has_tabs(has_tabs: bool) XAOmniWebBrowser | None[source]
by_has_toolbar(has_toolbar: bool) XAOmniWebBrowser | None[source]
by_is_busy(is_busy: bool) XAOmniWebBrowser | None[source]
by_shows_address(shows_address: bool) XAOmniWebBrowser | None[source]
has_favorites() list[bool][source]
has_tabs() list[bool][source]
has_toolbar() list[bool][source]
is_busy() list[bool][source]
shows_address() list[bool][source]
tabs() XAOmniWebTabList[source]

Returns a list of all tabs contained by the browsers in the list.

Returns:

The list of tabs

Return type:

XAOmniWebTabList

New in version 0.3.0.

class PyXA.apps.OmniWeb.XAOmniWebDocument(properties)[source]

Bases: XAObject, XACloseable, XAPrintable, XADeletable

A document of OmniWeb.app.

New in version 0.3.0.

Attributes:

modified

Whether the document has been modified since it was last saved.

name

The name of the document.

path

The location of the document on disk, if it has one.

property modified: bool

Whether the document has been modified since it was last saved.

property name: XAText

The name of the document.

property path: XAPath

The location of the document on disk, if it has one.

class PyXA.apps.OmniWeb.XAOmniWebDocumentList(properties: dict, filter: dict | None = None)[source]

Bases: XAList, XACanOpenPath, XAClipboardCodable

A wrapper around lists of OmniWeb documents that employs fast enumeration techniques.

All properties of documents can be called as methods on the wrapped list, returning a list containing each document’s value for the property.

New in version 0.3.0.

Methods:

by_modified(modified)

by_name(name)

by_path(path)

modified()

name()

path()

by_modified(modified: bool) XAOmniWebDocument | None[source]
by_name(name: str | XAText) XAOmniWebDocument | None[source]
by_path(path: str | XAPath) XAOmniWebDocument | None[source]
modified() list[bool][source]
name() XATextList[source]
path() list[XAPath][source]
class PyXA.apps.OmniWeb.XAOmniWebTab(properties)[source]

Bases: XAObject, XACloseable, XAPrintable, XADeletable

A tab in OmniWeb.app.

New in version 0.3.0.

Attributes:

address

The URL currently being displayed in the tab.

is_busy

Whether the tab is currently loading a page.

source

The source code of the page currently being displayed in the tab.

title

The title of the page currently being displayed in the tab.

Methods:

delete()

Closes the tab.

property address: XAURL

The URL currently being displayed in the tab.

delete() None[source]

Closes the tab.

New in version 0.3.0.

property is_busy: bool

Whether the tab is currently loading a page.

property source: XAText

The source code of the page currently being displayed in the tab.

property title: XAText

The title of the page currently being displayed in the tab.

class PyXA.apps.OmniWeb.XAOmniWebTabList(properties: dict, filter: dict | None = None)[source]

Bases: XAList, XACanOpenPath, XAClipboardCodable

A wrapper around lists of OmniWeb tabs that employs fast enumeration techniques.

All properties of tabs can be called as methods on the wrapped list, returning a list containing each tab’s value for the property.

New in version 0.3.0.

Methods:

address()

by_address(address)

by_is_busy(is_busy)

by_source(source)

by_title(title)

delete()

Closes all tabs in the list.

is_busy()

source()

title()

address() XAURLList[source]
by_address(address: str | XAURL) XAOmniWebTab | None[source]
by_is_busy(is_busy: bool) XAOmniWebTab | None[source]
by_source(source: str | XAText) XAOmniWebTab | None[source]
by_title(title: str | XAText) XAOmniWebTab | None[source]
delete() None[source]

Closes all tabs in the list.

New in version 0.3.0.

is_busy() list[bool][source]
source() XATextList[source]
title() XATextList[source]
class PyXA.apps.OmniWeb.XAOmniWebWindow(properties)[source]

Bases: XASBWindow

A window of OmniWeb.app.

New in version 0.3.0.

Attributes:

document

The document whose contents are currently displayed in the window.

property document: XAOmniWebDocument

The document whose contents are currently displayed in the window.

class PyXA.apps.OmniWeb.XAOmniWebWorkspace(properties)[source]

Bases: XAObject, XACloseable, XAPrintable, XADeletable

A workspace in OmniWeb.app.

New in version 0.3.0.

Attributes:

autosaves

Whether the workspace saves its browser windows automatically.

name

The name of the workspace.

Methods:

browsers([filter])

Returns a list of browsers, as PyXA-wrapped objects, matching the given filter.

property autosaves: bool

Whether the workspace saves its browser windows automatically.

browsers(filter: dict | None = None) XAOmniWebBrowserList | None[source]

Returns a list of browsers, as PyXA-wrapped objects, matching the given filter.

Parameters:

filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned browsers will have, or None

Returns:

The list of browsers

Return type:

XAOmniWebBrowserList

Example:

>>> import PyXA
>>> app = PyXA.Application("Bike")
>>> print(app.browsers())
<<class 'PyXA.apps.Bike.XABikeBrowserList'>['Untitled', 'PyXA Notes.bike']>

New in version 0.3.0.

property name: XAText

The name of the workspace.

class PyXA.apps.OmniWeb.XAOmniWebWorkspaceList(properties: dict, filter: dict | None = None)[source]

Bases: XAList, XACanOpenPath, XAClipboardCodable

A wrapper around lists of OmniWeb workspaces that employs fast enumeration techniques.

All properties of workspaces can be called as methods on the wrapped list, returning a list containing each workspace’s value for the property.

New in version 0.3.0.

Methods:

autosaves()

browsers()

Returns a list of all browsers contained by the workspaces in the list.

by_autosaves(autosaves)

by_name(name)

name()

autosaves() list[str][source]
browsers() XAOmniWebBrowserList[source]

Returns a list of all browsers contained by the workspaces in the list.

Returns:

The list of browsers

Return type:

XAOmniWebBrowserList

New in version 0.3.0.

by_autosaves(autosaves: bool) XAOmniWebWorkspace | None[source]
by_name(name: str | XAText) XAOmniWebWorkspace | None[source]
name() XATextList[source]