comet.host¶
The comet.host module provides access to the host environment which is running the priint:comet Python API.
The host environment is either InDesign®, Illustrator® or comet_pdf. Several functions are only available for certain host environments since they set or query host preferences.
Methods¶
- comet.host.getType()¶
Returns the host application the script environment is running in
- Returns
The host environment.
One of Host environments
- Return type
- Available
- CScript
- comet.host.getVersion()¶
Returns the major version for the active host software.
The following values can be returned:
15 : InDesign® 2020
16 : InDesign® 2021
17 : InDesign® 2022
24 : Illustrator® 2020
25 : Illustrator® 2021
26 : Illustrator® 2022
- Returns
The host version
- Return type
- Available
- CScript
- comet.host.getIsServer()¶
Returns whether the active host is a server (Only true for InDesign® Server)
- Returns
Whether the host is a server
- Return type
- Available
- CScript
- comet.host.getLanguage()¶
Get the active language the host software is running in.
The following keys can be returned:
0 : English (US)
1 : English (UK)
2 : German
3 : French
4 : Japanese
5 : Spanish
6 : Portgese
7 : Swedish
8 . Danish
9 : Dutch
10 : Italian
11 : Norwegian
12 : Finnish
13 : Greek
14 : Czeck
15 : Polish
16 : Croatian
17 : Hungarian
18 : Russian
19 : Slowakian
20 : Turkish
21 : Romanian
22 : Bulgarian
23 : Belorussia
24 : Estonian
25 : Latvian
25 : Lithuanian
27 : Slovenian
28 : Ukrainian
29 : Hebrew
30 : Arabic
31 : Korean
32 : Chinese
33 : Chinese (Taiwan)
34 : Tamil
35 : Thai
36 : Vietnamese
37 : Albanian
- Returns
The language key
- Return type
- Available
- CScript
- comet.host.getApplicationPath()¶
Determine the path to the host application.
This is the folder to where the host executable is in, e.g. C:/Program Files/Adobe/Adobe InDesign 2021
- Returns
The folder of the host application
- Return type
- Available
- CScript
- comet.host.getPluginPath()¶
Determine the path to the Plugin subfolder of the host application.
This is the folder where the comet plugin subfolder is in, e.g. C:/Program Files/Adobe/Adobe InDesign 2021/Plug-Ins
- Returns
The folder to the plugins
- Type
- Available
- CScript
- comet.host.getPDFProfileNames(source='')¶
Get a list of all available PDF profiles.
- Parameters
source (str) –
Empty str: Get the profiles from the host preferences
Else: Path to an XML file containing exported PDF profiles
- Returns
The PDF profile names
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter source points to invalid file
CometError – On internal error
- Available
- CScript
- comet.host.exportPDFProfiles(destination, filter=[])¶
Export available PDF profiles to an XML file.
- Parameters
- Return type
- Raises
TypeError – When parameter types are invalid
CometError – On internal error
- Available
- CScript
- comet.host.importPDFProfiles(source, mode=0, filter=[])¶
Import PDF profiles from an XML file.
- Parameters
source (str) – Full path to an input file written by
exportPDFProfiles()
mode (int) –
Behavior when an imported profile already exists
0: Overwrite
1: Skip
2: Abort
List of profiles to include during import.
Empty list: Import all profiles
- Return type
- Raises
TypeError – When parameter types are invalid
When parameter str is empty
When parameter mode has invalid value
CometError – On internal error
- Available
- CScript
- comet.host.getPrintProfileNames(source='')¶
Get a list of all available print profiles.
- Parameters
source (str) –
Empty str: Get the profiles from the host preferences
Else: Path to an XML file containing exported print profiles
- Returns
The print profile names
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter source points to invalid file
CometError – On internal error
- Available
- CScript
- comet.host.exportPrintProfiles(destination, filter=[])¶
Export available print profiles to an XML file.
- Parameters
- Return type
- Raises
TypeError – When parameter types are invalid
CometError – On internal error
- Available
- CScript
- comet.host.importPrintProfiles(source, mode=0, filter=[])¶
Import print profiles from an XML file.
- Parameters
source (str) – Full path to an input file written by
exportPrintProfiles()
mode (int) –
Behavior when an imported profile already exists
0: Overwrite
1: Skip
2: Abort
List of profiles to include during import.
Empty list: Import all profiles
- Return type
- Raises
TypeError – When parameter types are invalid
When parameter str is empty
When parameter mode has invalid value
CometError – On internal error
- Available
- CScript
- comet.host.getFlattenerProfileNames(source='')¶
Get a list of all available transparency flattener profiles.
- Parameters
source (str) –
Empty str: Get the profiles from the host preferences
Else: Path to an XML file containing exported flattener profiles
- Returns
The flattener profile names
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter source points to invalid file
CometError – On internal error
- Available
- CScript
- comet.host.exportFlattenerProfiles(destination, filter=[])¶
Export available transparency flattener profiles to an XML file.
- Parameters
- Return type
- Raises
TypeError – When parameter types are invalid
CometError – On internal error
- Available
- CScript
- comet.host.importFlattenerProfiles(source, mode=0, filter=[])¶
Import flattener profiles from an XML file.
- Parameters
source (str) – Full path to an input file written by
exportFlattenerProfiles()
mode (int) –
Behavior when an imported profile already exists
0: Overwrite
1: Skip
2: Abort
List of profiles to include during import.
Empty list: Import all profiles
- Return type
- Raises
TypeError – When parameter types are invalid
When parameter str is empty
When parameter mode has invalid value
CometError – On internal error
- Available
- CScript