comet.panel¶
The comet.panel module provides functions for enabling/disabling and showing/hiding comet panels.
Also, it is possible to query list entries from certain panels and query or modify the selection of said lists.
Methods¶
- comet.panel.isEnabled(panelID)¶
Get whether a comet panel is locked for user interaction.
- Parameters:
panelID (int) –
The panel to query.
One of Panel IDs except for
constants.kPanelUndef
.- Returns:
Whether the panel in question is locked.
- Return type:
- Raises:
TypeError – When parameter types are invalid.
ValueError – When parameter panelID has invalid value.
- Available:
InDesign® Illustrator®
- See also:
- CScript:
- comet.panel.setEnabled(panelID, enabled, message='')¶
Enable or disable panel interaction.
Calls to the function should preferably be made in the after-login script (panelstatement 92).
After disconnecting the current data connection, all active locks are released.
Disabling a panel serves only to protect against unintentional changes of configuration data.
- Parameters:
panelID (int) – The panel to lock. One of Panel IDs except for
constants.kPanelUndef
.enabled (bool) –
Enable or disable the panel?
message (str) –
When enabled is
False
, this message is displayed on the panel.The text is shown behind ‘Panel blocked by’ and must not be empty and not longer than 255 characters.
Unicode letters are encoded like e.g. ‘<0x00FC>’.
If this value starts with the ‘@’ character, the prefix ‘Panel blocked by’ is omitted.
- Returns:
None
- Raises:
TypeError – When parameter types are invalid.
When parameter panelID has invalid value.
When parameter enabled is False and message is empty or too long.
CometError – On internal error.
- Available:
InDesign® Illustrator®
- See also:
- CScript:
- Examples:
Disable all panels.
#!py #pragma plain import comet def main(): #Iterate through all panel IDs for key, value in comet.constants.kPanelIDs.items(): #Skip undefined panel ID if key == comet.constants.kPanelUndef: continue #We need to try/catch since not all panels are available for all hosts. #In this case the function throws. try: #Disable the panel and set a lock message comet.prefs.setPanelEnabled(key, False, 'I am locked!') except: pass return 0
- comet.panel.isVisible(panelID)¶
Get whether a comet panel is currently visible.
- Parameters:
panelID (int) –
The panel to query.
One of Panel IDs except for
constants.kPanelUndef
.- Returns:
Whether the panel in question is visible.
- Return type:
- Raises:
TypeError – When parameter types are invalid.
ValueError – When parameter panelID has invalid value.
- Available:
InDesign® Illustrator®
- See also:
- CScript:
- comet.panel.setVisible(panelID, visible)¶
Show or hide a comet panel.
- Parameters:
panelID (int) –
The panel to show or hide.
One of Panel IDs except for
constants.kPanelUndef
.- Return type:
None
- Raises:
TypeError – When parameter types are invalid.
ValueError – When parameter panelID has invalid value.
- Available:
InDesign® Illustrator®
- See also:
- CScript:
- Examples:
Show the placeholder options panel.
comet.panel.setVisible(comet.constants.kPanelPlaceholderValues, True)
- comet.panel.reloadList(panelID, reloadAll=True)¶
For panels that have a list (e.g. product pool, templates, etc…), this function can be used to reload the entries of that list.
- Parameters:
- Returns:
None
- Raises:
TypeError – When parameter types are invalid.
ValueError – When parameter panelID has invalid value.
CometError – On internal error.
- Available:
InDesign® Illustrator®
- CScript:
- Examples:
Reload the product pool.
comet.panel.reloadList(comet.constants.kPanelProducts)