Cardhop Module Reference
New in version 0.1.0.
Control Cardhop using JXA-like syntax.
Classes:
|
A class for interacting with Cardhop.app. |
|
A document of Cardhop.app. |
|
A wrapper around lists of documents that employs fast enumeration techniques. |
|
A window of Cardhop.app. |
- class PyXA.apps.Cardhop.XACardhopAppplication(properties)[source]
Bases:
XASBApplication
,XACanOpenPath
,XACanPrintPath
A class for interacting with Cardhop.app.
New in version 0.1.0.
Classes:
ZoomType
(value)Options for zoom type to use when opening a new document.
Methods:
documents
([filter])Returns a list of documents, as PyXA objects, matching the filter.
parse_sentence
(sentence[, add_immediately])Parses the given sentence and carries out the corresponding actions.
Attributes:
Whether Cardhop is the active application.
The name of the application.
The version of Cardhop.app.
- class ZoomType(value)[source]
Bases:
Enum
Options for zoom type to use when opening a new document.
Attributes:
- FIT_HEIGHT = 3
- FIT_PAGE = 1
- FIT_VISIBLE_WIDTH = 4
- FIT_WIDTH = 2
- NO_VARY = 0
- documents(filter: dict | None = None) XACardhopDocumentList [source]
Returns a list of documents, as PyXA objects, matching the filter.
- Parameters:
filter (dict) – A dictionary specifying property-value pairs that all returned documents will have
- Returns:
The list of documents
- Return type:
New in version 0.1.0.
- property frontmost: bool
Whether Cardhop is the active application.
- property name: str
The name of the application.
- parse_sentence(sentence: str, add_immediately: bool = True)[source]
Parses the given sentence and carries out the corresponding actions.
- Parameters:
sentence (str) – The sentence to parse
add_immediately (bool, optional) – Whether to immediately parse the sentence and save resulting changes, instead of having the user confirm changes via the GUI, defaults to True
- property version: str
The version of Cardhop.app.
- class PyXA.apps.Cardhop.XACardhopDocument(properties)[source]
Bases:
XAObject
A document of Cardhop.app.
New in version 0.1.0.
Attributes:
The location of the document on disk, if it has one.
Whether the document has been modified since its last save.
The title of the document.
- property modified: bool
Whether the document has been modified since its last save.
- property name: str
The title of the document.
- class PyXA.apps.Cardhop.XACardhopDocumentList(properties: dict, filter: dict | None = None)[source]
Bases:
XAList
,XAPrintable
,XAClipboardCodable
A wrapper around lists of documents that employs fast enumeration techniques.
All properties of documents can be called as methods on the wrapped list, returning a list containing each document’s value for the property.
New in version 0.1.0.
Methods:
by_file
(file)by_modified
(modified)by_name
(name)file
()Gets a clipboard-codable representation of each document in the list.
modified
()name
()- by_file(file: XAPath | str) XACardhopDocument | None [source]
- by_modified(modified: bool) XACardhopDocument | None [source]
- by_name(name: str) XACardhopDocument | None [source]
- get_clipboard_representation() list[str | NSURL] [source]
Gets a clipboard-codable representation of each document in the list.
When the clipboard content is set to a list of documents, each documents’s file URL and name are added to the clipboard.
- Returns:
A list of each document’s file URL and name
- Return type:
list[Union[str, AppKit.NSURL]]
New in version 0.0.8.
- class PyXA.apps.Cardhop.XACardhopWindow(properties)[source]
Bases:
XASBWindow
,XAPrintable
A window of Cardhop.app.
New in version 0.1.0.
Attributes:
The document whose contents are displayed in the window.
- property document: XACardhopDocument
The document whose contents are displayed in the window.