OmniWeb Module Reference
New in version 0.3.0.
Control OmniWeb using JXA-like syntax.
Classes:
|
A class for managing and interacting with OmniWeb.app. |
|
A bookmark in OmniWeb.app. |
|
A wrapper around lists of OmniWeb bookmarks that employs fast enumeration techniques. |
|
A bookmarks document in OmniWeb.app. |
|
A wrapper around lists of OmniWeb bookmarks documents that employs fast enumeration techniques. |
|
A browser in OmniWeb.app. |
|
A wrapper around lists of OmniWeb browsers that employs fast enumeration techniques. |
|
A document of OmniWeb.app. |
|
A wrapper around lists of OmniWeb documents that employs fast enumeration techniques. |
|
A tab in OmniWeb.app. |
|
A wrapper around lists of OmniWeb tabs that employs fast enumeration techniques. |
|
A window of OmniWeb.app. |
|
A workspace in OmniWeb.app. |
|
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:
The currently active workspace.
The bookmark item whose contents are displayed in the Favorites bar.
Whether OmniWeb is the frontmost application.
The complete version string for this instance of OmniWeb.
The name of the application.
The default bookmarks document.
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.
Returns a dictionary containing information about the frontmost window.
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 = '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:
- 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:
- 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:
- 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:
- 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:
- 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:
The URL of the bookmark.
The number of seconds between checks for updates to the bookmark.
Whether the bookmark has been added since the last time it was checked for updates.
Whether this page could be retrieved last time it was checked.
The date and time the bookmark was last checked for updates.
The label text of the bookmark item.
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.
- 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:
- 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.
- 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
()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)is_new
()name
()note
()- bookmarks() XAOmniWebBookmarkList [source]
Returns a list of all bookmarks contained by the bookmarks documents in the list.
- Returns:
The list of bookmarks
- Return type:
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]
- 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:
The URL at which these bookmarks are stored.
Whether the bookmarks document is read-only.
Methods:
bookmarks
([filter])Returns a list of bookmarks, as PyXA-wrapped objects, matching the given filter.
- 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:
- 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
()Returns a list of all bookmarks contained by the bookmarks documents in the list.
by_address
(address)by_is_read_only
(is_read_only)- bookmarks() XAOmniWebBookmarkList [source]
Returns a list of all bookmarks contained by the bookmarks documents in the list.
- Returns:
The list of bookmarks
- Return type:
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]
- class PyXA.apps.OmniWeb.XAOmniWebBrowser(properties)[source]
Bases:
XAObject
,XACloseable
,XAPrintable
,XADeletable
A browser in OmniWeb.app.
New in version 0.3.0.
Attributes:
The tab currently being displayed in the browser.
The URL currently being displayed in the browser.
Whether the browser window displays the favorites shelf.
Whether the browser window displays the tabs drawer.
Whether the browser window displays the toolbar.
Whether the browser is currently loading a page.
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 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:
- 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:
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_tabs
()is_busy
()tabs
()Returns a list of all tabs contained by the browsers in the list.
- active_tab() XAOmniWebTabList [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]
- tabs() XAOmniWebTabList [source]
Returns a list of all tabs contained by the browsers in the list.
- Returns:
The list of tabs
- Return type:
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:
Whether the document has been modified since it was last saved.
The name of the document.
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.
- 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]
- name() XATextList [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:
The URL currently being displayed in the tab.
Whether the tab is currently loading a page.
The source code of the page currently being displayed in the tab.
The title of the page currently being displayed in the tab.
Methods:
delete
()Closes the tab.
- property is_busy: bool
Whether the tab is currently loading a page.
- 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
()- 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]
- 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:
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:
Whether the workspace saves its browser windows automatically.
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:
- 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.
- 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:
browsers
()Returns a list of all browsers contained by the workspaces in the list.
by_autosaves
(autosaves)by_name
(name)name
()- browsers() XAOmniWebBrowserList [source]
Returns a list of all browsers contained by the workspaces in the list.
- Returns:
The list of browsers
- Return type:
New in version 0.3.0.
- by_autosaves(autosaves: bool) XAOmniWebWorkspace | None [source]
- by_name(name: str | XAText) XAOmniWebWorkspace | None [source]
- name() XATextList [source]