XABaseScriptable Module
Classes:
|
An application class for scriptable applications. |
|
|
|
|
|
A wrapper around a list of windows. |
- class PyXA.XABaseScriptable.XASBApplication(properties)[source]
Bases:
XAApplication
An application class for scriptable applications.
See also
XABase.XAApplication
Classes:
PrintErrorHandling
(value)Options for how to handle errors while printing.
SaveOption
(value)Options for whether to save documents when closing them.
Methods:
activate
()Activates the application.
set_property
(property_name, value)Updates the value of a single property of the scripting element associated with this object.
windows
([filter])Returns a list of windows, as PyXA objects, matching the given filter.
Attributes:
The front window of the application.
- class PrintErrorHandling(value)[source]
Bases:
Enum
Options for how to handle errors while printing.
Attributes:
Print a detailed report of PostScript errors
Standard PostScript error handling
- DETAILED = 'lwdt'
Print a detailed report of PostScript errors
- STANDARD = 'lwst'
Standard PostScript error handling
- class SaveOption(value)[source]
Bases:
Enum
Options for whether to save documents when closing them.
Attributes:
Ask user whether to save the file (bring up dialog)
Do not save the file
Save the file
- ASK = 1634954016
Ask user whether to save the file (bring up dialog)
- NO = 1852776480
Do not save the file
- YES = 2036691744
Save the file
- activate() XASBApplication [source]
Activates the application.
- Returns:
The application object
- Return type:
New in version 0.1.0.2.
- property front_window: XASBWindow
The front window of the application.
- set_property(property_name, value)[source]
Updates the value of a single property of the scripting element associated with this object.
- Parameters:
property (str) – The name of the property to assign a new value to.
value (Any) – The value to assign to the specified property.
- Returns:
A reference to this PyXA object.
- Return type:
New in version 0.0.1.
- windows(filter: dict | None = None) XASBWindowList [source]
Returns a list of windows, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned windows will have, or None
- Returns:
The list of windows
- Return type:
New in version 0.0.4.
- property xa_scel: SBApplication
- class PyXA.XABaseScriptable.XASBPrintable(properties: dict | None = None)[source]
Bases:
XAObject
Methods:
print
([properties, print_dialog])Prints a document, window, or item.
- print(properties: dict | None = None, print_dialog=None) XAObject [source]
Prints a document, window, or item.
- Returns:
A reference to the PyXA objects that called this method.
- Return type:
Changed in version 0.0.2: Printing now initialized from a separate thread to avoid delaying main thread
New in version 0.0.1.
- class PyXA.XABaseScriptable.XASBWindow(properties)[source]
Bases:
XAObject
,XACloseable
Attributes:
The bounding rectangle of the window.
Whether the window has a close button.
The unique identifier for the window.
The index of the window, ordered front to back.
Whether the window can be miniaturized.
Whether the window is currently miniaturized.
The title of the window.
Whether the window can be resized.
Whether the window is currently visible.
Whether the window has a zoom button.
Whether the window is currently zoomed.
Methods:
collapse
()Collapses (minimizes) the window.
Gets a clipboard-codable representation of the window.
Uncollapses (unminimizes/expands) the window.
- property bounds: XARectangle
The bounding rectangle of the window.
- property closeable: bool
Whether the window has a close button.
- collapse() XASBWindow [source]
Collapses (minimizes) the window.
- Returns:
A reference to the now-collapsed window object.
- Return type:
New in version 0.0.4.
- get_clipboard_representation() str [source]
Gets a clipboard-codable representation of the window.
When the clipboard content is set to a window, the name of the window is added to the clipboard.
- Returns:
The name of the window
- Return type:
str
New in version 0.0.8.
- property id: int
The unique identifier for the window.
- property index: int
The index of the window, ordered front to back.
- property miniaturizable: bool
Whether the window can be miniaturized.
- property miniaturized: bool
Whether the window is currently miniaturized.
- property name: str
The title of the window.
- property resizable: bool
Whether the window can be resized.
- uncollapse() XASBWindow [source]
Uncollapses (unminimizes/expands) the window.
- Returns:
A reference to the uncollapsed window object.
- Return type:
New in version 0.0.4.
- property visible: bool
Whether the window is currently visible.
- property zoomable: bool
Whether the window has a zoom button.
- property zoomed: bool
Whether the window is currently zoomed.
- class PyXA.XABaseScriptable.XASBWindowList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XAList
A wrapper around a list of windows.
New in version 0.0.5.
Methods:
bounds
()by_bounds
(bounds)by_closeable
(closeable)by_id
(id)by_index
(index)by_miniaturizable
(miniaturizable)by_miniaturized
(miniaturized)by_name
(name)by_resizable
(resizable)by_visible
(visible)by_zoomable
(zoomable)by_zoomed
(zoomed)collapse
()Collapses all windows in the list.
Gets a clipboard-codable representation of each window in the list.
id
()index
()Returns the index of the first occurrence of the element in the list, or -1 if no such element exists in the list.
name
()Uncollapses all windows in the list.
visible
()zoomable
()zoomed
()- bounds() list[XARectangle] [source]
- by_bounds(bounds: tuple[int, int, int, int] | XARectangle) XASBWindow | None [source]
- by_closeable(closeable: bool) XASBWindow | None [source]
- by_id(id: int) XASBWindow | None [source]
- by_index(index: int) XASBWindow | None [source]
- by_miniaturizable(miniaturizable: bool) XASBWindow | None [source]
- by_miniaturized(miniaturized: bool) XASBWindow | None [source]
- by_name(name: str) XASBWindow | None [source]
- by_resizable(resizable: bool) XASBWindow | None [source]
- by_visible(visible: bool) XASBWindow | None [source]
- by_zoomable(zoomable: bool) XASBWindow | None [source]
- by_zoomed(zoomed: bool) XASBWindow | None [source]
- get_clipboard_representation() str [source]
Gets a clipboard-codable representation of each window in the list.
When the clipboard content is set to a list of windows, the name of each window is added to the clipboard.
- Returns:
A list of window names
- Return type:
str
New in version 0.0.8.