iWork Base Reference

New in version 0.1.1.

Control iWork applications using JXA-like syntax.

Classes:

XAiWorkApplication(properties)

A class for managing and interacting with iWork applications.

XAiWorkAudioClip(properties)

A class for managing and interacting with audio clips in Keynote.

XAiWorkAudioClipList(properties[, filter])

A wrapper around lists of audio clips that employs fast enumeration techniques.

XAiWorkCell(properties)

A class for managing and interacting with table cells in Keynote.

XAiWorkCellList(properties[, filter])

A wrapper around lists of cells that employs fast enumeration techniques.

XAiWorkChart(properties)

A class for managing and interacting with charts in Keynote.

XAiWorkChartList(properties[, filter])

A wrapper around lists of themes that employs fast enumeration techniques.

XAiWorkColumn(properties)

A class for managing and interacting with table columns in Keynote.

XAiWorkColumnList(properties[, filter])

A wrapper around lists of columns that employs fast enumeration techniques.

XAiWorkContainer(properties)

A class for managing and interacting with containers in Keynote.

XAiWorkContainerList(properties[, filter, ...])

A wrapper around lists of containers that employs fast enumeration techniques.

XAiWorkDocument(properties)

A class for managing and interacting with TextEdit documents.

XAiWorkDocumentList(properties[, filter, ...])

A wrapper around lists of themes that employs fast enumeration techniques.

XAiWorkGroup(properties)

A class for managing and interacting with iWork item groups in Keynote.

XAiWorkGroupList(properties[, filter])

A wrapper around lists of themes that employs fast enumeration techniques.

XAiWorkImage(properties)

A class for managing and interacting with images in Keynote.

XAiWorkImageList(properties[, filter])

A wrapper around lists of images that employs fast enumeration techniques.

XAiWorkLine(properties)

A class for managing and interacting with lines in Keynote.

XAiWorkLineList(properties[, filter])

A wrapper around lists of shapes that employs fast enumeration techniques.

XAiWorkMovie(properties)

A class for managing and interacting with movie containers in Keynote.

XAiWorkMovieList(properties[, filter])

A wrapper around lists of movies that employs fast enumeration techniques.

XAiWorkRange(properties)

A class for managing and interacting with ranges of table cells in Keynote.

XAiWorkRangeList(properties[, filter, obj_class])

A wrapper around lists of themes that employs fast enumeration techniques.

XAiWorkRow(properties)

A class for managing and interacting with table rows in Keynote.

XAiWorkRowList(properties[, filter])

A wrapper around lists of rows that employs fast enumeration techniques.

XAiWorkShape(properties)

A class for managing and interacting with shapes in Keynote.

XAiWorkShapeList(properties[, filter])

A wrapper around lists of shapes that employs fast enumeration techniques.

XAiWorkTable(properties)

A class for managing and interacting with tables in Keynote.

XAiWorkTableList(properties[, filter])

A wrapper around lists of shapes that employs fast enumeration techniques.

XAiWorkTextItem(properties)

A class for managing and interacting with text items in Keynote.

XAiWorkTextItemList(properties[, filter])

A wrapper around lists of text items that employs fast enumeration techniques.

XAiWorkWindow(properties)

A window of an iWork application.

XAiWorkiWorkItem(properties)

A class for managing and interacting with text, shapes, images, and other elements in Keynote.

XAiWorkiWorkItemList(properties[, filter, ...])

A wrapper around a list of documents.

class PyXA.apps.iWorkApplicationBase.XAiWorkApplication(properties)[source]

Bases: XASBApplication, XACanOpenPath

A class for managing and interacting with iWork applications.

New in version 0.1.1.

Classes:

Alignment(value)

Options for the horizontal and vertical alignment of content within table containers.

CellFormat(value)

Options for the format to use when formatting table cells.

ChartGrouping(value)

Options for how data is grouped within a chart.

ChartType(value)

Options for available chart types.

FillOption(value)

Options for the type of fill to use.

ImageQuality(value)

Options for the quality of exported images.

KeyAction(value)

Options for key states and interactions.

RepetitionMethod(value)

Options for whether and how a clip will repeat.

SortDirection(value)

Options for the direction of sorting when sorting table cells.

Attributes:

current_document

The current document of the front window.

frontmost

Whether this application is the active application.

name

The name of the application.

properties

All properties of the Keynote application.

version

The application version number.

Methods:

open(path)

Opens the file at the given filepath.

print(item[, print_properties, show_dialog])

Prints a document or window.

remove_password(document, password)

Removes the password from a document.

set_password(document, password, hint[, ...])

Sets the password of an unencrypted document, optionally storing the password in the user's keychain.

class Alignment(value)[source]

Bases: Enum

Options for the horizontal and vertical alignment of content within table containers.

Attributes:

AUTO

Auto-align based on content type.

BOTTOM

Bottom-align content.

CENTER_HORIZONTAL

Center-align content.

CENTER_VERTICAL

Center-align content.

JUSTIFY

Fully justify (left and right) content.

LEFT

Left-align content.

RIGHT

Right-align content.

TOP

Top-align content.

AUTO = 1633777012

Auto-align based on content type.

BOTTOM = 1635148404

Bottom-align content.

CENTER_HORIZONTAL = 1633907826

Center-align content.

CENTER_VERTICAL = 1633907826

Center-align content.

JUSTIFY = 1634366324

Fully justify (left and right) content.

LEFT = 1634494068

Left-align content.

RIGHT = 1634888052

Right-align content.

TOP = 1635153008

Top-align content.

class CellFormat(value)[source]

Bases: Enum

Options for the format to use when formatting table cells.

Attributes:

AUTO

Automatic format

CHECKBOX

Checkbox control format (Numbers only)

CURRENCY

Currency number format

DATE_AND_TIME

Date and time format

DECIMAL_NUMBER

Decimal number format

DURATION

Duration format

FRACTION

Fraction number format

NUMERAL_SYSTEM

Numeral System

PERCENT

Percentage number format

POPUP_MENU

Pop-up menu control format (Numbers only)

RATING

Rating format.

SCIENTIFIC

Scientific notation format

SLIDER

Slider control format (Numbers only)

STEPPER

Stepper control format (Numbers only)

TEXT

Text format

AUTO = 1717663092

Automatic format

CHECKBOX = 1717789544

Checkbox control format (Numbers only)

CURRENCY = 1717794162

Currency number format

DATE_AND_TIME = 1717859437

Date and time format

DECIMAL_NUMBER = 1852662386

Decimal number format

DURATION = 1717859698

Duration format

FRACTION = 1717989985

Fraction number format

NUMERAL_SYSTEM = 1717792371

Numeral System

PERCENT = 1718642034

Percentage number format

POPUP_MENU = 1717792880

Pop-up menu control format (Numbers only)

RATING = 1718772084

Rating format. (Numbers only)

SCIENTIFIC = 1718838121

Scientific notation format

SLIDER = 1717793644

Slider control format (Numbers only)

STEPPER = 1717793652

Stepper control format (Numbers only)

TEXT = 1668577396

Text format

class ChartGrouping(value)[source]

Bases: Enum

Options for how data is grouped within a chart.

Attributes:

COLUMN

Group by column

ROW

Group by row

COLUMN = 1262708579

Group by column

ROW = 1262708594

Group by row

class ChartType(value)[source]

Bases: Enum

Options for available chart types.

Attributes:

AREA_2D

Two-dimensional area chart.

AREA_3D

Three-dimensional area chart

HORIZONTAL_BAR_2D

Two-dimensional horizontal bar chart

HORIZONTAL_BAR_3D

Three-dimensional horizontal bar chart

LINE_2D

Two-dimensional line chart.

LINE_3D

Three-dimensional line chart

PIE_2D

Two-dimensional pie chart

PIE_3D

Three-dimensional pie chart.

SCATTERPLOT_2D

Two-dimensional scatterplot chart

STACKED_AREA_2D

Two-dimensional stacked area chart

STACKED_AREA_3D

Three-dimensional stacked area chart

STACKED_HORIZONTAL_BAR_2D

Two-dimensional stacked horizontal bar chart

STACKED_HORIZONTAL_BAR_3D

Three-dimensional stacked horizontal bar chart

STACKED_VERTICAL_BAR_2D

Two-dimensional stacked vertical bar chart

STACKED_VERTICAL_BAR_3D

Three-dimensional stacked bar chart

VERTICAL_BAR_2D

Two-dimensional vertical bar chart

VERTICAL_BAR_3D

Three-dimensional vertical bar chart

AREA_2D = 1634886962

Two-dimensional area chart.

AREA_3D = 1634886963

Three-dimensional area chart

HORIZONTAL_BAR_2D = 1751282226

Two-dimensional horizontal bar chart

HORIZONTAL_BAR_3D = 1751282227

Three-dimensional horizontal bar chart

LINE_2D = 1818848818

Two-dimensional line chart.

LINE_3D = 1818848819

Three-dimensional line chart

PIE_2D = 1885955378

Two-dimensional pie chart

PIE_3D = 1885955379

Three-dimensional pie chart.

SCATTERPLOT_2D = 1935896626

Two-dimensional scatterplot chart

STACKED_AREA_2D = 1935766066

Two-dimensional stacked area chart

STACKED_AREA_3D = 1935766067

Three-dimensional stacked area chart

STACKED_HORIZONTAL_BAR_2D = 1936220722

Two-dimensional stacked horizontal bar chart

STACKED_HORIZONTAL_BAR_3D = 1936220723

Three-dimensional stacked horizontal bar chart

STACKED_VERTICAL_BAR_2D = 1937138226

Two-dimensional stacked vertical bar chart

STACKED_VERTICAL_BAR_3D = 1937138227

Three-dimensional stacked bar chart

VERTICAL_BAR_2D = 1986163250

Two-dimensional vertical bar chart

VERTICAL_BAR_3D = 1986163251

Three-dimensional vertical bar chart

class FillOption(value)[source]

Bases: Enum

Options for the type of fill to use.

Attributes:

ADVANCED_GRADIENT_FILL

ADVANCED_IMAGE_FILL

COLOR_FILL

GRADIENT_FILL

IMAGE_FILL

NO_FILL

ADVANCED_GRADIENT_FILL = 1718182247
ADVANCED_IMAGE_FILL = 1718182249
COLOR_FILL = 1718182767
GRADIENT_FILL = 1718183794
IMAGE_FILL = 1718184301
NO_FILL = 1718185583
class ImageQuality(value)[source]

Bases: Enum

Options for the quality of exported images.

Attributes:

BEST

Best quality

BETTER

Better quality

GOOD

Good quality

BEST = 1265520690

Best quality

BETTER = 1265520689

Better quality

GOOD = 1265520688

Good quality

class KeyAction(value)[source]

Bases: Enum

Options for key states and interactions.

Attributes:

COMMAND_DOWN

CONTROL_DOWN

OPTION_DOWN

SHIFT_DOWN

COMMAND_DOWN = 1264807268
CONTROL_DOWN = 1264809068
OPTION_DOWN = 1265594484
SHIFT_DOWN = 1265854068
class RepetitionMethod(value)[source]

Bases: Enum

Options for whether and how a clip will repeat.

Attributes:

LOOP

Clip repeats sequentially

LOOP_BACK_AND_FORTH

Clip boomerangs back and forth repeatedly

NONE

Clip does not repeat

LOOP = 1836477552

Clip repeats sequentially

LOOP_BACK_AND_FORTH = 1836474982

Clip boomerangs back and forth repeatedly

NONE = 1836479086

Clip does not repeat

class SortDirection(value)[source]

Bases: Enum

Options for the direction of sorting when sorting table cells.

Attributes:

ASCENDING

Sort in increasing value order

DESCENDING

Sort in decreasing value order

ASCENDING = 1634952046

Sort in increasing value order

DESCENDING = 1685283694

Sort in decreasing value order

property current_document: XAiWorkDocument

The current document of the front window.

property frontmost: bool

Whether this application is the active application.

property name: str

The name of the application.

open(path: str | XAPath) XAiWorkDocument[source]

Opens the file at the given filepath.

Parameters:

target (Union[str, XABase.XAPath]) – The path of the file to open.

Returns:

A reference to newly created document object

Return type:

XAiWorkDocument

New in version 0.1.1.

print(item: XAiWorkDocument | XASBWindow, print_properties: dict | None = None, show_dialog: bool = True) XAiWorkApplication[source]

Prints a document or window.

Parameters:
  • item (Union[XAiWorkDocument, XABaseScriptable.XASBWindow]) – The document or window to print

  • print_properties (dict, optional) – The settings to pre-populate the print dialog with, defaults to None

  • show_dialog (bool, optional) – Whether to show the print dialog or skip right to printing, defaults to True

Returns:

A reference to the PyXA application object

Return type:

XAiWorkApplication

New in version 0.1.1.

property properties: dict

All properties of the Keynote application.

remove_password(document: XAiWorkDocument, password: str) XAiWorkApplication[source]

Removes the password from a document.

Parameters:
  • document (XAiWorkDocument) – The document to remove the password to

  • password (str) – The current password

Returns:

A reference to the PyXA application object

Return type:

XAiWorkApplication

New in version 0.1.1.

set_password(document: XAiWorkDocument, password: str, hint: str, save_in_keychain: bool = True) XAiWorkApplication[source]

Sets the password of an unencrypted document, optionally storing the password in the user’s keychain.

Parameters:
  • document (XAiWorkDocument) – The document to set the password for

  • password (str) – The password

  • hint (str) – A hint for the password

  • save_in_keychain (bool, optional) – Whether to save the password in the user’s keychain, defaults to True

Returns:

A reference to the PyXA application object

Return type:

XAiWorkApplication

New in version 0.1.1.

property version: str

The application version number.

class PyXA.apps.iWorkApplicationBase.XAiWorkAudioClip(properties)[source]

Bases: XAiWorkiWorkItem

A class for managing and interacting with audio clips in Keynote.

New in version 0.1.1.

Attributes:

clip_volume

The volume setting for the audio clip, from 0 to 100.

file_name

The name of the audio file.

repetition_method

Whether or how the audio clip repeats.

property clip_volume: int

The volume setting for the audio clip, from 0 to 100.

property file_name: str

The name of the audio file.

property repetition_method: RepetitionMethod

Whether or how the audio clip repeats.

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

Bases: XAiWorkiWorkItemList

A wrapper around lists of audio clips that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

by_clip_volume(clip_volume)

by_file_name(file_name)

by_repetition_method(repetition_method)

clip_volume()

file_name()

repetition_method()

by_clip_volume(clip_volume: int) XAiWorkAudioClip[source]
by_file_name(file_name: str) XAiWorkAudioClip[source]
by_repetition_method(repetition_method: RepetitionMethod) XAiWorkAudioClip[source]
clip_volume() list[int][source]
file_name() list[str][source]
repetition_method() list[RepetitionMethod][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkCell(properties)[source]

Bases: XAiWorkRange

A class for managing and interacting with table cells in Keynote.

New in version 0.1.1.

Attributes:

column

The cell's column.

formatted_value

The formatted form of the value stored in the cell.

formula

The formula in the cell as text.

properties

All properties of the cell.

row

The cell's row.

value

The value stored in the cell.

property column: XAiWorkColumn

The cell’s column.

property formatted_value: str

The formatted form of the value stored in the cell.

property formula: str

The formula in the cell as text.

property properties: dict

All properties of the cell.

property row: XAiWorkRow

The cell’s row.

property value: int | float | datetime | str | bool | None

The value stored in the cell.

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

Bases: XAiWorkRangeList

A wrapper around lists of cells that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

by_column(column)

by_formatted_value(formatted_value)

by_formula(formula)

by_properties(properties)

by_row(row)

by_value(value)

column()

formatted_value()

formula()

properties()

row()

value()

by_column(column: XAiWorkColumn) XAiWorkCell | None[source]
by_formatted_value(formatted_value: str) XAiWorkCell | None[source]
by_formula(formula: str) XAiWorkCell | None[source]
by_properties(properties: dict) XAiWorkCell | None[source]
by_row(row: XAiWorkRow) XAiWorkCell | None[source]
by_value(value: Any) XAiWorkCell | None[source]
column() XAiWorkColumnList[source]
formatted_value() list[str][source]
formula() list[str][source]
properties() list[dict][source]
row() XAiWorkRowList[source]
value() list[Any][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkChart(properties)[source]

Bases: XAiWorkiWorkItem

A class for managing and interacting with charts in Keynote.

New in version 0.1.1.

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

Bases: XAiWorkiWorkItemList

A wrapper around lists of themes that employs fast enumeration techniques.

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

New in version 0.1.1.

class PyXA.apps.iWorkApplicationBase.XAiWorkColumn(properties)[source]

Bases: XAiWorkRange

A class for managing and interacting with table columns in Keynote.

New in version 0.1.1.

Attributes:

address

The index of the column in the table.

properties

All properties of the column.

width

The width of the column in pixels.

property address: int

The index of the column in the table.

property properties: dict

All properties of the column.

property width: float

The width of the column in pixels.

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

Bases: XAiWorkRangeList

A wrapper around lists of columns that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

address()

by_address(address)

by_properties(properties)

by_width(width)

properties()

width()

address() list[float][source]
by_address(address: float) XAiWorkColumn | None[source]
by_properties(properties: dict) XAiWorkColumn | None[source]
by_width(width: int) XAiWorkColumn | None[source]
properties() list[dict][source]
width() list[int][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkContainer(properties)[source]

Bases: XAObject

A class for managing and interacting with containers in Keynote.

New in version 0.1.1.

Methods:

audio_clips([filter])

Returns a list of audio clips, as PyXA objects, matching the given filter.

charts([filter])

Returns a list of charts, as PyXA objects, matching the given filter.

groups([filter])

Returns a list of groups, as PyXA objects, matching the given filter.

images([filter])

Returns a list of images, as PyXA objects, matching the given filter.

iwork_items([filter])

Returns a list of iWork items, as PyXA objects, matching the given filter.

lines([filter])

Returns a list of lines, as PyXA objects, matching the given filter.

movies([filter])

Returns a list of movies, as PyXA objects, matching the given filter.

shapes([filter])

Returns a list of shapes, as PyXA objects, matching the given filter.

tables([filter])

Returns a list of tables, as PyXA objects, matching the given filter.

text_items([filter])

Returns a list of text_items, as PyXA objects, matching the given filter.

audio_clips(filter: dict | None = None) XAiWorkAudioClipList[source]

Returns a list of audio clips, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of audio clips

Return type:

XAiWorkAudioClipList

New in version 0.1.1.

charts(filter: dict | None = None) XAiWorkChartList[source]

Returns a list of charts, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of charts

Return type:

XAiWorkChartList

New in version 0.1.1.

groups(filter: dict | None = None) XAiWorkGroupList[source]

Returns a list of groups, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of groups

Return type:

XAiWorkGroupList

New in version 0.1.1.

images(filter: dict | None = None) XAiWorkImageList[source]

Returns a list of images, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of images

Return type:

XAiWorkImageList

New in version 0.1.1.

iwork_items(filter: dict | None = None) XAiWorkiWorkItemList[source]

Returns a list of iWork items, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of iWork items

Return type:

XAiWorkiWorkItemList

New in version 0.1.1.

lines(filter: dict | None = None) XAiWorkLineList[source]

Returns a list of lines, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of lines

Return type:

XAiWorkLineList

New in version 0.1.1.

movies(filter: dict | None = None) XAiWorkMovieList[source]

Returns a list of movies, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of movies

Return type:

XAiWorkMovieList

New in version 0.1.1.

shapes(filter: dict | None = None) XAiWorkShapeList[source]

Returns a list of shapes, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of shapes

Return type:

XAiWorkShapeList

New in version 0.1.1.

tables(filter: dict | None = None) XAiWorkTableList[source]

Returns a list of tables, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of tables

Return type:

XAiWorkTableList

New in version 0.1.1.

text_items(filter: dict | None = None) XAiWorkTextItemList[source]

Returns a list of text_items, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of text_items

Return type:

XAiWorkTextItemList

New in version 0.1.1.

class PyXA.apps.iWorkApplicationBase.XAiWorkContainerList(properties: dict, filter: dict | None = None, obj_class=None)[source]

Bases: XAList

A wrapper around lists of containers that employs fast enumeration techniques.

New in version 0.1.1.

Methods:

charts([filter])

groups([filter])

images([filter])

iwork_items([filter])

lines([filter])

movies([filter])

shapes([filter])

tables([filter])

text_items([filter])

charts(filter: dict | None = None) XAiWorkChartList[source]
groups(filter: dict | None = None) XAiWorkGroupList[source]
images(filter: dict | None = None) XAiWorkImageList[source]
iwork_items(filter: dict | None = None) XAiWorkiWorkItemList[source]
lines(filter: dict | None = None) XAiWorkLineList[source]
movies(filter: dict | None = None) XAiWorkMovieList[source]
shapes(filter: dict | None = None) XAiWorkShapeList[source]
tables(filter: dict | None = None) XAiWorkTableList[source]
text_items(filter: dict | None = None) XAiWorkTextItemList[source]
class PyXA.apps.iWorkApplicationBase.XAiWorkDocument(properties)[source]

Bases: XASBPrintable, XACloseable

A class for managing and interacting with TextEdit documents.

New in version 0.1.1.

Attributes:

file

The location of the document on the disk, if one exists.

id

The unique identifier for the document.

modified

Whether the document has been modified since its last save.

name

The name of the document.

password_protected

Whether the document is password protected.

properties

All properties of the document.

selection

A list of the currently selected items.

property file: XAPath

The location of the document on the disk, if one exists.

property id: str

The unique identifier for the document.

property modified: bool

Whether the document has been modified since its last save.

property name: str

The name of the document.

property password_protected: bool

Whether the document is password protected.

property properties: dict

All properties of the document.

property selection: XAiWorkiWorkItemList

A list of the currently selected items.

class PyXA.apps.iWorkApplicationBase.XAiWorkDocumentList(properties: dict, filter: dict | None = None, obj_class=None)[source]

Bases: XAList

A wrapper around lists of themes that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

by_file(file)

by_id(id)

by_modified(modified)

by_name(name)

by_password_protected(password_protected)

by_properties(properties)

by_selection(selection)

file()

id()

modified()

name()

password_protected()

properties()

selection()

by_file(file: str | XAPath) XAiWorkDocument | None[source]
by_id(id: str) XAiWorkDocument | None[source]
by_modified(modified: bool) XAiWorkDocument | None[source]
by_name(name: str) XAiWorkDocument | None[source]
by_password_protected(password_protected: bool) XAiWorkDocument | None[source]
by_properties(properties: dict) XAiWorkDocument | None[source]
by_selection(selection: XAiWorkiWorkItemList | list[XAiWorkiWorkItem]) XAiWorkDocument | None[source]
file() list[XAPath][source]
id() list[str][source]
modified() list[bool][source]
name() list[str][source]
password_protected() list[bool][source]
properties() list[dict][source]
selection() XAiWorkiWorkItemList[source]
class PyXA.apps.iWorkApplicationBase.XAiWorkGroup(properties)[source]

Bases: XAiWorkContainer

A class for managing and interacting with iWork item groups in Keynote.

New in version 0.1.1.

Attributes:

height

The height of the group.

parent

The container which contains the group.

position

The horizontal and vertical coordinates of the top left point of the group.

rotation

The rotation of the group, in degrees from 0 to 359.

width

The width of the group.

property height: int

The height of the group.

property parent: XAiWorkContainer

The container which contains the group.

property position: tuple[int, int]

The horizontal and vertical coordinates of the top left point of the group.

property rotation: int

The rotation of the group, in degrees from 0 to 359.

property width: int

The width of the group.

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

Bases: XAiWorkContainerList

A wrapper around lists of themes that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

by_height(height)

by_parent(parent)

by_position(position)

by_rotation(rotation)

by_width(width)

height()

parent()

position()

rotation()

width()

by_height(height: int) XAiWorkGroup[source]
by_parent(parent: XAiWorkContainer) XAiWorkGroup[source]
by_position(position: tuple[int, int]) XAiWorkGroup[source]
by_rotation(rotation: int) XAiWorkGroup[source]
by_width(width: int) XAiWorkGroup[source]
height() list[int][source]
parent() XAiWorkContainerList[source]
position() list[tuple[int, int]][source]
rotation() list[int][source]
width() list[int][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkImage(properties)[source]

Bases: XAiWorkiWorkItem

A class for managing and interacting with images in Keynote.

New in version 0.1.1.

Attributes:

description

Text associated with the image, read aloud by VoiceOVer.

file

The image file.

file_name

The name of the image file.

opacity

The opacity of the image, in percent from 0 to 100.

reflection_showing

Whether the image displays a reflection.

reflection_value

The percentage of reflection of the image, from 0 to 100.

rotation

The rotation of the image, in degrees from 0 to 359.

Methods:

replace_with(img_path)

Removes the image and inserts another in its place with the same width and height.

property description: str

Text associated with the image, read aloud by VoiceOVer.

property file: str

The image file.

property file_name: str

The name of the image file.

property opacity: int

The opacity of the image, in percent from 0 to 100.

property reflection_showing: bool

Whether the image displays a reflection.

property reflection_value: int

The percentage of reflection of the image, from 0 to 100.

replace_with(img_path: str | XAPath | XAURL) XAiWorkImage[source]

Removes the image and inserts another in its place with the same width and height.

Parameters:

img_path (Union[str, XABase.XAPath, XABase.XAURL]) – The path to the new image file.

Returns:

A reference to the new PyXA image object.

Return type:

XAiWorkImage

New in version 0.1.1.

property rotation: int

The rotation of the image, in degrees from 0 to 359.

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

Bases: XAiWorkiWorkItemList

A wrapper around lists of images that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

by_description(description)

by_file(file)

by_file_name(file_name)

by_opacity(opacity)

by_reflection_showing(reflection_showing)

by_reflection_value(reflection_value)

by_rotation(rotation)

description()

file()

file_name()

opacity()

reflection_showing()

reflection_value()

rotation()

by_description(description: str) XAiWorkImage[source]
by_file(file: str) XAiWorkImage[source]
by_file_name(file_name: str) XAiWorkImage[source]
by_opacity(opacity: int) XAiWorkImage[source]
by_reflection_showing(reflection_showing: bool) XAiWorkImage[source]
by_reflection_value(reflection_value: int) XAiWorkImage[source]
by_rotation(rotation: int) XAiWorkImage[source]
description() list[str][source]
file() list[str][source]
file_name() list[str][source]
opacity() list[int][source]
reflection_showing() list[bool][source]
reflection_value() list[int][source]
rotation() list[int][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkLine(properties)[source]

Bases: XAiWorkiWorkItem

A class for managing and interacting with lines in Keynote.

New in version 0.1.1.

Attributes:

end_point

A list of two numbers indicating the horizontal and vertical position of the line ending point.

reflection_showing

Whether the line displays a reflection.

reflection_value

The percent of reflection of the line, from 0 to 100.

rotation

The rotation of the line, in degrees from 0 to 359.

start_point

A list of two numbers indicating the horizontal and vertical position of the line starting point.

property end_point: tuple[int, int]

A list of two numbers indicating the horizontal and vertical position of the line ending point.

property reflection_showing: bool

Whether the line displays a reflection.

property reflection_value: int

The percent of reflection of the line, from 0 to 100.

property rotation: int

The rotation of the line, in degrees from 0 to 359.

property start_point: tuple[int, int]

A list of two numbers indicating the horizontal and vertical position of the line starting point.

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

Bases: XAiWorkiWorkItemList

A wrapper around lists of shapes that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

by_end_point(end_point)

by_reflection_showing(reflection_showing)

by_reflection_value(reflection_value)

by_rotation(rotation)

by_start_point(start_point)

end_point()

reflection_showing()

reflection_value()

rotation()

start_point()

by_end_point(end_point: tuple[int, int]) XAiWorkLine[source]
by_reflection_showing(reflection_showing: bool) XAiWorkLine[source]
by_reflection_value(reflection_value: int) XAiWorkLine[source]
by_rotation(rotation: int) XAiWorkLine[source]
by_start_point(start_point: tuple[int, int]) XAiWorkLine[source]
end_point() list[tuple[int, int]][source]
reflection_showing() list[bool][source]
reflection_value() list[int][source]
rotation() list[int][source]
start_point() list[tuple[int, int]][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkMovie(properties)[source]

Bases: XAiWorkiWorkItem

A class for managing and interacting with movie containers in Keynote.

New in version 0.1.1.

Attributes:

file_name

The name of the movie file.

movie_volume

The volume setting for the movie, from 0 to 100.

opacity

The percent opacity of the object.

reflection_showing

Whether the movie displays a reflection.

reflection_value

The percentage of reflection of the movie, from 0 to 100.

repetition_method

Whether or how the movie repeats.

rotation

The rotation of the movie, in degrees from 0 to 359.

property file_name: str

The name of the movie file.

property movie_volume: int

The volume setting for the movie, from 0 to 100.

property opacity: int

The percent opacity of the object.

property reflection_showing: bool

Whether the movie displays a reflection.

property reflection_value: int

The percentage of reflection of the movie, from 0 to 100.

property repetition_method: RepetitionMethod

Whether or how the movie repeats.

property rotation: int

The rotation of the movie, in degrees from 0 to 359.

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

Bases: XAiWorkiWorkItemList

A wrapper around lists of movies that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

by_file_name(file_name)

by_movie_volume(movie_volume)

by_opacity(opacity)

by_reflection_showing(reflection_showing)

by_reflection_value(reflection_value)

by_repetition_method(repetition_method)

by_rotation(rotation)

file_name()

movie_volume()

opacity()

reflection_showing()

reflection_value()

rotation()

by_file_name(file_name: str) XAiWorkMovie[source]
by_movie_volume(movie_volume: int) XAiWorkMovie[source]
by_opacity(opacity: int) XAiWorkMovie[source]
by_reflection_showing(reflection_showing: bool) XAiWorkMovie[source]
by_reflection_value(reflection_value: int) XAiWorkMovie[source]
by_repetition_method(repetition_method: RepetitionMethod) XAiWorkMovie[source]
by_rotation(rotation: int) XAiWorkMovie[source]
file_name() list[str][source]
movie_volume() list[int][source]
opacity() list[int][source]
reflection_showing() list[bool][source]
reflection_value() list[RepetitionMethod][source]
rotation() list[int][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkRange(properties)[source]

Bases: XAObject

A class for managing and interacting with ranges of table cells in Keynote.

New in version 0.1.1.

Attributes:

alignment

The horizontal alignment of content within the range's cells.

background_color

The background color of the range's cells.

font_name

The font of the range's cells.

font_size

The font size of the range's cells.

format

The format of the range's cells.

name

The range's coordinates.

properties

All properties of the range.

text_color

The text color of the range's cells.

text_wrap

Whether text within the range's cell should wrap.

vertical_alignment

The vertical alignment of content in the range's cells.

Methods:

cells([filter])

Returns a list of cells, as PyXA objects, matching the given filter.

clear()

Clears the content of every cell in the range.

columns([filter])

Returns a list of columns, as PyXA objects, matching the given filter.

merge()

Merges all cells in the range.

rows([filter])

Returns a list of rows, as PyXA objects, matching the given filter.

unmerge()

Unmerges all cells in the range.

property alignment: Alignment

The horizontal alignment of content within the range’s cells.

property background_color: XAColor

The background color of the range’s cells.

cells(filter: dict | None = None) XAiWorkCellList[source]

Returns a list of cells, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of cells

Return type:

XAiWorkCellList

New in version 0.1.1.

clear() XAiWorkRange[source]

Clears the content of every cell in the range.

Returns:

The range object

Return type:

XAiWorkRange

Example 1:

Clear all cells in a table

>>> import PyXA
>>> app = PyXA.Application("Keynote")
>>> range = app.documents()[0].slides()[0].tables()[0].cell_range
>>> range.clear()
Example 2:

Clear all cells whose value is 3

>>> import PyXA
>>> app = PyXA.Application("Keynote")
>>> cells = app.documents()[0].slides()[0].tables()[0].cells()
>>> for cell in cells:
>>>     if cell.value == 3:
>>>         cell.clear()

New in version 0.1.1.

columns(filter: dict | None = None) XAiWorkColumnList[source]

Returns a list of columns, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of columns

Return type:

XAiWorkColumnList

New in version 0.1.1.

property font_name: str

The font of the range’s cells.

property font_size: float

The font size of the range’s cells.

property format: CellFormat

The format of the range’s cells.

merge() XAiWorkRange[source]

Merges all cells in the range.

Returns:

The range object

Return type:

XAiWorkRange

Example 1:

Merge all cells in the first row of a table

>>> import PyXA
>>> app = PyXA.Application("Keynote")
>>> table = app.documents()[0].slides()[0].tables()[0]
>>> row = table.rows()[0]
>>> row.merge()
Example 2:

Merge all cells in the first column of a table

>>> import PyXA
>>> app = PyXA.Application("Keynote")
>>> table = app.documents()[0].slides()[0].tables()[0]
>>> col = table.columns()[0]
>>> col.merge()

Note

If you merge an entire row, then merge an entire column, all cells in the table will be merged. The same is true if the row and column operations are flipped.

New in version 0.1.1.

property name: str

The range’s coordinates.

property properties: dict

All properties of the range.

rows(filter: dict | None = None) XAiWorkRowList[source]

Returns a list of rows, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of rows

Return type:

XAiWorkRowList

New in version 0.1.1.

property text_color: XAColor

The text color of the range’s cells.

property text_wrap: bool

Whether text within the range’s cell should wrap.

unmerge() XAiWorkRange[source]

Unmerges all cells in the range.

Returns:

The range object

Return type:

XAiWorkRange

Example 1:

Unmerge all merged cells

>>> import PyXA
>>> app = PyXA.Application("Keynote")
>>> range = app.documents()[0].slides()[0].tables()[0].cell_range
>>> range.unmerge()

New in version 0.1.1.

property vertical_alignment: Alignment

The vertical alignment of content in the range’s cells.

class PyXA.apps.iWorkApplicationBase.XAiWorkRangeList(properties: dict, filter: dict | None = None, obj_class=None)[source]

Bases: XAList

A wrapper around lists of themes that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

alignment()

background_color()

by_alignment(alignment)

by_background_color(background_color)

by_font_name(font_name)

by_font_size(font_size)

by_format(format)

by_name(name)

by_properties(properties)

by_text_color(text_color)

by_text_wrap(text_wrap)

by_vertical_alignment(vertical_alignment)

font_name()

font_size()

format()

name()

properties()

text_color()

text_wrap()

vertical_alignment()

alignment() list[Alignment][source]
background_color() list[XAColor][source]
by_alignment(alignment: Alignment) XAiWorkRange | None[source]
by_background_color(background_color: XAColor) XAiWorkRange | None[source]
by_font_name(font_name: str) XAiWorkRange | None[source]
by_font_size(font_size: float) XAiWorkRange | None[source]
by_format(format: CellFormat) XAiWorkRange | None[source]
by_name(name: str) XAiWorkRange | None[source]
by_properties(properties: dict) XAiWorkRange | None[source]
by_text_color(text_color: XAColor) XAiWorkRange | None[source]
by_text_wrap(text_wrap: bool) XAiWorkRange | None[source]
by_vertical_alignment(vertical_alignment: Alignment) XAiWorkRange | None[source]
font_name() list[str][source]
font_size() list[float][source]
format() list[CellFormat][source]
name() list[str][source]
properties() list[dict][source]
text_color() list[XAColor][source]
text_wrap() list[bool][source]
vertical_alignment() list[Alignment][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkRow(properties)[source]

Bases: XAiWorkRange

A class for managing and interacting with table rows in Keynote.

New in version 0.1.1.

Attributes:

address

The index of the row in the table.

height

The height of the row in pixels.

properties

All properties of the row.

property address: int

The index of the row in the table.

property height: float

The height of the row in pixels.

property properties: dict

All properties of the row.

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

Bases: XAiWorkRangeList

A wrapper around lists of rows that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

address()

by_address(address)

by_height(height)

by_properties(properties)

height()

properties()

address() list[float][source]
by_address(address: float) XAiWorkRow | None[source]
by_height(height: int) XAiWorkRow | None[source]
by_properties(properties: dict) XAiWorkRow | None[source]
height() list[int][source]
properties() list[dict][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkShape(properties)[source]

Bases: XAiWorkiWorkItem

A class for managing and interacting with shapes in Keynote.

New in version 0.1.1.

Attributes:

background_fill_type

The background, if any, for the shape.

object_text

The text contained within the shape.

opacity

The percent opacity of the object.

properties

All properties of the shape.

reflection_showing

Whether the iWork item displays a reflection.

reflection_value

The percentage of relfection that the iWork item displays, from 0 to 100.

rotation

The rotation of the iWork item, in degrees, from 0 to 359.

Methods:

set_property(property_name, value)

Updates the value of a single property of the scripting element associated with this object.

property background_fill_type: FillOption

The background, if any, for the shape.

property object_text: XAText

The text contained within the shape.

property opacity: int

The percent opacity of the object.

property properties: dict

All properties of the shape.

property reflection_showing: bool

Whether the iWork item displays a reflection.

property reflection_value: int

The percentage of relfection that the iWork item displays, from 0 to 100.

property rotation: int

The rotation of the iWork item, in degrees, from 0 to 359.

set_property(property_name: str, value: Any)[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.

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

Bases: XAiWorkiWorkItemList

A wrapper around lists of shapes that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

background_fill_type()

by_background_fill_type(background_fill_type)

by_object_text(object_text)

by_opacity(opacity)

by_properties(properties)

by_reflection_showing(reflection_showing)

by_reflection_value(reflection_value)

by_rotation(rotation)

object_text()

opacity()

properties()

reflection_showing()

reflection_value()

rotation()

background_fill_type() list[FillOption][source]
by_background_fill_type(background_fill_type: FillOption) XAiWorkShape | None[source]
by_object_text(object_text: str | XAText) XAiWorkShape | None[source]
by_opacity(opacity: int) XAiWorkShape | None[source]
by_properties(properties: dict) XAiWorkShape | None[source]
by_reflection_showing(reflection_showing: bool) XAiWorkShape | None[source]
by_reflection_value(reflection_value: int) XAiWorkShape | None[source]
by_rotation(rotation: int) XAiWorkShape | None[source]
object_text() XATextList[source]
opacity() list[int][source]
properties() list[dict][source]
reflection_showing() list[bool][source]
reflection_value() list[int][source]
rotation() list[int][source]
class PyXA.apps.iWorkApplicationBase.XAiWorkTable(properties)[source]

Bases: XAiWorkiWorkItem

A class for managing and interacting with tables in Keynote.

New in version 0.1.1.

Attributes:

cell_range

The range of all cells in the table.

column_count

The number of columns in the table.

footer_row_count

The number of footer rows in the table.

header_column_count

The number of header columns in the table.

header_row_count

The number of header rows in the table.

name

The name of the table.

row_count

The number of rows in the table.

selection_range

The currently selected cells.

Methods:

cells([filter])

Returns a list of cells, as PyXA objects, matching the given filter.

columns([filter])

Returns a list of columns, as PyXA objects, matching the given filter.

ranges([filter])

Returns a list of ranges, as PyXA objects, matching the given filter.

rows([filter])

Returns a list of rows, as PyXA objects, matching the given filter.

sort(by_column[, in_rows, direction])

Sorts the table according to the specified column, in the specified sorting direction.

property cell_range: XAiWorkRange

The range of all cells in the table.

cells(filter: dict | None = None) XAiWorkCellList[source]

Returns a list of cells, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of cells

Return type:

XAiWorkCellList

New in version 0.1.1.

property column_count: int

The number of columns in the table.

columns(filter: dict | None = None) XAiWorkColumnList[source]

Returns a list of columns, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of columns

Return type:

XAiWorkColumnList

New in version 0.1.1.

property footer_row_count: int

The number of footer rows in the table.

property header_column_count: int

The number of header columns in the table.

property header_row_count: int

The number of header rows in the table.

property name: str

The name of the table.

ranges(filter: dict | None = None) XAiWorkRangeList[source]

Returns a list of ranges, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of ranges

Return type:

XAiWorkRangeList

New in version 0.1.1.

property row_count: int

The number of rows in the table.

rows(filter: dict | None = None) XAiWorkRowList[source]

Returns a list of rows, as PyXA objects, matching the given filter.

Parameters:

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

Returns:

The list of rows

Return type:

XAiWorkRowList

New in version 0.1.1.

property selection_range: XAiWorkRange

The currently selected cells.

sort(by_column: XAiWorkColumn, in_rows: list[XAiWorkRow] | XAiWorkRowList | None = None, direction: SortDirection = SortDirection.ASCENDING) XAiWorkTable[source]

Sorts the table according to the specified column, in the specified sorting direction.

Parameters:
Returns:

The table object

Return type:

XAiWorkTable

New in version 0.1.1.

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

Bases: XAiWorkiWorkItemList

A wrapper around lists of shapes that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

by_cell_range(cell_range)

by_column_count(column_count)

by_footer_row_count(footer_row_count)

by_header_column_count(header_column_count)

by_header_row_count(header_row_count)

by_name(name)

by_row_count(row_count)

by_selection_range(selection_range)

cell_range()

column_count()

footer_row_count()

header_column_count()

header_row_count()

name()

row_count()

selection_range()

by_cell_range(cell_range: XAiWorkRange) XAiWorkTable | None[source]
by_column_count(column_count: int) XAiWorkTable | None[source]
by_header_column_count(header_column_count: int) XAiWorkTable | None[source]
by_header_row_count(header_row_count: int) XAiWorkTable | None[source]
by_name(name: str) XAiWorkTable | None[source]
by_row_count(row_count: int) XAiWorkTable | None[source]
by_selection_range(selection_range: XAiWorkRange) XAiWorkTable | None[source]
cell_range() XAiWorkRangeList[source]
column_count() list[int][source]
footer_row_count() list[int][source]
header_column_count() list[int][source]
header_row_count() list[int][source]
name() list[str][source]
row_count() list[int][source]
selection_range() XAiWorkRangeList[source]
class PyXA.apps.iWorkApplicationBase.XAiWorkTextItem(properties)[source]

Bases: XAiWorkiWorkItem

A class for managing and interacting with text items in Keynote.

New in version 0.1.1.

Attributes:

background_fill_type

The background of the text item.

opacity

The opacity of the text item.

reflection_showing

Whether the text item displays a reflection.

reflection_value

The percentage of reflection of the text item, from 0 to 100.

rotation

The rotation of the text item, in degrees from 0 to 359.

text

The text contained within the text item.

property background_fill_type: FillOption

The background of the text item.

property opacity: int

The opacity of the text item.

property reflection_showing: bool

Whether the text item displays a reflection.

property reflection_value: int

The percentage of reflection of the text item, from 0 to 100.

property rotation: int

The rotation of the text item, in degrees from 0 to 359.

property text: XAText

The text contained within the text item.

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

Bases: XAiWorkiWorkItemList

A wrapper around lists of text items that employs fast enumeration techniques.

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

New in version 0.1.1.

Methods:

background_fill_type()

by_background_fill_type(background_fill_type)

by_opacity(opacity)

by_reflection_showing(reflection_showing)

by_reflection_value(reflection_value)

by_rotation(rotation)

by_text(text)

opacity()

reflection_showing()

reflection_value()

rotation()

text()

background_fill_type() list[FillOption][source]
by_background_fill_type(background_fill_type: FillOption) XAiWorkTextItem[source]
by_opacity(opacity: int) XAiWorkTextItem[source]
by_reflection_showing(reflection_showing: bool) XAiWorkTextItem[source]
by_reflection_value(reflection_value: int) XAiWorkTextItem[source]
by_rotation(rotation: int) XAiWorkTextItem[source]
by_text(text: str | XAText) XAiWorkTextItem[source]
opacity() list[int][source]
reflection_showing() list[bool][source]
reflection_value() list[int][source]
rotation() list[int][source]
text() XATextList[source]
class PyXA.apps.iWorkApplicationBase.XAiWorkWindow(properties)[source]

Bases: XASBWindow, XASBPrintable, XAObject

A window of an iWork application.

New in version 0.1.1.

class PyXA.apps.iWorkApplicationBase.XAiWorkiWorkItem(properties)[source]

Bases: XAObject

A class for managing and interacting with text, shapes, images, and other elements in Keynote.

New in version 0.1.1.

Methods:

delete()

Deletes the item.

duplicate()

Duplicates the item.

lock()

Locks the properties of the item, preventing changes.

resize(width, height)

Sets the width and height of the item.

set_position(x, y)

unlock()

Unlocks the properties of the item, allowing changes.

Attributes:

height

The height of the iWork item.

locked

Whether the object is locked.

parent

The iWork container that contains the iWork item.

position

The horizontal and vertical coordinates of the top left point of the iWork item.

width

The width of the iWork item.

delete()[source]

Deletes the item.

New in version 0.1.1.

duplicate() XAiWorkiWorkItem[source]

Duplicates the item.

Returns:

A reference to the PyXA object that called this method.

Return type:

XAiWorkiWorkItem

New in version 0.1.1.

property height: int

The height of the iWork item.

lock() XAiWorkiWorkItem[source]

Locks the properties of the item, preventing changes.

Returns:

The iWork item

Return type:

XAiWorkiWorkItem

New in version 0.1.1.

property locked: bool

Whether the object is locked.

property parent: XAiWorkContainer

The iWork container that contains the iWork item.

property position: tuple[int, int]

The horizontal and vertical coordinates of the top left point of the iWork item.

resize(width: int, height: int) XAiWorkiWorkItem[source]

Sets the width and height of the item.

Parameters:
  • width (int) – The desired width, in pixels

  • height (int) – The desired height, in pixels

Returns:

The iWork item

Return type:

XAiWorkiWorkItem

New in version 0.1.1.

set_position(x: int, y: int) XAiWorkiWorkItem[source]
unlock() XAiWorkiWorkItem[source]

Unlocks the properties of the item, allowing changes.

Returns:

The iWork item

Return type:

XAiWorkiWorkItem

New in version 0.1.1.

property width: int

The width of the iWork item.

class PyXA.apps.iWorkApplicationBase.XAiWorkiWorkItemList(properties: dict, filter: dict | None = None, obj_class=None)[source]

Bases: XAList

A wrapper around a list of documents.

New in version 0.1.1.

Methods:

by_height(height)

by_locked(locked)

by_parent(parent)

by_position(position)

by_properties(properties)

by_width(width)

height()

locked()

parent()

position()

properties()

width()

by_height(height: int) XAiWorkiWorkItem | None[source]
by_locked(locked: bool) XAiWorkiWorkItem | None[source]
by_parent(parent: XAiWorkContainer) XAiWorkiWorkItem | None[source]
by_position(position: tuple[int, int]) XAiWorkiWorkItem | None[source]
by_properties(properties: dict) XAiWorkiWorkItem | None[source]
by_width(width: int) XAiWorkiWorkItem | None[source]
height() list[int][source]
locked() list[bool][source]
parent() XAiWorkContainerList[source]
position() list[tuple[int, int]][source]
properties() list[dict][source]
width() list[int][source]