XABaseScriptable Module

Classes:

XASBApplication(properties)

An application class for scriptable applications.

XASBPrintable([properties])

XASBWindow(properties)

XASBWindowList(properties[, filter, obj_class])

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:

front_window

The front window of the application.

xa_scel

class PrintErrorHandling(value)[source]

Bases: Enum

Options for how to handle errors while printing.

Attributes:

DETAILED

Print a detailed report of PostScript errors

STANDARD

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

Ask user whether to save the file (bring up dialog)

NO

Do not save the file

YES

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:

XASBApplication

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:

XAObject

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:

XASBWindowList

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:

XABase.XAObject

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:

bounds

The bounding rectangle of the window.

closeable

Whether the window has a close button.

id

The unique identifier for the window.

index

The index of the window, ordered front to back.

miniaturizable

Whether the window can be miniaturized.

miniaturized

Whether the window is currently miniaturized.

name

The title of the window.

resizable

Whether the window can be resized.

visible

Whether the window is currently visible.

zoomable

Whether the window has a zoom button.

zoomed

Whether the window is currently zoomed.

Methods:

collapse()

Collapses (minimizes) the window.

get_clipboard_representation()

Gets a clipboard-codable representation of the window.

uncollapse()

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:

XASBWindow

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:

XASBWindow

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)

closeable()

collapse()

Collapses all windows in the list.

get_clipboard_representation()

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.

miniaturizable()

miniaturized()

name()

resizable()

uncollapse()

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]
closeable() list[bool][source]
collapse()[source]

Collapses all windows in the list.

New in version 0.0.5.

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.

id() list[str][source]
index() list[int][source]

Returns the index of the first occurrence of the element in the list, or -1 if no such element exists in the list.

New in version 0.1.2.

miniaturizable() list[bool][source]
miniaturized() list[bool][source]
name() list[str][source]
resizable() list[bool][source]
uncollapse()[source]

Uncollapses all windows in the list.

New in version 0.0.5.

visible() list[bool][source]
zoomable() list[bool][source]
zoomed() list[bool][source]