iWork Base Reference
New in version 0.1.1.
Control iWork applications using JXA-like syntax.
Classes:
|
A class for managing and interacting with iWork applications. |
|
A class for managing and interacting with audio clips in Keynote. |
|
A wrapper around lists of audio clips that employs fast enumeration techniques. |
|
A class for managing and interacting with table cells in Keynote. |
|
A wrapper around lists of cells that employs fast enumeration techniques. |
|
A class for managing and interacting with charts in Keynote. |
|
A wrapper around lists of themes that employs fast enumeration techniques. |
|
A class for managing and interacting with table columns in Keynote. |
|
A wrapper around lists of columns that employs fast enumeration techniques. |
|
A class for managing and interacting with containers in Keynote. |
|
A wrapper around lists of containers that employs fast enumeration techniques. |
|
A class for managing and interacting with TextEdit documents. |
|
A wrapper around lists of themes that employs fast enumeration techniques. |
|
A class for managing and interacting with iWork item groups in Keynote. |
|
A wrapper around lists of themes that employs fast enumeration techniques. |
|
A class for managing and interacting with images in Keynote. |
|
A wrapper around lists of images that employs fast enumeration techniques. |
|
A class for managing and interacting with lines in Keynote. |
|
A wrapper around lists of shapes that employs fast enumeration techniques. |
|
A class for managing and interacting with movie containers in Keynote. |
|
A wrapper around lists of movies that employs fast enumeration techniques. |
|
A class for managing and interacting with ranges of table cells in Keynote. |
|
A wrapper around lists of themes that employs fast enumeration techniques. |
|
A class for managing and interacting with table rows in Keynote. |
|
A wrapper around lists of rows that employs fast enumeration techniques. |
|
A class for managing and interacting with shapes in Keynote. |
|
A wrapper around lists of shapes that employs fast enumeration techniques. |
|
A class for managing and interacting with tables in Keynote. |
|
A wrapper around lists of shapes that employs fast enumeration techniques. |
|
A class for managing and interacting with text items in Keynote. |
|
A wrapper around lists of text items that employs fast enumeration techniques. |
|
A window of an iWork application. |
|
A class for managing and interacting with text, shapes, images, and other elements in Keynote. |
|
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:
The current document of the front window.
Whether this application is the active application.
The name of the application.
All properties of the Keynote application.
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-align based on content type.
Bottom-align content.
Center-align content.
Center-align content.
Fully justify (left and right) content.
Left-align content.
Right-align content.
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:
Automatic format
Checkbox control format (Numbers only)
Currency number format
Date and time format
Decimal number format
Duration format
Fraction number format
Numeral System
Percentage number format
Pop-up menu control format (Numbers only)
Rating format.
Scientific notation format
Slider control format (Numbers only)
Stepper control format (Numbers only)
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:
Group by column
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:
Two-dimensional area chart.
Three-dimensional area chart
Two-dimensional horizontal bar chart
Three-dimensional horizontal bar chart
Two-dimensional line chart.
Three-dimensional line chart
Two-dimensional pie chart
Three-dimensional pie chart.
Two-dimensional scatterplot chart
Two-dimensional stacked area chart
Three-dimensional stacked area chart
Two-dimensional stacked horizontal bar chart
Three-dimensional stacked horizontal bar chart
Two-dimensional stacked vertical bar chart
Three-dimensional stacked bar chart
Two-dimensional vertical bar chart
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 = 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 quality
Better quality
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 = 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:
Clip repeats sequentially
Clip boomerangs back and forth repeatedly
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:
Sort in increasing value order
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:
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:
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:
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:
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:
The volume setting for the audio clip, from 0 to 100.
The name of the audio file.
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)- by_clip_volume(clip_volume: int) XAiWorkAudioClip [source]
- by_file_name(file_name: str) XAiWorkAudioClip [source]
- by_repetition_method(repetition_method: RepetitionMethod) XAiWorkAudioClip [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:
The cell's column.
The formatted form of the value stored in the cell.
The formula in the cell as text.
All properties of the cell.
The cell's row.
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
()formula
()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]
- row() XAiWorkRowList [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:
The index of the column in the table.
All properties of the column.
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)width
()- by_address(address: float) XAiWorkColumn | None [source]
- by_properties(properties: dict) XAiWorkColumn | None [source]
- by_width(width: int) XAiWorkColumn | None [source]
- class PyXA.apps.iWorkApplicationBase.XAiWorkContainer(properties)[source]
Bases:
XAObject
A class for managing and interacting with containers in Keynote.
See also
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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.
See also
New in version 0.1.1.
Attributes:
The location of the document on the disk, if one exists.
The unique identifier for the document.
Whether the document has been modified since its last save.
The name of the document.
Whether the document is password protected.
All properties of the document.
A list of the currently selected items.
- 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
()- 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]
- 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:
The height of the group.
The container which contains the group.
The horizontal and vertical coordinates of the top left point of the group.
The rotation of the group, in degrees from 0 to 359.
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]
- parent() XAiWorkContainerList [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:
Text associated with the image, read aloud by VoiceOVer.
The image file.
The name of the image file.
The opacity of the image, in percent from 0 to 100.
Whether the image displays a reflection.
The percentage of reflection of the image, from 0 to 100.
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:
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)file
()opacity
()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]
- 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:
A list of two numbers indicating the horizontal and vertical position of the line ending point.
Whether the line displays a reflection.
The percent of reflection of the line, from 0 to 100.
The rotation of the line, in degrees from 0 to 359.
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)rotation
()- 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]
- 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:
The name of the movie file.
The volume setting for the movie, from 0 to 100.
The percent opacity of the object.
Whether the movie displays a reflection.
The percentage of reflection of the movie, from 0 to 100.
Whether or how the movie repeats.
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)opacity
()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]
- reflection_value() list[RepetitionMethod] [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:
The horizontal alignment of content within the range's cells.
The background color of the range's cells.
The font of the range's cells.
The font size of the range's cells.
The format of the range's cells.
The range's coordinates.
All properties of the range.
The text color of the range's cells.
Whether text within the range's cell should wrap.
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.
- 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:
New in version 0.1.1.
- clear() XAiWorkRange [source]
Clears the content of every cell in the range.
- Returns:
The range object
- Return type:
- 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:
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:
- 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:
New in version 0.1.1.
- 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:
- 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.
- 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:
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)format
()name
()- 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]
- format() list[CellFormat] [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:
The index of the row in the table.
The height of the row in pixels.
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
()- by_address(address: float) XAiWorkRow | None [source]
- by_height(height: int) XAiWorkRow | None [source]
- by_properties(properties: dict) XAiWorkRow | None [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:
The background, if any, for the shape.
The text contained within the shape.
The percent opacity of the object.
All properties of the shape.
Whether the iWork item displays a reflection.
The percentage of relfection that the iWork item displays, from 0 to 100.
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 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:
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:
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)opacity
()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]
- 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:
The range of all cells in the table.
The number of columns in the table.
The number of footer rows in the table.
The number of header columns in the table.
The number of header rows in the table.
The name of the table.
The number of rows in the table.
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:
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:
New in version 0.1.1.
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:
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:
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:
by_column (XAiWorkColumn) – The column to sort by
in_rows (Union[list[XAiWorkRow], XAiWorkRowList, None], optional) – The rows to sort, or None to sort the whole table, defaults to None
direction (XAiWorkApplication.SortDirection, optional) – The direction to sort in, defaults to XAiWorkApplication.SortDirection.ASCENDING
- Returns:
The table object
- Return type:
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)name
()- 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]
- 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:
The background of the text item.
The opacity of the text item.
Whether the text item displays a reflection.
The percentage of reflection of the text item, from 0 to 100.
The rotation of the text item, in degrees from 0 to 359.
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.
- 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:
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
()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]
- 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.
See also
New in version 0.1.1.
Methods:
delete
()Deletes the item.
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:
The height of the iWork item.
Whether the object is locked.
The iWork container that contains the iWork item.
The horizontal and vertical coordinates of the top left point of the iWork item.
The width of the iWork item.
- duplicate() XAiWorkiWorkItem [source]
Duplicates the item.
- Returns:
A reference to the PyXA object that called this method.
- Return type:
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:
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:
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:
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
()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]
- parent() XAiWorkContainerList [source]