diff --git a/examples/index.html b/examples/index.html index 2ee7a30b..a93fbc73 100644 --- a/examples/index.html +++ b/examples/index.html @@ -1327,4 +1327,4 @@ with Session() as api: api.app.doAction(action="Frame Channel - 50 pixel") -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/SUMMARY/index.html b/reference/SUMMARY/index.html index 3d7ee6a8..137c7131 100644 --- a/reference/SUMMARY/index.html +++ b/reference/SUMMARY/index.html @@ -1 +1 @@ - SUMMARY - Photoshop Python API
\ No newline at end of file + SUMMARY - Photoshop Python API
\ No newline at end of file diff --git a/reference/photoshop/api/_active_layer/index.html b/reference/photoshop/api/_active_layer/index.html index bf7b0173..527c3da8 100644 --- a/reference/photoshop/api/_active_layer/index.html +++ b/reference/photoshop/api/_active_layer/index.html @@ -30,4 +30,4 @@ 18
def add(self):
     """Adds an element."""
     self.app.ActiveDocument.ArtLayers.Add()
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_artlayer/index.html b/reference/photoshop/api/_artlayer/index.html index 1fddc919..a454f4a0 100644 --- a/reference/photoshop/api/_artlayer/index.html +++ b/reference/photoshop/api/_artlayer/index.html @@ -1374,4 +1374,4 @@ 528
def unlink(self):
     """Unlink this layer from any linked layers."""
     self.app.unlink()
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_artlayers/index.html b/reference/photoshop/api/_artlayers/index.html index 1fa8cda6..afe00486 100644 --- a/reference/photoshop/api/_artlayers/index.html +++ b/reference/photoshop/api/_artlayers/index.html @@ -168,4 +168,4 @@ """Deletes all elements.""" for layer in self.app: ArtLayer(layer).remove() -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_channel/index.html b/reference/photoshop/api/_channel/index.html index 92f33ba6..0d9288db 100644 --- a/reference/photoshop/api/_channel/index.html +++ b/reference/photoshop/api/_channel/index.html @@ -1 +1 @@ - channel - Photoshop Python API
Skip to content
\ No newline at end of file + channel - Photoshop Python API
Skip to content
\ No newline at end of file diff --git a/reference/photoshop/api/_channels/index.html b/reference/photoshop/api/_channels/index.html index e151dadd..097b55a4 100644 --- a/reference/photoshop/api/_channels/index.html +++ b/reference/photoshop/api/_channels/index.html @@ -1 +1 @@ - channels - Photoshop Python API
Skip to content
\ No newline at end of file + channels - Photoshop Python API
Skip to content
\ No newline at end of file diff --git a/reference/photoshop/api/_core/index.html b/reference/photoshop/api/_core/index.html index 39294a24..3ba55f76 100644 --- a/reference/photoshop/api/_core/index.html +++ b/reference/photoshop/api/_core/index.html @@ -545,4 +545,4 @@ 213
def get_script_path(self) -> str:
     """str: The absolute scripts path of Photoshop."""
     return os.path.join(self.presets_path, "Scripts")
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_document/index.html b/reference/photoshop/api/_document/index.html index 582d98a4..c05ae8ee 100644 --- a/reference/photoshop/api/_document/index.html +++ b/reference/photoshop/api/_document/index.html @@ -1094,4 +1094,4 @@ """ return self.app.trim(trim_type, top, left, bottom, right) -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_documentinfo/index.html b/reference/photoshop/api/_documentinfo/index.html index 809b2492..1da04709 100644 --- a/reference/photoshop/api/_documentinfo/index.html +++ b/reference/photoshop/api/_documentinfo/index.html @@ -453,4 +453,4 @@ @urgency.setter def urgency(self, status): self.app.urgency = status -

author property writable

authorPosition property writable

category property writable

copyrightNotice property writable

copyrighted property writable

credit property writable

provinceState property writable

supplementalCategories property writable

transmissionReference property writable

urgency property writable

The document urgency.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

author property writable

authorPosition property writable

category property writable

copyrightNotice property writable

copyrighted property writable

credit property writable

provinceState property writable

supplementalCategories property writable

transmissionReference property writable

urgency property writable

The document urgency.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_documents/index.html b/reference/photoshop/api/_documents/index.html index bd99dd5a..f42e8ddb 100644 --- a/reference/photoshop/api/_documents/index.html +++ b/reference/photoshop/api/_documents/index.html @@ -243,4 +243,4 @@ if doc.name == document_name: return Document(doc) raise PhotoshopPythonAPIError(f'Could not find a document named "{document_name}"') -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_layerComp/index.html b/reference/photoshop/api/_layerComp/index.html index 6a545094..a351602d 100644 --- a/reference/photoshop/api/_layerComp/index.html +++ b/reference/photoshop/api/_layerComp/index.html @@ -209,4 +209,4 @@ 100
def resetfromComp(self):
     """Resets the layer comp state to thedocument state."""
     self.app.resetfromComp()
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_layerComps/index.html b/reference/photoshop/api/_layerComps/index.html index a60d2520..d6e89f11 100644 --- a/reference/photoshop/api/_layerComps/index.html +++ b/reference/photoshop/api/_layerComps/index.html @@ -101,4 +101,4 @@ def __iter__(self): for layer in self._layers: yield LayerComp(layer) -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_layerSet/index.html b/reference/photoshop/api/_layerSet/index.html index 64af56b9..8fedae2d 100644 --- a/reference/photoshop/api/_layerSet/index.html +++ b/reference/photoshop/api/_layerSet/index.html @@ -292,4 +292,4 @@ 140
def unlink(self):
     """Unlinks the layer set."""
     self.app.unlink()
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_layerSets/index.html b/reference/photoshop/api/_layerSets/index.html index 0b99dac9..012606b7 100644 --- a/reference/photoshop/api/_layerSets/index.html +++ b/reference/photoshop/api/_layerSets/index.html @@ -130,4 +130,4 @@ if name == layer.name: return LayerSet(layer) raise PhotoshopPythonAPIError(f'Could not find a LayerSet named "{name}"') -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_layers/index.html b/reference/photoshop/api/_layers/index.html index 438e53c2..d99cd5d9 100644 --- a/reference/photoshop/api/_layers/index.html +++ b/reference/photoshop/api/_layers/index.html @@ -101,4 +101,4 @@ """Deletes all elements.""" for layer in self.app: ArtLayer(layer).remove() -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_measurement_log/index.html b/reference/photoshop/api/_measurement_log/index.html index ee7416e1..03e70ff8 100644 --- a/reference/photoshop/api/_measurement_log/index.html +++ b/reference/photoshop/api/_measurement_log/index.html @@ -31,4 +31,4 @@ def deleteMeasurements(self, range_: int): self.app.deleteMeasurements(range_) -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_notifier/index.html b/reference/photoshop/api/_notifier/index.html index 9d23f3cf..95fad173 100644 --- a/reference/photoshop/api/_notifier/index.html +++ b/reference/photoshop/api/_notifier/index.html @@ -104,4 +104,4 @@ """ return self.app.remove() -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_notifiers/index.html b/reference/photoshop/api/_notifiers/index.html index e793a95a..7cb76bba 100644 --- a/reference/photoshop/api/_notifiers/index.html +++ b/reference/photoshop/api/_notifiers/index.html @@ -68,4 +68,4 @@ def removeAll(self): self.app.removeAll() self.parent.notifiersEnabled = False -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_preferences/index.html b/reference/photoshop/api/_preferences/index.html index 7f6a3471..2cb97774 100644 --- a/reference/photoshop/api/_preferences/index.html +++ b/reference/photoshop/api/_preferences/index.html @@ -279,4 +279,4 @@ @rulerUnits.setter def rulerUnits(self, value): self.app.rulerUnits = value -

additionalPluginFolder property

The path to an additional plug-in folder.

autoUpdateOpenDocuments: bool property writable

True to automatically update open documents.

beepWhenDone: bool property writable

True to beep when a process.

colorChannelsInColor property writable

True to display component channels in the Channels palette in color.

colorPicker property writable

The preferred color selection tool.

createFirstSnapshot property writable

Automatically make the first snapshot when a new document is created.

editLogItems: bool property writable

The preferred level of detail in the history log.

exportClipboard property writable

Retain Photoshop contents on the clipboard after exit the app.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

additionalPluginFolder property

The path to an additional plug-in folder.

autoUpdateOpenDocuments: bool property writable

True to automatically update open documents.

beepWhenDone: bool property writable

True to beep when a process.

colorChannelsInColor property writable

True to display component channels in the Channels palette in color.

colorPicker property writable

The preferred color selection tool.

createFirstSnapshot property writable

Automatically make the first snapshot when a new document is created.

editLogItems: bool property writable

The preferred level of detail in the history log.

exportClipboard property writable

Retain Photoshop contents on the clipboard after exit the app.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_selection/index.html b/reference/photoshop/api/_selection/index.html index a1bf1086..78254bd0 100644 --- a/reference/photoshop/api/_selection/index.html +++ b/reference/photoshop/api/_selection/index.html @@ -563,4 +563,4 @@ 194
def translateBoundary(self, deltaX, deltaY):
     """Moves the boundary of selection relative to its current position."""
     return self.app.translateBoundary(deltaX, deltaY)
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/_text_fonts/index.html b/reference/photoshop/api/_text_fonts/index.html index 3bb6ebc5..288d7315 100644 --- a/reference/photoshop/api/_text_fonts/index.html +++ b/reference/photoshop/api/_text_fonts/index.html @@ -327,4 +327,4 @@ if font.name == name: return TextFont(font) raise PhotoshopPythonAPIError('Could not find a TextFont named "{name}"') -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/action_descriptor/index.html b/reference/photoshop/api/action_descriptor/index.html index 969081ad..36c70ee0 100644 --- a/reference/photoshop/api/action_descriptor/index.html +++ b/reference/photoshop/api/action_descriptor/index.html @@ -698,4 +698,4 @@ """Gets the entire descriptor as as stream of bytes, for writing to disk.""" return self.app.toSteadm() -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/action_list/index.html b/reference/photoshop/api/action_list/index.html index 04ca7f2c..64f489e0 100644 --- a/reference/photoshop/api/action_list/index.html +++ b/reference/photoshop/api/action_list/index.html @@ -115,4 +115,4 @@ def getObjectType(self, index): return self.app.getObjectType(index) -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/action_reference/index.html b/reference/photoshop/api/action_reference/index.html index 8bbdbeb1..19d7d67d 100644 --- a/reference/photoshop/api/action_reference/index.html +++ b/reference/photoshop/api/action_reference/index.html @@ -173,4 +173,4 @@ """Puts an enumeration type and ID into a reference along with the desired class for the reference.""" return self.app.putEnumerated(desired_class, enum_type, value) -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/application/index.html b/reference/photoshop/api/application/index.html index bab3d573..15fccdcb 100644 --- a/reference/photoshop/api/application/index.html +++ b/reference/photoshop/api/application/index.html @@ -1105,4 +1105,4 @@ 480
def togglePalettes(self):
     """Toggle palette visibility."""
     return self.doJavaScript("app.togglePalettes()")
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/batch_options/index.html b/reference/photoshop/api/batch_options/index.html index efaded8b..f0e355a5 100644 --- a/reference/photoshop/api/batch_options/index.html +++ b/reference/photoshop/api/batch_options/index.html @@ -225,4 +225,4 @@ @windowsCompatible.setter def windowsCompatible(self, value: bool): self.app.windowsCompatible = value -

destination property writable

The type of destination for the processed files.

destinationFolder property writable

The folder location for the processed files. Valid only when ‘destination’ = folder.

errorFile property writable

The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank.

fileNaming: list property writable

A list of file naming options. Maximum: 6.

macintoshCompatible: bool property writable

If true, the final file names are Macintosh compatible.

overrideOpen: bool property writable

If true, overrides action open commands.

overrideSave: bool property writable

If true, overrides save as action steps with the specified destination.

startingSerial: int property writable

The starting serial number to use in naming files.

suppressOpen: bool property writable

If true, suppresses file open options dialogs.

suppressProfile: bool property writable

If true, suppresses color profile warnings.

unixCompatible: bool property writable

If true, the final file names are Unix compatible.

windowsCompatible: bool property writable

If true, the final file names are Windows compatible.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

destination property writable

The type of destination for the processed files.

destinationFolder property writable

The folder location for the processed files. Valid only when ‘destination’ = folder.

errorFile property writable

The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank.

fileNaming: list property writable

A list of file naming options. Maximum: 6.

macintoshCompatible: bool property writable

If true, the final file names are Macintosh compatible.

overrideOpen: bool property writable

If true, overrides action open commands.

overrideSave: bool property writable

If true, overrides save as action steps with the specified destination.

startingSerial: int property writable

The starting serial number to use in naming files.

suppressOpen: bool property writable

If true, suppresses file open options dialogs.

suppressProfile: bool property writable

If true, suppresses color profile warnings.

unixCompatible: bool property writable

If true, the final file names are Unix compatible.

windowsCompatible: bool property writable

If true, the final file names are Windows compatible.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/colors/cmyk/index.html b/reference/photoshop/api/colors/cmyk/index.html index 9063a15f..a7574d2a 100644 --- a/reference/photoshop/api/colors/cmyk/index.html +++ b/reference/photoshop/api/colors/cmyk/index.html @@ -83,4 +83,4 @@ @yellow.setter def yellow(self, value: int): self.app.yellow = value -

black: int property writable

The black color value. Range: 0.0 to 100.0.

cyan: int property writable

The cyan color value. Range: 0.0 to 100.0.

magenta: int property writable

The magenta color value. Range: 0.0 to 100.0.

yellow: int property writable

The yellow color value. Range: 0.0 to 100.0.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

black: int property writable

The black color value. Range: 0.0 to 100.0.

cyan: int property writable

The cyan color value. Range: 0.0 to 100.0.

magenta: int property writable

The magenta color value. Range: 0.0 to 100.0.

yellow: int property writable

The yellow color value. Range: 0.0 to 100.0.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/colors/gray/index.html b/reference/photoshop/api/colors/gray/index.html index 68d11d31..2c0fd0e6 100644 --- a/reference/photoshop/api/colors/gray/index.html +++ b/reference/photoshop/api/colors/gray/index.html @@ -31,4 +31,4 @@ def gray(self, value: float): """The gray value.""" self.app.gray = value -

gray: float property writable

The gray value.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

gray: float property writable

The gray value.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/colors/hsb/index.html b/reference/photoshop/api/colors/hsb/index.html index 79a03bea..6815a623 100644 --- a/reference/photoshop/api/colors/hsb/index.html +++ b/reference/photoshop/api/colors/hsb/index.html @@ -61,4 +61,4 @@ @hue.setter def hue(self, value): self.app.hue = value -

hue property writable

The hue value. Range: 0.0 to 360.0.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

hue property writable

The hue value. Range: 0.0 to 360.0.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/colors/lab/index.html b/reference/photoshop/api/colors/lab/index.html index 4b24ccb6..7d455723 100644 --- a/reference/photoshop/api/colors/lab/index.html +++ b/reference/photoshop/api/colors/lab/index.html @@ -59,4 +59,4 @@ @L.setter def L(self, value): self.app.L = value -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/colors/rgb/index.html b/reference/photoshop/api/colors/rgb/index.html index 48bd5787..d4f04258 100644 --- a/reference/photoshop/api/colors/rgb/index.html +++ b/reference/photoshop/api/colors/rgb/index.html @@ -87,4 +87,4 @@ def __str__(self): return f"[red: {self.red}, green:{self.green}, blue:{self.blue})]" -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/constants/index.html b/reference/photoshop/api/constants/index.html index f8f4a834..38160760 100644 --- a/reference/photoshop/api/constants/index.html +++ b/reference/photoshop/api/constants/index.html @@ -1 +1 @@ - constants - Photoshop Python API
Skip to content
\ No newline at end of file + constants - Photoshop Python API
Skip to content
\ No newline at end of file diff --git a/reference/photoshop/api/enumerations/index.html b/reference/photoshop/api/enumerations/index.html index 0733836a..3d46c9c6 100644 --- a/reference/photoshop/api/enumerations/index.html +++ b/reference/photoshop/api/enumerations/index.html @@ -1 +1 @@ - enumerations - Photoshop Python API
Skip to content
\ No newline at end of file + enumerations - Photoshop Python API
Skip to content
\ No newline at end of file diff --git a/reference/photoshop/api/errors/index.html b/reference/photoshop/api/errors/index.html index 01ea4e18..29ba674d 100644 --- a/reference/photoshop/api/errors/index.html +++ b/reference/photoshop/api/errors/index.html @@ -1 +1 @@ - errors - Photoshop Python API
Skip to content
\ No newline at end of file + errors - Photoshop Python API
Skip to content
\ No newline at end of file diff --git a/reference/photoshop/api/event_id/index.html b/reference/photoshop/api/event_id/index.html index 546e8ad4..ff199002 100644 --- a/reference/photoshop/api/event_id/index.html +++ b/reference/photoshop/api/event_id/index.html @@ -491,4 +491,4 @@ RasterizeLayer = "rasterizeLayer" ForceNotify = "forceNotify" PlacedLayerEditContents = "placedLayerEditContents" -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/open_options/eps/index.html b/reference/photoshop/api/open_options/eps/index.html index d96b7c4a..9abf4fd3 100644 --- a/reference/photoshop/api/open_options/eps/index.html +++ b/reference/photoshop/api/open_options/eps/index.html @@ -83,4 +83,4 @@ @embedColorProfile.setter def embedColorProfile(self, boolean): self.app.embedColorProfile = boolean -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/bmp/index.html b/reference/photoshop/api/save_options/bmp/index.html index 9eed579b..f2facc91 100644 --- a/reference/photoshop/api/save_options/bmp/index.html +++ b/reference/photoshop/api/save_options/bmp/index.html @@ -39,4 +39,4 @@ """ self.app.alphaChannels = value -

alphaChannels property writable

State to save the alpha channels.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

alphaChannels property writable

State to save the alpha channels.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/eps/index.html b/reference/photoshop/api/save_options/eps/index.html index a616a976..38d59224 100644 --- a/reference/photoshop/api/save_options/eps/index.html +++ b/reference/photoshop/api/save_options/eps/index.html @@ -183,4 +183,4 @@ """ self.app.vectorData = value -

embedColorProfile: bool property writable

True to embed the color profile in this document.

transparentWhites: bool property writable

True to display white areas as transparent

vectorData property writable

True to include vector data.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

embedColorProfile: bool property writable

True to embed the color profile in this document.

transparentWhites: bool property writable

True to display white areas as transparent

vectorData property writable

True to include vector data.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/gif/index.html b/reference/photoshop/api/save_options/gif/index.html index d4b018bc..252bd300 100644 --- a/reference/photoshop/api/save_options/gif/index.html +++ b/reference/photoshop/api/save_options/gif/index.html @@ -155,4 +155,4 @@ @transparency.setter def transparency(self, value): self.app.transparency = value -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/jpg/index.html b/reference/photoshop/api/save_options/jpg/index.html index 1ac8b417..3659eade 100644 --- a/reference/photoshop/api/save_options/jpg/index.html +++ b/reference/photoshop/api/save_options/jpg/index.html @@ -103,4 +103,4 @@ @scans.setter def scans(self, value): self.app.scans = value -

formatOptions property writable

The download format to use.

matte property writable

The color to use to fill anti-aliased edges adjacent to transparent


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

formatOptions property writable

The download format to use.

matte property writable

The color to use to fill anti-aliased edges adjacent to transparent


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/pdf/index.html b/reference/photoshop/api/save_options/pdf/index.html index 3cb4469a..40a69c88 100644 --- a/reference/photoshop/api/save_options/pdf/index.html +++ b/reference/photoshop/api/save_options/pdf/index.html @@ -681,4 +681,4 @@ def view(self, value): """If true, opens the saved PDF in Acrobat.""" self.app.view = value -

alphaChannels property writable

True to save the alpha channels with the file.

annotations property writable

If true, the annotations are saved.

colorConversion property writable

If true, converts the color profile to the destination profile.

convertToEightBit property writable

If true, converts a 16-bit image to 8-bit for better compatibility with other applications.

description property writable

Description of the save options in use.

destinationProfile property writable

Describes the final RGB or CMYK output device, such as a monitor or press standard.

downSample property writable

The downsample method to use.

downSampleSize property writable

The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit.

downSampleSizeLimit property writable

Limits downsampling or subsampling to images that exceed this value (in pixels per inch).

embedColorProfile property writable

If true, the color profile is embedded in the document.

embedThumbnail property writable

If true, includes a small preview image in Acrobat.

encoding property writable

The encoding method to use.

jpegQuality property writable

Get the quality of the produced image.

layers property writable

If true, the layers are saved.

optimizeForWeb property writable

If true, improves performance of PDFs on Web servers.

outputCondition property writable

An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.

outputConditionID property writable

The identifier for the output condition.

preserveEditing property writable

If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.

presetFile property writable

The preset file to use for settings; overrides other settings.

profileInclusionPolicy property writable

If true, shows which profiles to include.

registryName property writable

The URL where the output condition is registered.

spotColors property writable

If true, the spot colors are saved.

tileSize property writable

The compression option. Valid only when encoding is JPEG2000.

view property writable

If true, opens the saved PDF in Acrobat.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

alphaChannels property writable

True to save the alpha channels with the file.

annotations property writable

If true, the annotations are saved.

colorConversion property writable

If true, converts the color profile to the destination profile.

convertToEightBit property writable

If true, converts a 16-bit image to 8-bit for better compatibility with other applications.

description property writable

Description of the save options in use.

destinationProfile property writable

Describes the final RGB or CMYK output device, such as a monitor or press standard.

downSample property writable

The downsample method to use.

downSampleSize property writable

The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit.

downSampleSizeLimit property writable

Limits downsampling or subsampling to images that exceed this value (in pixels per inch).

embedColorProfile property writable

If true, the color profile is embedded in the document.

embedThumbnail property writable

If true, includes a small preview image in Acrobat.

encoding property writable

The encoding method to use.

jpegQuality property writable

Get the quality of the produced image.

layers property writable

If true, the layers are saved.

optimizeForWeb property writable

If true, improves performance of PDFs on Web servers.

outputCondition property writable

An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.

outputConditionID property writable

The identifier for the output condition.

preserveEditing property writable

If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.

presetFile property writable

The preset file to use for settings; overrides other settings.

profileInclusionPolicy property writable

If true, shows which profiles to include.

registryName property writable

The URL where the output condition is registered.

spotColors property writable

If true, the spot colors are saved.

tileSize property writable

The compression option. Valid only when encoding is JPEG2000.

view property writable

If true, opens the saved PDF in Acrobat.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/png/index.html b/reference/photoshop/api/save_options/png/index.html index d3d43839..2180963f 100644 --- a/reference/photoshop/api/save_options/png/index.html +++ b/reference/photoshop/api/save_options/png/index.html @@ -172,4 +172,4 @@ @compression.setter def compression(self, value: int): self.app.compression = value -

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/psd/index.html b/reference/photoshop/api/save_options/psd/index.html index 0753b186..2ea1db08 100644 --- a/reference/photoshop/api/save_options/psd/index.html +++ b/reference/photoshop/api/save_options/psd/index.html @@ -101,4 +101,4 @@ @spotColors.setter def spotColors(self, value): self.app.spotColors = value -

alphaChannels property writable

If true, the alpha channels are saved.

annotations property writable

If true, the annotations are saved.

embedColorProfile property writable

If true, the color profile is embedded in the document.

layers property writable

If true, the layers are saved.

spotColors property writable

If true, spot colors are saved.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

alphaChannels property writable

If true, the alpha channels are saved.

annotations property writable

If true, the annotations are saved.

embedColorProfile property writable

If true, the color profile is embedded in the document.

layers property writable

If true, the layers are saved.

spotColors property writable

If true, spot colors are saved.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/tag/index.html b/reference/photoshop/api/save_options/tag/index.html index d73d44b4..26eb3746 100644 --- a/reference/photoshop/api/save_options/tag/index.html +++ b/reference/photoshop/api/save_options/tag/index.html @@ -61,4 +61,4 @@ @rleCompression.setter def rleCompression(self, value): self.app.rleCompression = value -

alphaChannels property writable

If true, the alpha channels are saved.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

alphaChannels property writable

If true, the alpha channels are saved.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/save_options/tif/index.html b/reference/photoshop/api/save_options/tif/index.html index 4f92dc37..a27c59c5 100644 --- a/reference/photoshop/api/save_options/tif/index.html +++ b/reference/photoshop/api/save_options/tif/index.html @@ -247,4 +247,4 @@ """If true, saves the transparency as an additional alpha channel when the file is opened in another application.""" self.app.transparency = value -

alphaChannels property writable

If true, the alpha channels are saved.

annotations property writable

If true, the annotations are saved.

byteOrder property writable

The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows.

embedColorProfile property writable

If true, the color profile is embedded in the document.

imageCompression property writable

The compression type.

interleaveChannels property writable

If true, the channels in the image are interleaved.

jpegQuality property writable

The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12.

layers property writable

If true, the layers are saved.

saveImagePyramid property writable

If true, preserves multi-resolution information.

spotColors property writable

If true, spot colors are saved.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

alphaChannels property writable

If true, the alpha channels are saved.

annotations property writable

If true, the annotations are saved.

byteOrder property writable

The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows.

embedColorProfile property writable

If true, the color profile is embedded in the document.

imageCompression property writable

The compression type.

interleaveChannels property writable

If true, the channels in the image are interleaved.

jpegQuality property writable

The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12.

layers property writable

If true, the layers are saved.

saveImagePyramid property writable

If true, preserves multi-resolution information.

spotColors property writable

If true, spot colors are saved.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/solid_color/index.html b/reference/photoshop/api/solid_color/index.html index 2148070a..9f5d88cc 100644 --- a/reference/photoshop/api/solid_color/index.html +++ b/reference/photoshop/api/solid_color/index.html @@ -146,4 +146,4 @@ 92
def isEqual(self, color: RGBColor):
     """`SolidColor` object is visually equal to the specified color."""
     return self.app.isEqual(color)
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/text_font/index.html b/reference/photoshop/api/text_font/index.html index 2999b349..77f9be5e 100644 --- a/reference/photoshop/api/text_font/index.html +++ b/reference/photoshop/api/text_font/index.html @@ -47,4 +47,4 @@ def style(self): """The font style.""" return self.app.style -

family: str property

The font family

name property

The name of the font.

postScriptName property

The PostScript name of the font.

style property

The font style.


Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

family: str property

The font family

name property

The name of the font.

postScriptName property

The PostScript name of the font.

style property

The font style.


Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/api/text_item/index.html b/reference/photoshop/api/text_item/index.html index 4478aae0..f3640caa 100644 --- a/reference/photoshop/api/text_item/index.html +++ b/reference/photoshop/api/text_item/index.html @@ -1,4 +1,5 @@ - text_item - Photoshop Python API
Skip to content

text_item

TextItem

Bases: Photoshop

The text that is associated with the layer. Valid only when ‘kind’ is text layer.

Source code in photoshop/api/text_item.py
 15
+ text_item - Photoshop Python API      

text_item

TextItem

Bases: Photoshop

The text that is associated with the layer. Valid only when ‘kind’ is text layer.

Source code in photoshop/api/text_item.py
 14
+ 15
  16
  17
  18
@@ -671,7 +672,12 @@
 685
 686
 687
-688
class TextItem(Photoshop):
+688
+689
+690
+691
+692
+693
class TextItem(Photoshop):
     """The text that is associated with the layer. Valid only when ‘kind’ is text layer."""
 
     object_name = "Application"
@@ -868,26 +874,31 @@
         self.app.firstLineIndent = value
 
     @property
-    def font(self):
-        """.text_font.TextFont: Current font."""
-        return TextFont(self.app.font)
+    def font(self) -> str:
+        """str: postScriptName of the TextItem's font."""
+        return self.app.font
 
     @font.setter
-    def font(self, text_font):
+    def font(self, text_font: str):
+        """Set the font of this TextItem.
+
+        Args:
+            text_font (str): Must provide the postScriptName of a valid font.
+        """
         self.app.font = text_font
 
     @property
-    def hangingPunctuation(self):
-        """True to use Roman hanging punctuation."""
+    def hangingPunctuation(self) -> bool:
+        """bool: Whether to use Roman hanging punctuation."""
         return self.app.hangingPunctuation
 
     @hangingPunctuation.setter
-    def hangingPunctuation(self, value):
+    def hangingPunctuation(self, value: bool):
         self.app.hangingPunctuation = value
 
     @property
     def height(self):
-        """int:The height of the bounding box for paragraph text."""
+        """int: The height of the bounding box for paragraph text."""
         return self.app.height
 
     @height.setter
@@ -895,16 +906,17 @@
         self.app.height = value
 
     @property
-    def horizontalScale(self):
-        """Character scaling (horizontal) in proportion to verticalScale
-
-        (a percentage value).
-
-        """
+    def horizontalScale(self) -> int:
+        """Character scaling (horizontal) in proportion to verticalScale (a percentage value)."""
         return self.app.horizontalScale
 
     @horizontalScale.setter
-    def horizontalScale(self, value):
+    def horizontalScale(self, value: int):
+        """Set the horizontalScale of this TextItem.
+
+        Args:
+            value: An integer between 0 and 1000.
+        """
         self.app.horizontalScale = value
 
     @property
@@ -1345,24 +1357,24 @@
 
         """
         return self.app.createPath()
-

antiAliasMethod: AntiAlias property writable

The method of anti aliasing to use.

autoKerning: AutoKernType property writable

The auto kerning option to use.

baselineShift property writable

The unit value to use in the baseline offset of text.

capitalization property writable

Gets text case.

color: SolidColor property writable

The text color.

contents: str property writable

The actual text in the layer.

desiredGlyphScaling property writable

The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled.

desiredLetterScaling property writable

The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required.

desiredWordScaling property writable

The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required

direction property writable

The text orientation.

fauxBold property writable

True to use faux bold (default: false).

Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette.

fauxItalic property writable

True to use faux italic (default: false).

Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette.

firstLineIndent property writable

The amount (unit value) to indent the first line of paragraphs.

font property writable

.text_font.TextFont: Current font.

hangingPunctuation property writable

True to use Roman hanging punctuation.

height property writable

horizontalScale property writable

Character scaling (horizontal) in proportion to verticalScale

(a percentage value).

hyphenateAfterFirst property writable

The number of letters after which hyphenation in word wrap is allowed.

hyphenateBeforeLast property writable

The number of letters before which hyphenation in word wrap is allowed.

hyphenateCapitalWords property writable

True to allow hyphenation in word wrap of capitalized words

hyphenateWordsLongerThan property writable

The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.

hyphenation property writable

True to use hyphenation in word wrap.

hyphenationZone property writable

The distance at the end of a line that will cause a word to break in unjustified type.

justification property writable

The paragraph justification.

leftIndent property writable

The amoun of space to indent text from the left.

ligatures property writable

True to use ligatures.

maximumGlyphScaling property writable

The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled).

Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required.

maximumLetterScaling property writable

The maximum amount of space to allow between letters

(at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required.

minimumGlyphScaling property writable

The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled).

Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required.

minimumLetterScaling property writable

The minimum amount of space to allow between letters

(a percentage value; at 0, no space is removed between letters).

Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required.

minimumWordScaling property writable

The minimum amount of space to allow between words

(a percentage value; at 100, no additional space is removed between words).

Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required.

noBreak property writable

True to disallow line breaks in this text.

Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen.

size property writable

The font size in UnitValue.

NOTE: Type was points for CS3 and older.

spaceAfter property writable

The amount of space to use after each paragraph.

strikeThru property writable

The text strike-through option to use.

underline property writable

The text underlining options.

warpBend property writable

The warp bend percentage.

warpDirection: Direction property writable

The warp direction.

warpStyle property writable

The style of warp to use.

width property writable

The width of the bounding box for

paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT.

convertToShape()

Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.

Source code in photoshop/api/text_item.py
677
-678
-679
-680
def convertToShape(self):
+

antiAliasMethod: AntiAlias property writable

The method of anti aliasing to use.

autoKerning: AutoKernType property writable

The auto kerning option to use.

baselineShift property writable

The unit value to use in the baseline offset of text.

capitalization property writable

Gets text case.

color: SolidColor property writable

The text color.

contents: str property writable

The actual text in the layer.

desiredGlyphScaling property writable

The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled.

desiredLetterScaling property writable

The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required.

desiredWordScaling property writable

The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required

direction property writable

The text orientation.

fauxBold property writable

True to use faux bold (default: false).

Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette.

fauxItalic property writable

True to use faux italic (default: false).

Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette.

firstLineIndent property writable

The amount (unit value) to indent the first line of paragraphs.

font: str property writable

hangingPunctuation: bool property writable

height property writable

horizontalScale: int property writable

Character scaling (horizontal) in proportion to verticalScale (a percentage value).

hyphenateAfterFirst property writable

The number of letters after which hyphenation in word wrap is allowed.

hyphenateBeforeLast property writable

The number of letters before which hyphenation in word wrap is allowed.

hyphenateCapitalWords property writable

True to allow hyphenation in word wrap of capitalized words

hyphenateWordsLongerThan property writable

The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.

hyphenation property writable

True to use hyphenation in word wrap.

hyphenationZone property writable

The distance at the end of a line that will cause a word to break in unjustified type.

justification property writable

The paragraph justification.

leftIndent property writable

The amoun of space to indent text from the left.

ligatures property writable

True to use ligatures.

maximumGlyphScaling property writable

The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled).

Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required.

maximumLetterScaling property writable

The maximum amount of space to allow between letters

(at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required.

minimumGlyphScaling property writable

The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled).

Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required.

minimumLetterScaling property writable

The minimum amount of space to allow between letters

(a percentage value; at 0, no space is removed between letters).

Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required.

minimumWordScaling property writable

The minimum amount of space to allow between words

(a percentage value; at 100, no additional space is removed between words).

Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required.

noBreak property writable

True to disallow line breaks in this text.

Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen.

size property writable

The font size in UnitValue.

NOTE: Type was points for CS3 and older.

spaceAfter property writable

The amount of space to use after each paragraph.

strikeThru property writable

The text strike-through option to use.

underline property writable

The text underlining options.

warpBend property writable

The warp bend percentage.

warpDirection: Direction property writable

The warp direction.

warpStyle property writable

The style of warp to use.

width property writable

The width of the bounding box for

paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT.

convertToShape()

Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.

Source code in photoshop/api/text_item.py
682
+683
+684
+685
def convertToShape(self):
     """Converts the text item and its containing layer to a fill layer with the
     text changed to a clipping path."""
     return self.app.convertToShape()
-

createPath()

Creates a clipping path from the outlines of the actual text items

(such as letters or words).

Source code in photoshop/api/text_item.py
682
-683
-684
-685
-686
-687
-688
def createPath(self):
+

createPath()

Creates a clipping path from the outlines of the actual text items

(such as letters or words).

Source code in photoshop/api/text_item.py
687
+688
+689
+690
+691
+692
+693
def createPath(self):
     """Creates a clipping path from the outlines of the actual text items
 
     (such as letters or words).
 
     """
     return self.app.createPath()
-

Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +

Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/reference/photoshop/session/index.html b/reference/photoshop/session/index.html index c3ca54ba..5ae7bf60 100644 --- a/reference/photoshop/session/index.html +++ b/reference/photoshop/session/index.html @@ -1049,4 +1049,4 @@ def echo(*args, **kwargs): """Print message.""" print(*args, **kwargs) -
Last update: 2023-11-11
Created: 2023-11-11
\ No newline at end of file +
Last update: 2023-11-20
Created: 2023-11-20
\ No newline at end of file diff --git a/search/search_index.json b/search/search_index.json index ebc9a14d..3cd7985e 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](..#contributors-) Python API for Photoshop. The example above was created with Photoshop Python API. Check it out at https://loonghao.github.io/photoshop-python-api/examples . Has been tested and used Photoshop version: Photoshop Version Supported 2023 \u2705 2022 \u2705 2021 \u2705 2020 \u2705 cc2019 \u2705 cc2018 \u2705 cc2017 \u2705 Installing You can install via pip. pip install photoshop_python_api Since it uses COM (Component Object Model) connect Photoshop, it can be used in any DCC software with a python interpreter. Hello World import photoshop.api as ps app = ps . Application () doc = app . documents . add () new_doc = doc . artLayers . add () text_color = ps . SolidColor () text_color . rgb . red = 0 text_color . rgb . green = 255 text_color . rgb . blue = 0 new_text_layer = new_doc new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) # # save to jpg jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' ) Photoshop Session Use it as context. from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) ps . app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' ) Contributors \u2728 Thanks goes to these wonderful people ( emoji key ): Hal \ud83d\udcbb voodraizer \ud83d\udc1b brunosly \ud83d\udc1b tubi \ud83d\udc1b wjxiehaixin \ud83d\udc1b \u7f57\u9a6c\u949f \ud83d\udc1b clement \ud83d\udc1b krevlinmen \ud83d\udc1b Thomas \ud83d\udc1b CaptainCsaba \ud83d\udc1b Il Harper \ud83d\udcbb blunderedbishop \ud83d\udc1b MrTeferi \ud83d\udcbb Damien Chambe \ud83d\udcbb Ehsan Akbari Tabar \ud83d\udc1b Michael Ikemann \ud83d\udc1b Enguerrand DE SMET \ud83d\udcbb Proton \ud83d\udcbb This project follows the all-contributors specification. Contributions of any kind are welcome! Repobeats analytics how to get Photoshop program ID PS> Get-ChildItem \"HKLM:\\SOFTWARE\\Classes\" | ?{ ($_.PSChildName -match \"^[a-z]+\\.[a-z]+(\\.\\d+)?$\") -and ($_.GetSubKeyNames() -contains \"CLSID\") } | ?{ $_.PSChildName -match \"Photoshop.Application\" } | ft PSChildName How to get a list of COM objects from the registry Useful links https://theiviaxx.github.io/photoshop-docs/Photoshop/ http://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref-2015.pdf https://github.com/lohriialo/photoshop-scripting-python https://www.adobe.com/devnet/photoshop/scripting.html https://www.youtube.com/playlist?list=PLUEniN8BpU8-Qmjyv3zyWaNvDYwJOJZ4m http://yearbook.github.io/esdocs/#/Photoshop/Application http://www.shining-lucy.com/wiki/page.php?id=appwiki:photoshop:ps_script http://www.tonton-pixel.com/wp-content/uploads/DecisionTable.pdf http://jongware.mit.edu/pscs5js_html/psjscs5/pc_Application.html https://indd.adobe.com/view/a0207571-ff5b-4bbf-a540-07079bd21d75 http://shining-lucy.com/wiki/page.php?id=appwiki:photoshop:ps_script http://web.archive.org/web/20140121053819/http://www.pcpix.com/Photoshop/char.html http://www.tonton-pixel.com/scripts/utility-scripts/get-equivalent-id-code/index.html https://github.com/Adobe-CEP/Samples/tree/master/PhotoshopEvents https://evanmccall.wordpress.com/2015/03/09/how-to-develop-photoshop-tools-in-python","title":"Overview"},{"location":"#installing","text":"You can install via pip. pip install photoshop_python_api Since it uses COM (Component Object Model) connect Photoshop, it can be used in any DCC software with a python interpreter.","title":"Installing"},{"location":"#hello-world","text":"import photoshop.api as ps app = ps . Application () doc = app . documents . add () new_doc = doc . artLayers . add () text_color = ps . SolidColor () text_color . rgb . red = 0 text_color . rgb . green = 255 text_color . rgb . blue = 0 new_text_layer = new_doc new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) # # save to jpg jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' )","title":"Hello World"},{"location":"#photoshop-session","text":"Use it as context. from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) ps . app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' )","title":"Photoshop Session"},{"location":"#contributors","text":"Thanks goes to these wonderful people ( emoji key ): Hal \ud83d\udcbb voodraizer \ud83d\udc1b brunosly \ud83d\udc1b tubi \ud83d\udc1b wjxiehaixin \ud83d\udc1b \u7f57\u9a6c\u949f \ud83d\udc1b clement \ud83d\udc1b krevlinmen \ud83d\udc1b Thomas \ud83d\udc1b CaptainCsaba \ud83d\udc1b Il Harper \ud83d\udcbb blunderedbishop \ud83d\udc1b MrTeferi \ud83d\udcbb Damien Chambe \ud83d\udcbb Ehsan Akbari Tabar \ud83d\udc1b Michael Ikemann \ud83d\udc1b Enguerrand DE SMET \ud83d\udcbb Proton \ud83d\udcbb This project follows the all-contributors specification. Contributions of any kind are welcome!","title":"Contributors \u2728"},{"location":"#repobeats-analytics","text":"","title":"Repobeats analytics"},{"location":"#how-to-get-photoshop-program-id","text":"PS> Get-ChildItem \"HKLM:\\SOFTWARE\\Classes\" | ?{ ($_.PSChildName -match \"^[a-z]+\\.[a-z]+(\\.\\d+)?$\") -and ($_.GetSubKeyNames() -contains \"CLSID\") } | ?{ $_.PSChildName -match \"Photoshop.Application\" } | ft PSChildName How to get a list of COM objects from the registry","title":"how to get Photoshop program ID"},{"location":"#useful-links","text":"https://theiviaxx.github.io/photoshop-docs/Photoshop/ http://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref-2015.pdf https://github.com/lohriialo/photoshop-scripting-python https://www.adobe.com/devnet/photoshop/scripting.html https://www.youtube.com/playlist?list=PLUEniN8BpU8-Qmjyv3zyWaNvDYwJOJZ4m http://yearbook.github.io/esdocs/#/Photoshop/Application http://www.shining-lucy.com/wiki/page.php?id=appwiki:photoshop:ps_script http://www.tonton-pixel.com/wp-content/uploads/DecisionTable.pdf http://jongware.mit.edu/pscs5js_html/psjscs5/pc_Application.html https://indd.adobe.com/view/a0207571-ff5b-4bbf-a540-07079bd21d75 http://shining-lucy.com/wiki/page.php?id=appwiki:photoshop:ps_script http://web.archive.org/web/20140121053819/http://www.pcpix.com/Photoshop/char.html http://www.tonton-pixel.com/scripts/utility-scripts/get-equivalent-id-code/index.html https://github.com/Adobe-CEP/Samples/tree/master/PhotoshopEvents https://evanmccall.wordpress.com/2015/03/09/how-to-develop-photoshop-tools-in-python","title":"Useful links"},{"location":"changelog/","text":"v0.22.2 (2023-11-08) Fix workflows : Add quotes to prevent 3.10 being interpretted as 3.1 typing : Replace list with List as Python <= 3.8 does not support subscriptable types Refactor Photoshop : Remove unnecessary exception type from suppress Application : Fix incorrect docstring for app.purge, allow Path objects for app.load, wrap colorSettings exceptions Photoshop : Restructure the sequence of events attempting to initialize a valid Dispatch object v0.22.1 (2023-09-22) Refactor TextFonts : Add support for method 'get' and operator 'in' v0.22.0 (2023-09-18) Feat Explicitly flag COM methods Fix formatting and linting comtypes does not play well with hasattr v0.21.10 (2023-09-14) Fix fix auto bump version fix can't set attribute activeHistoryState v0.21.9 (2023-08-31) Fix constants : Update PHOTOSHOP_VERSION_MAPPINGS to add 2024 release mapping (v24/180.0) v0.21.8 (2023-08-22) Fix deps : update dependency wheel to v0.41.2 v0.21.7 (2023-08-17) Fix deps : update dependency wheel to ^0.41.0 v0.21.6 (2023-08-17) Fix test_imports.py : Include root in install lines import-test.yml : Try an alternate approach with multiple poetry install retries import-test.yml : Correct typo in poetry version string import-test.yml : Revert to <= poetry 1.5.0 to fix \"Import Test\" workflow import-test.yml : Attempt to update lock to prevent inconsitent poetry.lock and pyproject.toml import-test : Attempt to fix poetry bug in \"Import Test\" workflow deps : Attempt to fix failing \"Import Test\" workflow Refactor TextFonts : Implement getitem to allow lookup by postScriptName v0.21.5 (2023-07-02) Fix fix paste contents of the clipboard v0.21.4 (2023-06-13) Fix LayerSets : Fix infinite recursion when trying to access LayerSets as a list Refactor Photoshop : Attempt to get running Photoshop application before spawning new one v0.21.3 (2023-05-18) Fix deps : update dependency wheel to ^0.40.0 v0.21.2 (2023-05-17) Refactor artLayers,layerSets : Refactored getitem to work like a dictionary key on LayerSets. Added type hinting and try/except to getitem for both ArtLayers and LayerSets v0.21.1 (2023-02-14) Refactor update constants for support Photoshop 2023 v0.21.0 (2023-01-06) Feat png.py : Add optional args to PNGSaveOptions v0.20.1 (2022-11-28) Refactor action_descriptor : Fix type hints for doubles v0.20.0 (2022-11-26) Feat add a new option for create batch v0.19.7 (2022-11-14) Fix deps : update dependency wheel to ^0.38.0 v0.19.6 (2022-11-06) Refactor update constants for support Photoshop 2022 v0.19.5 (2022-07-17) Refactor application : add a default value of action v0.19.4 (2022-07-10) Fix get document by document name from documents. v0.19.3 (2022-06-17) Fix fix import EPSSaveOptions v0.19.2 (2022-06-14) Refactor session.py : add EPS save options v0.19.1 (2022-05-29) Fix document : export document png : exported PNG image is too large v0.19.0 (2022-05-20) Fix ArtLayer,-LayerSet : adjusted linkedLayers property, fixed remove() Feat ArtLayer : added linkedLayers and opacity, fixed unlink v0.18.1 (2022-04-17) Refactor ActionList : Added ActionList to init and Session to make ActionList callable from Application or Session object v0.18.0 (2022-04-04) Fix fix export document Feat add new function to convert as javascript v0.17.7 (2022-03-20) Fix deps : update dependency wheel to ^0.37.0 v0.17.6 (2022-03-19) Refactor improve type hints Fix add ArtLayer instance return when duplicate layer v0.17.5 (2022-03-13) Fix update ci config and re-tag v0.17.4 (2022-03-13) Perf add more docstrings v0.17.3 (2022-03-13) Perf add more docstrings v0.17.2 (2022-03-13) Perf improve docs Fix retag and update ci Refactor improve getByName from artLayers and layers v0.17.1 (2022-03-12) Refactor improve docs v0.17.0 (2021-09-21) Feat Update the logic of searching the installation path of Photoshop through the registration v0.16.3 (2021-09-12) Fix add 2021 to version mappings v0.16.2 (2021-08-15) Fix api/text_item.py : missing width.setter for paragraphtext in text_item.py v0.16.1 (2021-07-04) Fix fix install failed in python-3.9 v0.16.0 (2021-05-29) Feat documents : support get document by index v0.15.2 (2021-05-29) Refactor use absolute path imports use absolute path imports 0.15.1 (2021-02-03) 0.15.0 (2021-01-10) 0.14.0 (2020-10-22) 0.13.0 (2020-09-23) 0.12.1 (2020-09-13) 0.12.0 (2020-05-10) 0.11.0 (2020-05-07) 0.10.0 (2020-04-22) 0.9.0 (2020-04-09) 0.8.0 (2020-04-08) 0.7.2 (2020-04-01) 0.3.0 (2020-02-24) 0.2.1 (2020-02-17)","title":"Changelog"},{"location":"changelog/#v0222-2023-11-08","text":"","title":"v0.22.2 (2023-11-08)"},{"location":"changelog/#fix","text":"workflows : Add quotes to prevent 3.10 being interpretted as 3.1 typing : Replace list with List as Python <= 3.8 does not support subscriptable types","title":"Fix"},{"location":"changelog/#refactor","text":"Photoshop : Remove unnecessary exception type from suppress Application : Fix incorrect docstring for app.purge, allow Path objects for app.load, wrap colorSettings exceptions Photoshop : Restructure the sequence of events attempting to initialize a valid Dispatch object","title":"Refactor"},{"location":"changelog/#v0221-2023-09-22","text":"","title":"v0.22.1 (2023-09-22)"},{"location":"changelog/#refactor_1","text":"TextFonts : Add support for method 'get' and operator 'in'","title":"Refactor"},{"location":"changelog/#v0220-2023-09-18","text":"","title":"v0.22.0 (2023-09-18)"},{"location":"changelog/#feat","text":"Explicitly flag COM methods","title":"Feat"},{"location":"changelog/#fix_1","text":"formatting and linting comtypes does not play well with hasattr","title":"Fix"},{"location":"changelog/#v02110-2023-09-14","text":"","title":"v0.21.10 (2023-09-14)"},{"location":"changelog/#fix_2","text":"fix auto bump version fix can't set attribute activeHistoryState","title":"Fix"},{"location":"changelog/#v0219-2023-08-31","text":"","title":"v0.21.9 (2023-08-31)"},{"location":"changelog/#fix_3","text":"constants : Update PHOTOSHOP_VERSION_MAPPINGS to add 2024 release mapping (v24/180.0)","title":"Fix"},{"location":"changelog/#v0218-2023-08-22","text":"","title":"v0.21.8 (2023-08-22)"},{"location":"changelog/#fix_4","text":"deps : update dependency wheel to v0.41.2","title":"Fix"},{"location":"changelog/#v0217-2023-08-17","text":"","title":"v0.21.7 (2023-08-17)"},{"location":"changelog/#fix_5","text":"deps : update dependency wheel to ^0.41.0","title":"Fix"},{"location":"changelog/#v0216-2023-08-17","text":"","title":"v0.21.6 (2023-08-17)"},{"location":"changelog/#fix_6","text":"test_imports.py : Include root in install lines import-test.yml : Try an alternate approach with multiple poetry install retries import-test.yml : Correct typo in poetry version string import-test.yml : Revert to <= poetry 1.5.0 to fix \"Import Test\" workflow import-test.yml : Attempt to update lock to prevent inconsitent poetry.lock and pyproject.toml import-test : Attempt to fix poetry bug in \"Import Test\" workflow deps : Attempt to fix failing \"Import Test\" workflow","title":"Fix"},{"location":"changelog/#refactor_2","text":"TextFonts : Implement getitem to allow lookup by postScriptName","title":"Refactor"},{"location":"changelog/#v0215-2023-07-02","text":"","title":"v0.21.5 (2023-07-02)"},{"location":"changelog/#fix_7","text":"fix paste contents of the clipboard","title":"Fix"},{"location":"changelog/#v0214-2023-06-13","text":"","title":"v0.21.4 (2023-06-13)"},{"location":"changelog/#fix_8","text":"LayerSets : Fix infinite recursion when trying to access LayerSets as a list","title":"Fix"},{"location":"changelog/#refactor_3","text":"Photoshop : Attempt to get running Photoshop application before spawning new one","title":"Refactor"},{"location":"changelog/#v0213-2023-05-18","text":"","title":"v0.21.3 (2023-05-18)"},{"location":"changelog/#fix_9","text":"deps : update dependency wheel to ^0.40.0","title":"Fix"},{"location":"changelog/#v0212-2023-05-17","text":"","title":"v0.21.2 (2023-05-17)"},{"location":"changelog/#refactor_4","text":"artLayers,layerSets : Refactored getitem to work like a dictionary key on LayerSets. Added type hinting and try/except to getitem for both ArtLayers and LayerSets","title":"Refactor"},{"location":"changelog/#v0211-2023-02-14","text":"","title":"v0.21.1 (2023-02-14)"},{"location":"changelog/#refactor_5","text":"update constants for support Photoshop 2023","title":"Refactor"},{"location":"changelog/#v0210-2023-01-06","text":"","title":"v0.21.0 (2023-01-06)"},{"location":"changelog/#feat_1","text":"png.py : Add optional args to PNGSaveOptions","title":"Feat"},{"location":"changelog/#v0201-2022-11-28","text":"","title":"v0.20.1 (2022-11-28)"},{"location":"changelog/#refactor_6","text":"action_descriptor : Fix type hints for doubles","title":"Refactor"},{"location":"changelog/#v0200-2022-11-26","text":"","title":"v0.20.0 (2022-11-26)"},{"location":"changelog/#feat_2","text":"add a new option for create batch","title":"Feat"},{"location":"changelog/#v0197-2022-11-14","text":"","title":"v0.19.7 (2022-11-14)"},{"location":"changelog/#fix_10","text":"deps : update dependency wheel to ^0.38.0","title":"Fix"},{"location":"changelog/#v0196-2022-11-06","text":"","title":"v0.19.6 (2022-11-06)"},{"location":"changelog/#refactor_7","text":"update constants for support Photoshop 2022","title":"Refactor"},{"location":"changelog/#v0195-2022-07-17","text":"","title":"v0.19.5 (2022-07-17)"},{"location":"changelog/#refactor_8","text":"application : add a default value of action","title":"Refactor"},{"location":"changelog/#v0194-2022-07-10","text":"","title":"v0.19.4 (2022-07-10)"},{"location":"changelog/#fix_11","text":"get document by document name from documents.","title":"Fix"},{"location":"changelog/#v0193-2022-06-17","text":"","title":"v0.19.3 (2022-06-17)"},{"location":"changelog/#fix_12","text":"fix import EPSSaveOptions","title":"Fix"},{"location":"changelog/#v0192-2022-06-14","text":"","title":"v0.19.2 (2022-06-14)"},{"location":"changelog/#refactor_9","text":"session.py : add EPS save options","title":"Refactor"},{"location":"changelog/#v0191-2022-05-29","text":"","title":"v0.19.1 (2022-05-29)"},{"location":"changelog/#fix_13","text":"document : export document png : exported PNG image is too large","title":"Fix"},{"location":"changelog/#v0190-2022-05-20","text":"","title":"v0.19.0 (2022-05-20)"},{"location":"changelog/#fix_14","text":"ArtLayer,-LayerSet : adjusted linkedLayers property, fixed remove()","title":"Fix"},{"location":"changelog/#feat_3","text":"ArtLayer : added linkedLayers and opacity, fixed unlink","title":"Feat"},{"location":"changelog/#v0181-2022-04-17","text":"","title":"v0.18.1 (2022-04-17)"},{"location":"changelog/#refactor_10","text":"ActionList : Added ActionList to init and Session to make ActionList callable from Application or Session object","title":"Refactor"},{"location":"changelog/#v0180-2022-04-04","text":"","title":"v0.18.0 (2022-04-04)"},{"location":"changelog/#fix_15","text":"fix export document","title":"Fix"},{"location":"changelog/#feat_4","text":"add new function to convert as javascript","title":"Feat"},{"location":"changelog/#v0177-2022-03-20","text":"","title":"v0.17.7 (2022-03-20)"},{"location":"changelog/#fix_16","text":"deps : update dependency wheel to ^0.37.0","title":"Fix"},{"location":"changelog/#v0176-2022-03-19","text":"","title":"v0.17.6 (2022-03-19)"},{"location":"changelog/#refactor_11","text":"improve type hints","title":"Refactor"},{"location":"changelog/#fix_17","text":"add ArtLayer instance return when duplicate layer","title":"Fix"},{"location":"changelog/#v0175-2022-03-13","text":"","title":"v0.17.5 (2022-03-13)"},{"location":"changelog/#fix_18","text":"update ci config and re-tag","title":"Fix"},{"location":"changelog/#v0174-2022-03-13","text":"","title":"v0.17.4 (2022-03-13)"},{"location":"changelog/#perf","text":"add more docstrings","title":"Perf"},{"location":"changelog/#v0173-2022-03-13","text":"","title":"v0.17.3 (2022-03-13)"},{"location":"changelog/#perf_1","text":"add more docstrings","title":"Perf"},{"location":"changelog/#v0172-2022-03-13","text":"","title":"v0.17.2 (2022-03-13)"},{"location":"changelog/#perf_2","text":"improve docs","title":"Perf"},{"location":"changelog/#fix_19","text":"retag and update ci","title":"Fix"},{"location":"changelog/#refactor_12","text":"improve getByName from artLayers and layers","title":"Refactor"},{"location":"changelog/#v0171-2022-03-12","text":"","title":"v0.17.1 (2022-03-12)"},{"location":"changelog/#refactor_13","text":"improve docs","title":"Refactor"},{"location":"changelog/#v0170-2021-09-21","text":"","title":"v0.17.0 (2021-09-21)"},{"location":"changelog/#feat_5","text":"Update the logic of searching the installation path of Photoshop through the registration","title":"Feat"},{"location":"changelog/#v0163-2021-09-12","text":"","title":"v0.16.3 (2021-09-12)"},{"location":"changelog/#fix_20","text":"add 2021 to version mappings","title":"Fix"},{"location":"changelog/#v0162-2021-08-15","text":"","title":"v0.16.2 (2021-08-15)"},{"location":"changelog/#fix_21","text":"api/text_item.py : missing width.setter for paragraphtext in text_item.py","title":"Fix"},{"location":"changelog/#v0161-2021-07-04","text":"","title":"v0.16.1 (2021-07-04)"},{"location":"changelog/#fix_22","text":"fix install failed in python-3.9","title":"Fix"},{"location":"changelog/#v0160-2021-05-29","text":"","title":"v0.16.0 (2021-05-29)"},{"location":"changelog/#feat_6","text":"documents : support get document by index","title":"Feat"},{"location":"changelog/#v0152-2021-05-29","text":"","title":"v0.15.2 (2021-05-29)"},{"location":"changelog/#refactor_14","text":"use absolute path imports use absolute path imports","title":"Refactor"},{"location":"changelog/#0151-2021-02-03","text":"","title":"0.15.1 (2021-02-03)"},{"location":"changelog/#0150-2021-01-10","text":"","title":"0.15.0 (2021-01-10)"},{"location":"changelog/#0140-2020-10-22","text":"","title":"0.14.0 (2020-10-22)"},{"location":"changelog/#0130-2020-09-23","text":"","title":"0.13.0 (2020-09-23)"},{"location":"changelog/#0121-2020-09-13","text":"","title":"0.12.1 (2020-09-13)"},{"location":"changelog/#0120-2020-05-10","text":"","title":"0.12.0 (2020-05-10)"},{"location":"changelog/#0110-2020-05-07","text":"","title":"0.11.0 (2020-05-07)"},{"location":"changelog/#0100-2020-04-22","text":"","title":"0.10.0 (2020-04-22)"},{"location":"changelog/#090-2020-04-09","text":"","title":"0.9.0 (2020-04-09)"},{"location":"changelog/#080-2020-04-08","text":"","title":"0.8.0 (2020-04-08)"},{"location":"changelog/#072-2020-04-01","text":"","title":"0.7.2 (2020-04-01)"},{"location":"changelog/#030-2020-02-24","text":"","title":"0.3.0 (2020-02-24)"},{"location":"changelog/#021-2020-02-17","text":"","title":"0.2.1 (2020-02-17)"},{"location":"examples/","text":"Examples Get Document By Name \"\"\"Get document by document name from documents.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () slate_template = PSD_FILE [ \"slate_template.psd\" ] with Session ( slate_template , action = \"open\" , auto_close = True ) as ps : for doc in ps . app . documents : print ( doc . name ) print ( ps . app . documents . getByName ( \"slate_template.psd\" ) . fullName ) Open Psd # Import local modules from photoshop import Session import photoshop.api as ps # style 1 app = ps . Application () app . load ( \"your/psd/or/psb/file_path.psd\" ) # style 2 with Session ( \"your/psd/or/psb/file_path.psd\" , action = \"open\" ) as ps : ps . echo ( ps . active_document . name ) Session New Document \"\"\"Action for create new document and print new document name.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : ps . echo ( ps . active_document . name ) Current Tool # Import local modules from photoshop import Session with Session () as ps : # Print the current tool. ps . echo ( ps . app . currentTool ) # Set current tool to `typeCreateOrEditTool`. ps . app . currentTool = \"typeCreateOrEditTool\" Run Batch # Import built-in modules import os # Import local modules from photoshop import Session root = \"your/images/root\" files = [] for name in os . listdir ( root ): files . append ( os . path . join ( root , name )) with Session () as api : options = api . BatchOptions () options . destination = 3 options . destinationFolder = \"c: \\\\ test\" api . app . batch ( files = files , actionName = \"Quadrant Colors\" , actionSet = \"Default Actions\" , options = options ) Move To End # Import local modules import photoshop.api as ps # Get photoshop instance. app = ps . Application () # Add new document and set name to \"Example for move to End.\" active_document = app . documents . add ( name = \"Example for move to End.\" ) # Add a new layer set. group_layer = active_document . layerSets . add () # Add a layer in the group. layer = group_layer . artLayers . add () layer . name = \"This is a child layer.\" # Add a new layer in this active document top. top_layer = active_document . artLayers . add () top_layer . name = \"This is a top layer.\" top_layer . moveToEnd ( group_layer ) Creating A Layer \"\"\" Let's get the current document and create a new layer \"Background\" and fill it with red color. In order to use the Fill tool we will first select the entire layer and then fill it with a color. \"\"\" # Import local modules from photoshop import Session with Session () as ps : document = ps . active_document # Create color object of color red. fillColor = ps . SolidColor () fillColor . rgb . red = 222 fillColor . rgb . green = 0 fillColor . rgb . blue = 0 # Add a new layer called Background. layer = document . artLayers . add () layer . name = \"Background\" # Select the entire layer. document . selection . selectAll () # Fill the selection with color. document . selection . fill ( fillColor ) # Deselect. document . selection . deselect () Active Layer # Set the active layer to the last art layer of the active document, or the # first if the last is already active. # Import local modules from photoshop import Session with Session () as ps : if len ( ps . app . documents ) < 1 : docRef = ps . app . documents . add () else : docRef = ps . app . activeDocument if len ( docRef . layers ) < 2 : docRef . artLayers . add () ps . echo ( docRef . activeLayer . name ) new_layer = docRef . artLayers . add () ps . echo ( new_layer . name ) new_layer . name = \"test\" Convert Smartobject To Layer \"\"\"Convert Smart object to artLayer.\"\"\" # Import local modules from photoshop import Session # example 1 with Session () as ps : js = \"\"\" var idplacedLayerConvertToLayers = stringIDToTypeID( \"placedLayerConvertToLayers\" ); executeAction( idplacedLayerConvertToLayers, undefined, DialogModes.NO ); \"\"\" ps . app . doJavaScript ( js ) # example 2 with Session () as ps : descriptor = ps . ActionDescriptor idplacedLayerConvertToLayers = ps . app . stringIDToTypeID ( \"placedLayerConvertToLayers\" ) ps . app . executeAction ( idplacedLayerConvertToLayers , descriptor ) Export Document # Import built-in modules import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () if __name__ == \"__main__\" : psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" , auto_close = True ) as ps : opts = ps . ExportOptionsSaveForWeb () png_file = os . path . join ( mkdtemp (), \"test.png\" ) active_document = ps . app . activeDocument active_document . exportDocument ( png_file , ps . ExportType . SaveForWeb , opts ) os . startfile ( png_file ) Add Metadata \"\"\"Add metadata to current active document.\"\"\" # Import built-in modules import os # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document doc . info . author = os . getenv ( \"USERNAME\" ) doc . info . provinceState = \"Beijing\" doc . info . title = \"My Demo\" print ( \"Print all metadata of current active document.\" ) ps . echo ( doc . info ) Create Thumbnail \"\"\"Create a thumbnail image for currently active document. You can use the thumbnail image to upload to Shotgun or Ftrack. \"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session def create_thumbnail ( output_path = None , max_resolution = 512 ): \"\"\"Create a thumbnail image for currently active document. Args: output_path (str): The absolute output path of the thumbnail image. The default is to output to a temporary folder. max_resolution (int): The max resolution of the thumbnail. The default is `512`. Returns: str: The absolute output path of the thumbnail image. \"\"\" output_path = output_path or os . path . join ( mkdtemp (), \"thumb.jpg\" ) with Session ( auto_close = True ) as ps : orig_name = ps . active_document . name width_str = ps . active_document . width height_str = ps . active_document . height thumb_name = f \" { orig_name } _thumb\" max_resolution = width_str / max_resolution thumb_width = int ( width_str / max_resolution ) thumb_height = int ( height_str / max_resolution ) thumb_doc = ps . active_document . duplicate ( thumb_name ) thumb_doc . resizeImage ( thumb_width , thumb_height - 100 ) thumb_doc . saveAs ( output_path , ps . JPEGSaveOptions (), asCopy = True ) thumb_doc . close () return output_path if __name__ == \"__main__\" : thumb_file = create_thumbnail () print ( f \"Save thumbnail file to { thumb_file } .\" ) Session Smart Sharpen \"\"\"This script demonstrates how you can use the action manager to execute the Emboss filter. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SmartSharpen.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"layer_comps.psd\" ] with Session ( file_path , action = \"open\" ) as ps : def SmartSharpen ( inAmount , inRadius , inNoise ): idsmart_sharpen_id = ps . app . stringIDToTypeID ( ps . EventID . SmartSharpen ) desc37 = ps . ActionDescriptor () idpresetKind = ps . app . stringIDToTypeID ( ps . EventID . PresetKind ) idpresetKindType = ps . app . stringIDToTypeID ( ps . EventID . PresetKindType ) idpresetKindCustom = ps . app . stringIDToTypeID ( ps . EventID . PresetKindCustom ) desc37 . putEnumerated ( idpresetKind , idpresetKindType , idpresetKindCustom ) idAmnt = ps . app . charIDToTypeID ( \"Amnt\" ) idPrc = ps . app . charIDToTypeID ( \"Rds \" ) desc37 . putUnitDouble ( idAmnt , idPrc , inAmount ) idRds = ps . app . charIDToTypeID ( \"Rds \" ) idPxl = ps . app . charIDToTypeID ( \"#Pxl\" ) desc37 . putUnitDouble ( idRds , idPxl , inRadius ) idnoiseReduction = ps . app . stringIDToTypeID ( \"noiseReduction\" ) idPrc = ps . app . charIDToTypeID ( \"#Prc\" ) desc37 . putUnitDouble ( idnoiseReduction , idPrc , inNoise ) idblur = ps . app . charIDToTypeID ( \"blur\" ) idblurType = ps . app . stringIDToTypeID ( \"blurType\" ) idGsnB = ps . app . charIDToTypeID ( \"GsnB\" ) desc37 . putEnumerated ( idblur , idblurType , idGsnB ) ps . app . ExecuteAction ( idsmart_sharpen_id , desc37 ) docRef = ps . active_document nlayerSets = docRef . layerSets nArtLayers = docRef . layerSets . item ( nlayerSets . length ) docRef . activeLayer = nArtLayers . artLayers . item ( nArtLayers . artLayers . length ) SmartSharpen ( 300 , 2.0 , 20 ) Load Selection # This script will demonstrate how to load a selection from a saved alpha # channel. # Import local modules from photoshop import Session with Session () as ps : doc_ref = ps . app . documents . add ( 320 , 240 ) start_ruler_units = ps . app . preferences . rulerUnits if start_ruler_units is not ps . Units . Pixels : ps . app . Preferences . RulerUnits = ps . Units . Pixels # Save a rectangular selection area offset by 50 pixels from the image # border into an alpha channel. offset = 50 selBounds1 = ( ( offset , offset ), ( doc_ref . Width - offset , offset ), ( doc_ref . Width - offset , doc_ref . Height - offset ), ( offset , doc_ref . Height - offset ), ) doc_ref . selection . select ( selBounds1 ) selAlpha = doc_ref . channels . Add () doc_ref . selection . store ( selAlpha ) # Now create a second wider but less tall selection. selBounds2 = (( 0 , 75 ), ( doc_ref . Width , 75 ), ( doc_ref . Width , 150 ), ( 0 , 150 )) doc_ref . selection . select ( selBounds2 ) # Load the selection from the just saved alpha channel, combining it with # the active selection. doc_ref . selection . load ( selAlpha , ps . SelectionType . ExtendSelection , False ) # Set ruler back to where it was. ps . app . Preferences . RulerUnits = start_ruler_units Photoshop Session \"\"\"Add slate information dynamically.\"\"\" # Import built-in modules from datetime import datetime import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"slate_template.psd\" ] with Session ( file_path , action = \"open\" , auto_close = True ) as ps : layer_set = ps . active_document . layerSets . getByName ( \"template\" ) data = { \"project name\" : \"test_project\" , \"datetime\" : datetime . today () . strftime ( \"%Y-%m- %d \" ), } for layer in layer_set . layers : if layer . kind == ps . LayerKind . TextLayer : layer . textItem . contents = data [ layer . textItem . contents . strip ()] jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"slate.jpg\" ) ps . active_document . saveAs ( jpg_file , ps . JPEGSaveOptions ()) os . startfile ( jpg_file ) Apply Filters \"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ApplyFilters.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules # selections in the open document. import photoshop.api as ps PSD_FILE = psd . get_psd_files () # Start up Photoshop application app = ps . Application () # We don't want any Photoshop dialogs displayed during automated execution app . displayDialogs = ps . DialogModes . DisplayNoDialogs psPixels = 1 start_ruler_units = app . preferences . rulerUnits if start_ruler_units is not psPixels : app . preferences . rulerUnits = psPixels fileName = PSD_FILE [ \"layer_comps.psd\" ] docRef = app . open ( fileName ) nLayerSets = len ( list (( i , x ) for i , x in enumerate ( docRef . layerSets ))) - 1 nArtLayers = len ( list (( i , x ) for i , x in enumerate ( docRef . layerSets [ nLayerSets ] . artLayers )), ) active_layer = docRef . activeLayer = docRef . layerSets [ nLayerSets ] . artLayers [ nArtLayers ] sel_area = (( 0 , 212 ), ( 300 , 212 ), ( 300 , 300 ), ( 0 , 300 )) docRef . selection . select ( sel_area , ps . SelectionType . ReplaceSelection , 20 , True ) print ( f \"Current active layer: { active_layer . name } \" ) active_layer . applyAddNoise ( 15 , ps . NoiseDistribution . GaussianNoise , False ) backColor = ps . SolidColor () backColor . hsb . hue = 0 backColor . hsb . saturation = 0 backColor . hsb . brightness = 100 app . backgroundColor = backColor sel_area2 = (( 120 , 20 ), ( 210 , 20 ), ( 210 , 110 ), ( 120 , 110 )) docRef . selection . select ( sel_area2 , ps . SelectionType . ReplaceSelection , 25 , False ) active_layer . applyDiffuseGlow ( 9 , 12 , 15 ) active_layer . applyGlassEffect ( 7 , 3 , 7 , False , ps . TextureType . TinyLensTexture , None , ) docRef . selection . deselect () # Set ruler units back the way we found it. if start_ruler_units is not psPixels : app . Preferences . RulerUnits = start_ruler_units Operate Layer Set \"\"\"A examples to show you how to operate layerSet.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : docRef = ps . active_document # Add a new layerSet. new_layer_set = docRef . layerSets . add () # Print the layerSet count. ps . echo ( docRef . layerSets . length ) ps . echo ( len ( docRef . layerSets )) # Rename the layerSet. docRef . layerSets [ 0 ] . name = \"New Name\" ps . echo ( new_layer_set . name ) # Change the layerSet opacity new_layer_set . opacity = 90 ps . echo ( new_layer_set . opacity ) # Duplicate the layerSet. duplicate_layer_set = new_layer_set . duplicate () # Add a new artLayer in current active document. layer = docRef . artLayers . add () # Move the artLayer under the duplicate layerSet. layer . move ( duplicate_layer_set , ps . ElementPlacement . PlaceInside ) # Merge the layerSet. merged_layer = duplicate_layer_set . merge () ps . echo ( merged_layer . name ) # Set visible. new_layer_set . visible = False merged_layer . remove () Selection Stroke \"\"\"Create a stroke around the current selection, Set the stroke color and width of the new stroke. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SelectionStroke.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if len ( list (( i , x ) for i , x in enumerate ( app . documents , 1 ))) > 0 : if not app . activeDocument . activeLayer . isBackgroundLayer : psPixels = 1 start_ruler_units = app . Preferences . RulerUnits app . preferences . rulerUnits = ps . Units . Pixels selRef = app . activeDocument . selection offset = 10 selBounds = ( ( offset , offset ), ( app . activeDocument . width - offset , offset ), ( app . activeDocument . width - offset , app . activeDocument . height - offset ), ( offset , app . activeDocument . height - offset ), ) selRef . select ( selBounds ) selRef . selectBorder ( 5 ) # create text color properties strokeColor = ps . SolidColor () strokeColor . cmyk . cyan = 58 strokeColor . cmyk . magenta = 0 strokeColor . cmyk . yellow = 70 strokeColor . cmyk . black = 0 app . displayDialogs = ps . DialogModes . DisplayNoDialogs selRef . stroke ( strokeColor , 2 , ps . StrokeLocation . OutsideStroke , ps . ColorBlendMode . ColorBlendMode , 75 , True , ) # Set ruler units back the way we found it. app . preferences . rulerUnits = start_ruler_units else : print ( \"Operation cannot be performed on background layer\" ) else : print ( \"Create a document with an active selection before running this \" \"script!\" ) Cropping \"\"\"A cropping example.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : ps . active_document . crop ( bounds = [ 100 , 12 , 354 , 246 ], width = 1920 , height = 1080 ) Create New Document \"\"\"Create a new document.\"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . preferences . rulerUnits = ps . Units . Pixels ps . app . documents . add ( 1920 , 1080 , name = \"my_new_document\" ) Replace Images \"\"\"Replace the image of the current active layer with a new image.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () with Session ( PSD_FILE [ \"replace_images.psd\" ], action = \"open\" ) as ps : active_layer = ps . active_document . activeLayer bounds = active_layer . bounds print ( f \"current layer { active_layer . name } : { bounds } \" ) input_file = PSD_FILE [ \"red_100x200.png\" ] replace_contents = ps . app . stringIDToTypeID ( \"placedLayerReplaceContents\" ) desc = ps . ActionDescriptor idnull = ps . app . charIDToTypeID ( \"null\" ) desc . putPath ( idnull , input_file ) ps . app . executeAction ( replace_contents , desc ) # replaced image. active_layer = ps . active_document . activeLayer current_bounds = active_layer . bounds width = bounds [ 2 ] - bounds [ 0 ] height = bounds [ 3 ] - bounds [ 1 ] current_width = current_bounds [ 2 ] - current_bounds [ 0 ] current_height = current_bounds [ 3 ] - current_bounds [ 1 ] new_size = width / current_width * 100 active_layer . resize ( new_size , new_size , ps . AnchorPosition . MiddleCenter ) print ( f \"current layer { active_layer . name } : { current_bounds } \" ) Link Layer # Import local modules import photoshop.api as ps app = ps . Application () start_ruler_units = app . preferences . rulerUnits if len ( app . documents ) < 1 : if start_ruler_units is not ps . Units . Pixels : app . preferences . rulerUnits = ps . Units . Pixels docRef = app . documents . add ( 320 , 240 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . BackgroundColor , ) else : docRef = app . activeDocument layerRef = docRef . artLayers . add () layerRef2 = docRef . artLayers . add () layerRef . link ( layerRef2 ) # Set the ruler back to where it was app . preferences . rulerUnits = start_ruler_units Fill Selection # Fill the current selection with an RGB color. # Import local modules from photoshop import Session with Session () as ps : start_ruler_units = ps . app . Preferences . RulerUnits if len ( ps . app . documents ) < 1 : if start_ruler_units is not ps . Units . Pixels : ps . app . Preferences . RulerUnits = ps . Units . Pixels docRef = ps . app . documents . add ( 320 , 240 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . White ) docRef . artLayers . add () ps . app . preferences . rulerUnits = start_ruler_units if not ps . active_document . activeLayer . isBackgroundLayer : selRef = ps . active_document . selection fillcolor = ps . SolidColor () fillcolor . rgb . red = 225 fillcolor . rgb . green = 0 fillcolor . rgb . blue = 0 selRef . fill ( fillcolor , ps . ColorBlendMode . NormalBlendColor , 25 , False ) else : ps . echo ( \"Can't perform operation on background layer.\" ) Change Color Of Background And Foreground \"\"\"Change the color of the background and foreground.\"\"\" # Import local modules from photoshop import Session with Session () as ps : foregroundColor = ps . SolidColor () foregroundColor . rgb . red = 255 foregroundColor . rgb . green = 0 foregroundColor . rgb . blue = 0 ps . app . foregroundColor = foregroundColor backgroundColor = ps . SolidColor () backgroundColor . rgb . red = 0 backgroundColor . rgb . green = 0 backgroundColor . rgb . blue = 0 ps . app . backgroundColor = backgroundColor Add Slate \"\"\"Add slate information dynamically. - Open template. - Update info. - Save as jpg. - Close current document. \"\"\" # Import built-in modules from datetime import datetime import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () slate_template = PSD_FILE [ \"slate_template.psd\" ] with Session ( slate_template , action = \"open\" , auto_close = True ) as ps : layer_set = ps . active_document . layerSets . getByName ( \"template\" ) data = { \"project name\" : \"test_project\" , \"datetime\" : datetime . today () . strftime ( \"%Y-%m- %d \" ), } for layer in layer_set . layers : if layer . kind == ps . LayerKind . TextLayer : layer . textItem . contents = data [ layer . textItem . contents . strip ()] jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"slate.jpg\" ) ps . active_document . saveAs ( jpg_file , ps . JPEGSaveOptions ()) print ( f \"Save jpg to { jpg_file } \" ) os . startfile ( jpg_file ) New Document # Create a new Photoshop document with diminsions 4 inches by 4 inches. # Import local modules import photoshop.api as ps # Start up Photoshop application app = ps . Application () start_ruler_units = app . preferences . rulerUnits app . preferences . rulerUnits = ps . Units . Pixels # Create the document docRef = app . documents . add ( 1920 , 1080 , 72.0 , \"My New Document\" ) # Make sure to set the ruler units prior to creating the document. app . preferences . rulerUnits = start_ruler_units Export Layers As Png \"\"\"Export every layer as a .png file.\"\"\" # Import built-in modules import os # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () def hide_all_layers ( layers ): for layer in layers : layer . visible = False def main (): psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" ) as ps : doc = ps . active_document options = ps . PNGSaveOptions () options . compression = 1 layers = doc . artLayers for layer in layers : hide_all_layers ( layers ) layer . visible = True layer_path = os . path . join ( doc . path , layer . name ) print ( layer_path ) if not os . path . exists ( layer_path ): os . makedirs ( layer_path ) image_path = os . path . join ( layer_path , f \" { layer . name } .png\" ) doc . saveAs ( image_path , options = options , asCopy = True ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) if __name__ == \"__main__\" : main () Import Image As Layer \"\"\"Import a image as a artLayer.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : desc = ps . ActionDescriptor desc . putPath ( ps . app . charIDToTypeID ( \"null\" ), \"your/image/path\" ) event_id = ps . app . charIDToTypeID ( \"Plc \" ) # `Plc` need one space in here. ps . app . executeAction ( ps . app . charIDToTypeID ( \"Plc \" ), desc ) List Documents \"\"\"List current photoshop all documents.\"\"\" # Import local modules import photoshop.api as ps app = ps . Application () doc = app . documents [ 0 ] print ( doc . name ) for doc in app . documents : print ( doc . name ) Export Layers Use Export Options Saveforweb \"\"\"Export every layer as a .png file use `ExportOptionsSaveForWeb`.\"\"\" # Import built-in modules import os # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () def hide_all_layers ( layers ): for layer in layers : layer . visible = False def main (): psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" ) as ps : doc = ps . active_document options = ps . ExportOptionsSaveForWeb () layers = doc . artLayers for layer in layers : hide_all_layers ( layers ) layer . visible = True layer_path = os . path . join ( doc . path , layer . name ) print ( layer_path ) if not os . path . exists ( layer_path ): os . makedirs ( layer_path ) image_path = os . path . join ( layer_path , f \" { layer . name } .png\" ) doc . exportDocument ( image_path , exportAs = ps . ExportType . SaveForWeb , options = options ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) if __name__ == \"__main__\" : main () Add Start Application Event \"\"\"Add event for Photoshop start application. In the current example, every time we start photoshop it will alert \"Start Application Event\". Just like you manually in Script> Script Events Manager to enable the event. \"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as ps : root = mkdtemp () jsx_file = os . path . join ( root , \"event.jsx\" ) with open ( jsx_file , \"w\" ) as f : f . write ( 'alert(\"Start Application event.\")' ) ps . app . notifiers . add ( ps . EventID . Notify , jsx_file ) print ( \"Add event done.\" ) Session Document Duplicate \"\"\"Action for duplicate current active document.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"document_duplicate\" ) as ps : ps . echo ( ps . active_document . name ) Save To Psd \"\"\"Save your current active document as a .psd file.\"\"\" # Import local modules from photoshop import Session with Session () as ps : psd_file = \"your/psd/save/file/path.psd\" doc = ps . active_document options = ps . PhotoshopSaveOptions () layers = doc . artLayers doc . saveAs ( psd_file , options , True ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) Set Active Layer \"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ActiveLayer.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if app . documents . length < 1 : docRef = app . documents . add () else : docRef = app . activeDocument if docRef . layers . length < 2 : docRef . artLayers . add () activeLayerName = docRef . activeLayer . name if docRef . activeLayer . name != docRef . layers . item ( docRef . layers . length ) . name : docRef . activeLayer = docRef . layers . item ( docRef . layers . length ) else : docRef . activeLayer = docRef . layers . item ( 1 ) Smart Sharpen \"\"\"This script demonstrates how you can use the action manager to execute the Emboss filter. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SmartSharpen.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules import photoshop.api as ps app = ps . Application () PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"layer_comps.psd\" ] docRef = app . open ( file_path ) nlayerSets = docRef . layerSets nArtLayers = docRef . layerSets . item ( nlayerSets . length ) docRef . activeLayer = nArtLayers . artLayers . item ( nArtLayers . artLayers . length ) def SmartSharpen ( inAmount , inRadius , inNoise ): idsmart_sharpen_id = app . stringIDToTypeID ( ps . EventID . SmartSharpen ) desc37 = ps . ActionDescriptor () idpresetKind = app . stringIDToTypeID ( ps . EventID . PresetKind ) idpresetKindType = app . stringIDToTypeID ( ps . EventID . PresetKindType ) idpresetKindCustom = app . stringIDToTypeID ( ps . EventID . PresetKindCustom ) desc37 . putEnumerated ( idpresetKind , idpresetKindType , idpresetKindCustom ) idAmnt = app . charIDToTypeID ( \"Amnt\" ) idPrc = app . charIDToTypeID ( \"Rds \" ) desc37 . putUnitDouble ( idAmnt , idPrc , inAmount ) idRds = app . charIDToTypeID ( \"Rds \" ) idPxl = app . charIDToTypeID ( \"#Pxl\" ) desc37 . putUnitDouble ( idRds , idPxl , inRadius ) idnoiseReduction = app . stringIDToTypeID ( \"noiseReduction\" ) idPrc = app . charIDToTypeID ( \"#Prc\" ) desc37 . putUnitDouble ( idnoiseReduction , idPrc , inNoise ) idblur = app . charIDToTypeID ( \"blur\" ) idblurType = app . stringIDToTypeID ( \"blurType\" ) idGsnB = app . charIDToTypeID ( \"GsnB\" ) desc37 . putEnumerated ( idblur , idblurType , idGsnB ) app . ExecuteAction ( idsmart_sharpen_id , desc37 ) SmartSharpen ( 300 , 2.0 , 20 ) Revert Changes \"\"\"This example demonstrates how to roll back history.\"\"\" # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document old_state = doc . activeHistoryState print ( old_state . name ) doc . artLayers . add () last_state = doc . activeHistoryState print ( last_state . name ) doc . activeHistoryState = old_state print ( doc . activeHistoryState . name ) Toggle Proof Colors \"\"\"Toggle the proof color. Like operating in the menu: **View** > **Proof Colors** (Ctrl + Y) \"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . runMenuItem ( ps . app . stringIDToTypeID ( \"toggleProofColors\" )) Fit On Screen \"\"\"Let the current document Fit on screen.\"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . runMenuItem ( ps . app . charIDToTypeID ( \"FtOn\" )) Session Callback # Import local modules from photoshop import Session def do_something ( photoshop_api ): print ( photoshop_api . active_document ) print ( \"Do something.\" ) with Session ( callback = do_something ) as ps : ps . echo ( ps . active_document . name ) ps . alert ( ps . active_document . name ) Session Hello World \"\"\"Add slate information dynamically.\"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as adobe : doc = adobe . app . documents . add ( 2000 , 2000 ) text_color = adobe . SolidColor () text_color . rgb . red = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = adobe . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = adobe . JPEGSaveOptions ( quality = 1 ) jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"hello_world.jpg\" ) doc . saveAs ( jpg_file , options , asCopy = True ) adobe . app . doJavaScript ( f 'alert(\"save to jpg: { jpg_file } \")' ) Get Layer By Name # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" , auto_close = True ) as ps : art_layer = ps . active_document . artLayers . getByName ( \"blue\" ) assert art_layer . name == \"blue\" Save As Tga # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 text_color . rgb . red = 0 text_color . rgb . blue = 0 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color tga_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"test.tga\" ) doc . saveAs ( tga_file , ps . TargaSaveOptions (), asCopy = True ) os . startfile ( tga_file ) Compare Colors \"\"\"Check whether the foreground is equal to the background color. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/CompareColors.py \"\"\" # Import local modules from photoshop import Session with Session () as ps : if ps . app . foregroundColor . isEqual ( ps . app . backgroundColor ): ps . echo ( \"They're Equal.\" ) else : ps . echo ( \"NOT Equal.\" ) Hello World # Import built-in modules import os from tempfile import mkdtemp # Import local modules import photoshop.api as ps def hello_world (): app = ps . Application () doc = app . documents . add () text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"hello_world.jpg\" ) doc . saveAs ( jpg_file , options , asCopy = True ) os . startfile ( jpg_file ) if __name__ == \"__main__\" : hello_world () Emboss Action # Import local modules from photoshop import Session with Session () as ps : app = ps . app for index , x in enumerate ( range ( 50 )): # Execute an existing action from action palette. idPly = app . charIDToTypeID ( \"Ply \" ) desc8 = ps . ActionDescriptor () idnull = app . charIDToTypeID ( \"null\" ) ref3 = ps . ActionReference () idActn = app . charIDToTypeID ( \"Actn\" ) ref3 . putName ( idActn , \"Sepia Toning (layer)\" ) idASet = app . charIDToTypeID ( \"ASet\" ) ref3 . PutName ( idASet , \"Default Actions\" ) desc8 . putReference ( idnull , ref3 ) app . executeAction ( idPly , desc8 , ps . DialogModes . DisplayNoDialogs ) # Create solid color fill layer. idMk = app . charIDToTypeID ( \"Mk \" ) desc21 = ps . ActionDescriptor () idNull = app . charIDToTypeID ( \"null\" ) ref12 = ps . ActionReference () idContentLayer1 = app . stringIDToTypeID ( \"contentLayer\" ) ref12 . putClass ( idContentLayer1 ) desc21 . putReference ( idNull , ref12 ) idUsng = app . charIDToTypeID ( \"Usng\" ) desc22 = ps . ActionDescriptor () idType = app . charIDToTypeID ( \"Type\" ) desc23 = ps . ActionDescriptor () idClr = app . charIDToTypeID ( \"Clr \" ) desc24 = ps . ActionDescriptor () idRd = app . charIDToTypeID ( \"Rd \" ) desc24 . putDouble ( idRd , index ) idGrn = app . charIDToTypeID ( \"Grn \" ) desc24 . putDouble ( idGrn , index ) idBl = app . charIDToTypeID ( \"Bl \" ) desc24 . putDouble ( idBl , index ) idRGBC = app . charIDToTypeID ( \"RGBC\" ) desc23 . putObject ( idClr , idRGBC , desc24 ) idSolidColorLayer = app . StringIDToTypeID ( \"solidColorLayer\" ) desc22 . putObject ( idType , idSolidColorLayer , desc23 ) idContentLayer2 = app . StringIDToTypeID ( \"contentLayer\" ) desc21 . putObject ( idUsng , idContentLayer2 , desc22 ) app . executeAction ( idMk , desc21 , ps . DialogModes . DisplayNoDialogs ) # Select mask. idSlct = app . charIDToTypeID ( \"slct\" ) desc38 = ps . ActionDescriptor () idNull1 = app . charIDToTypeID ( \"null\" ) ref20 = ps . ActionReference () idChnl1 = app . charIDToTypeID ( \"Chnl\" ) idChnl2 = app . charIDToTypeID ( \"Chnl\" ) idMsk = app . charIDToTypeID ( \"Msk \" ) ref20 . putEnumerated ( idChnl1 , idChnl2 , idMsk ) desc38 . putReference ( idNull1 , ref20 ) idMkVs = app . charIDToTypeID ( \"MkVs\" ) desc38 . putBoolean ( idMkVs , False ) app . executeAction ( idSlct , desc38 , ps . DialogModes . DisplayNoDialogs ) app . activeDocument . activeLayer . invert () Rotate Layer \"\"\"This scripts demonstrates how to rotate a layer 45 degrees clockwise. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/RotateLayer.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if len ( app . documents ) > 0 : print ( app . activeDocument . activeLayer . typename ) if not app . activeDocument . activeLayer . isBackgroundLayer : docRef = app . activeDocument layerRef = docRef . layers [ 0 ] layerRef . rotate ( 45.0 ) else : print ( \"Operation cannot be performed on background layer\" ) else : print ( \"You must have at least one open document to run this script!\" ) Trim \"\"\"A trim example.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () example_file = PSD_FILE [ \"trim.psd\" ] with Session ( example_file , action = \"open\" ) as ps : ps . active_document . trim ( ps . TrimType . TopLeftPixel , True , True , True , True ) Save As Pdf \"\"\"Save current active document as a PDF file.\"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as ps : option = ps . PDFSaveOptions ( jpegQuality = 12 , layers = True , view = True ) pdf = os . path . join ( mkdtemp (), \"test.pdf\" ) ps . active_document . saveAs ( pdf , option ) with Session () as ps : option = ps . PDFSaveOptions () option . jpegQuality = 12 option . layers = True option . view = True # opens the saved PDF in Acrobat. pdf = os . path . join ( mkdtemp (), \"test.pdf\" ) ps . active_document . saveAs ( pdf , option ) Color # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document # Add a solid color. textColor = ps . SolidColor () textColor . rgb . red = 255.0 textColor . rgb . green = 197 textColor . rgb . blue = 255 # Create empty layer. new_text_layer = doc . artLayers . add () # Set empty layer type to text layer new_text_layer . kind = ps . LayerKind . TextLayer # Set current text layer contents to \"Hello, World!\". new_text_layer . textItem . contents = \"Hello, World!\" # Change current text layer position. new_text_layer . textItem . position = [ 160 , 167 ] # Change current text layer text size. new_text_layer . textItem . size = 36 # Change current text layer color. new_text_layer . textItem . color = textColor assert new_text_layer . textItem . color . rgb . red == textColor . rgb . red Operate Channels \"\"\"A examples to show you how to operate active document channels.\"\"\" # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document print ( len ( doc . channels )) doc . channels . add () doc . channels . removeAll () channel = doc . channels . getByName ( \"Red\" ) print ( channel . name ) channel . remove () Enable Generator \"\"\"Enable Generator features.\"\"\" # Import local modules from photoshop import Session with Session () as ps : plugin_name = \"generator-assets-dummy-menu\" generatorDesc = ps . ActionDescriptor generatorDesc . putString ( ps . app . stringIDToTypeID ( \"name\" ), plugin_name ) ps . app . executeAction ( ps . app . stringIDToTypeID ( \"generateAssets\" ), generatorDesc ) Copy And Paste \"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/CopyAndPaste.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () startRulerUnits = app . preferences . rulerUnits app . preferences . rulerUnits = ps . Units . Inches doc = app . documents . add ( 7 , 5 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . White ) # Make sure the active layer is not a text layer, which cannot be copied to the # clipboard. if doc . activeLayer . kind != ps . LayerKind . TextLayer : # Select the left half of the document. Selections are always expressed # in pixels regardless of the current ruler unit type, so we're computing # the selection corner points based on the inch unit width and height # of the document x2 = ( doc . width * doc . resolution ) / 2 y2 = doc . height * doc . resolution sel_area = (( 0 , 0 ), ( x2 , 0 ), ( x2 , y2 ), ( 0 , y2 )) doc . selection . select ( sel_area , ps . SelectionType . ReplaceSelection , 0 , False ) doc . selection . copy () # The new doc is created # need to change ruler units to pixels because x2 and y2 are pixel units. app . preferences . rulerUnits = ps . Units . Pixels pasteDoc = app . documents . add ( x2 , y2 , doc . resolution , \"Paste Target\" ) pasteDoc . paste () else : print ( \"You cannot copy from a text layer\" ) if startRulerUnits != app . preferences . rulerUnits : app . preferences . rulerUnits = startRulerUnits Apply Crystallize Filter Action \"\"\" This script demonstrates how you can use the action manager to execute the Crystallize filter. In order to find all the IDs, see https://helpx.adobe.com/photoshop/kb/downloadable-plugins-and-content.html#ScriptingListenerplugin # noqa: E501 This blog here explains what a script listener is http://blogs.adobe.com/crawlspace/2006/05/installing_and_1.html References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ApplyCrystallizeFilterAction.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () with Session ( PSD_FILE [ \"layer_comps.psd\" ], \"open\" ) as ps : active_document = ps . active_document nLayerSets = active_document . layerSets print ( f \"The total amount of current layerSet (Group) is \" f \" { len ( nLayerSets ) } .\" ) nArtLayers = active_document . layerSets . item ( len ( nLayerSets )) . artLayers # get the last layer in LayerSets active_document . activeLayer = active_document . layerSets . item ( len ( nLayerSets )) . artLayers . item ( len ( nArtLayers )) def applyCrystallize ( cellSize ): cellSizeID = ps . app . CharIDToTypeID ( \"ClSz\" ) eventCrystallizeID = ps . app . CharIDToTypeID ( \"Crst\" ) filterDescriptor = ps . ActionDescriptor filterDescriptor . putInteger ( cellSizeID , cellSize ) ps . app . executeAction ( eventCrystallizeID , filterDescriptor ) applyCrystallize ( 25 ) print ( \"Apply crystallize done.\" ) Eval Javascript # Import local modules import photoshop.api as ps app = ps . Application () jsx = r \"\"\" var doc = app.activeDocument; var orig_name = doc.name; alert(orig_name); \"\"\" app . doJavaScript ( jsx ) # Print name of current active document. print ( app . doJavaScript ( \"app.activeDocument.name\" )) Do Photoshop Action \"\"\"Do a photoshop action.\"\"\" # Import local modules from photoshop import Session with Session () as api : api . app . doAction ( action = \"Frame Channel - 50 pixel\" )","title":"Examples"},{"location":"examples/#examples","text":"","title":"Examples"},{"location":"examples/#get-document-by-name","text":"\"\"\"Get document by document name from documents.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () slate_template = PSD_FILE [ \"slate_template.psd\" ] with Session ( slate_template , action = \"open\" , auto_close = True ) as ps : for doc in ps . app . documents : print ( doc . name ) print ( ps . app . documents . getByName ( \"slate_template.psd\" ) . fullName )","title":"Get Document By Name"},{"location":"examples/#open-psd","text":"# Import local modules from photoshop import Session import photoshop.api as ps # style 1 app = ps . Application () app . load ( \"your/psd/or/psb/file_path.psd\" ) # style 2 with Session ( \"your/psd/or/psb/file_path.psd\" , action = \"open\" ) as ps : ps . echo ( ps . active_document . name )","title":"Open Psd"},{"location":"examples/#session-new-document","text":"\"\"\"Action for create new document and print new document name.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : ps . echo ( ps . active_document . name )","title":"Session New Document"},{"location":"examples/#current-tool","text":"# Import local modules from photoshop import Session with Session () as ps : # Print the current tool. ps . echo ( ps . app . currentTool ) # Set current tool to `typeCreateOrEditTool`. ps . app . currentTool = \"typeCreateOrEditTool\"","title":"Current Tool"},{"location":"examples/#run-batch","text":"# Import built-in modules import os # Import local modules from photoshop import Session root = \"your/images/root\" files = [] for name in os . listdir ( root ): files . append ( os . path . join ( root , name )) with Session () as api : options = api . BatchOptions () options . destination = 3 options . destinationFolder = \"c: \\\\ test\" api . app . batch ( files = files , actionName = \"Quadrant Colors\" , actionSet = \"Default Actions\" , options = options )","title":"Run Batch"},{"location":"examples/#move-to-end","text":"# Import local modules import photoshop.api as ps # Get photoshop instance. app = ps . Application () # Add new document and set name to \"Example for move to End.\" active_document = app . documents . add ( name = \"Example for move to End.\" ) # Add a new layer set. group_layer = active_document . layerSets . add () # Add a layer in the group. layer = group_layer . artLayers . add () layer . name = \"This is a child layer.\" # Add a new layer in this active document top. top_layer = active_document . artLayers . add () top_layer . name = \"This is a top layer.\" top_layer . moveToEnd ( group_layer )","title":"Move To End"},{"location":"examples/#creating-a-layer","text":"\"\"\" Let's get the current document and create a new layer \"Background\" and fill it with red color. In order to use the Fill tool we will first select the entire layer and then fill it with a color. \"\"\" # Import local modules from photoshop import Session with Session () as ps : document = ps . active_document # Create color object of color red. fillColor = ps . SolidColor () fillColor . rgb . red = 222 fillColor . rgb . green = 0 fillColor . rgb . blue = 0 # Add a new layer called Background. layer = document . artLayers . add () layer . name = \"Background\" # Select the entire layer. document . selection . selectAll () # Fill the selection with color. document . selection . fill ( fillColor ) # Deselect. document . selection . deselect ()","title":"Creating A Layer"},{"location":"examples/#active-layer","text":"# Set the active layer to the last art layer of the active document, or the # first if the last is already active. # Import local modules from photoshop import Session with Session () as ps : if len ( ps . app . documents ) < 1 : docRef = ps . app . documents . add () else : docRef = ps . app . activeDocument if len ( docRef . layers ) < 2 : docRef . artLayers . add () ps . echo ( docRef . activeLayer . name ) new_layer = docRef . artLayers . add () ps . echo ( new_layer . name ) new_layer . name = \"test\"","title":"Active Layer"},{"location":"examples/#convert-smartobject-to-layer","text":"\"\"\"Convert Smart object to artLayer.\"\"\" # Import local modules from photoshop import Session # example 1 with Session () as ps : js = \"\"\" var idplacedLayerConvertToLayers = stringIDToTypeID( \"placedLayerConvertToLayers\" ); executeAction( idplacedLayerConvertToLayers, undefined, DialogModes.NO ); \"\"\" ps . app . doJavaScript ( js ) # example 2 with Session () as ps : descriptor = ps . ActionDescriptor idplacedLayerConvertToLayers = ps . app . stringIDToTypeID ( \"placedLayerConvertToLayers\" ) ps . app . executeAction ( idplacedLayerConvertToLayers , descriptor )","title":"Convert Smartobject To Layer"},{"location":"examples/#export-document","text":"# Import built-in modules import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () if __name__ == \"__main__\" : psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" , auto_close = True ) as ps : opts = ps . ExportOptionsSaveForWeb () png_file = os . path . join ( mkdtemp (), \"test.png\" ) active_document = ps . app . activeDocument active_document . exportDocument ( png_file , ps . ExportType . SaveForWeb , opts ) os . startfile ( png_file )","title":"Export Document"},{"location":"examples/#add-metadata","text":"\"\"\"Add metadata to current active document.\"\"\" # Import built-in modules import os # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document doc . info . author = os . getenv ( \"USERNAME\" ) doc . info . provinceState = \"Beijing\" doc . info . title = \"My Demo\" print ( \"Print all metadata of current active document.\" ) ps . echo ( doc . info )","title":"Add Metadata"},{"location":"examples/#create-thumbnail","text":"\"\"\"Create a thumbnail image for currently active document. You can use the thumbnail image to upload to Shotgun or Ftrack. \"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session def create_thumbnail ( output_path = None , max_resolution = 512 ): \"\"\"Create a thumbnail image for currently active document. Args: output_path (str): The absolute output path of the thumbnail image. The default is to output to a temporary folder. max_resolution (int): The max resolution of the thumbnail. The default is `512`. Returns: str: The absolute output path of the thumbnail image. \"\"\" output_path = output_path or os . path . join ( mkdtemp (), \"thumb.jpg\" ) with Session ( auto_close = True ) as ps : orig_name = ps . active_document . name width_str = ps . active_document . width height_str = ps . active_document . height thumb_name = f \" { orig_name } _thumb\" max_resolution = width_str / max_resolution thumb_width = int ( width_str / max_resolution ) thumb_height = int ( height_str / max_resolution ) thumb_doc = ps . active_document . duplicate ( thumb_name ) thumb_doc . resizeImage ( thumb_width , thumb_height - 100 ) thumb_doc . saveAs ( output_path , ps . JPEGSaveOptions (), asCopy = True ) thumb_doc . close () return output_path if __name__ == \"__main__\" : thumb_file = create_thumbnail () print ( f \"Save thumbnail file to { thumb_file } .\" )","title":"Create Thumbnail"},{"location":"examples/#session-smart-sharpen","text":"\"\"\"This script demonstrates how you can use the action manager to execute the Emboss filter. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SmartSharpen.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"layer_comps.psd\" ] with Session ( file_path , action = \"open\" ) as ps : def SmartSharpen ( inAmount , inRadius , inNoise ): idsmart_sharpen_id = ps . app . stringIDToTypeID ( ps . EventID . SmartSharpen ) desc37 = ps . ActionDescriptor () idpresetKind = ps . app . stringIDToTypeID ( ps . EventID . PresetKind ) idpresetKindType = ps . app . stringIDToTypeID ( ps . EventID . PresetKindType ) idpresetKindCustom = ps . app . stringIDToTypeID ( ps . EventID . PresetKindCustom ) desc37 . putEnumerated ( idpresetKind , idpresetKindType , idpresetKindCustom ) idAmnt = ps . app . charIDToTypeID ( \"Amnt\" ) idPrc = ps . app . charIDToTypeID ( \"Rds \" ) desc37 . putUnitDouble ( idAmnt , idPrc , inAmount ) idRds = ps . app . charIDToTypeID ( \"Rds \" ) idPxl = ps . app . charIDToTypeID ( \"#Pxl\" ) desc37 . putUnitDouble ( idRds , idPxl , inRadius ) idnoiseReduction = ps . app . stringIDToTypeID ( \"noiseReduction\" ) idPrc = ps . app . charIDToTypeID ( \"#Prc\" ) desc37 . putUnitDouble ( idnoiseReduction , idPrc , inNoise ) idblur = ps . app . charIDToTypeID ( \"blur\" ) idblurType = ps . app . stringIDToTypeID ( \"blurType\" ) idGsnB = ps . app . charIDToTypeID ( \"GsnB\" ) desc37 . putEnumerated ( idblur , idblurType , idGsnB ) ps . app . ExecuteAction ( idsmart_sharpen_id , desc37 ) docRef = ps . active_document nlayerSets = docRef . layerSets nArtLayers = docRef . layerSets . item ( nlayerSets . length ) docRef . activeLayer = nArtLayers . artLayers . item ( nArtLayers . artLayers . length ) SmartSharpen ( 300 , 2.0 , 20 )","title":"Session Smart Sharpen"},{"location":"examples/#load-selection","text":"# This script will demonstrate how to load a selection from a saved alpha # channel. # Import local modules from photoshop import Session with Session () as ps : doc_ref = ps . app . documents . add ( 320 , 240 ) start_ruler_units = ps . app . preferences . rulerUnits if start_ruler_units is not ps . Units . Pixels : ps . app . Preferences . RulerUnits = ps . Units . Pixels # Save a rectangular selection area offset by 50 pixels from the image # border into an alpha channel. offset = 50 selBounds1 = ( ( offset , offset ), ( doc_ref . Width - offset , offset ), ( doc_ref . Width - offset , doc_ref . Height - offset ), ( offset , doc_ref . Height - offset ), ) doc_ref . selection . select ( selBounds1 ) selAlpha = doc_ref . channels . Add () doc_ref . selection . store ( selAlpha ) # Now create a second wider but less tall selection. selBounds2 = (( 0 , 75 ), ( doc_ref . Width , 75 ), ( doc_ref . Width , 150 ), ( 0 , 150 )) doc_ref . selection . select ( selBounds2 ) # Load the selection from the just saved alpha channel, combining it with # the active selection. doc_ref . selection . load ( selAlpha , ps . SelectionType . ExtendSelection , False ) # Set ruler back to where it was. ps . app . Preferences . RulerUnits = start_ruler_units","title":"Load Selection"},{"location":"examples/#photoshop-session","text":"\"\"\"Add slate information dynamically.\"\"\" # Import built-in modules from datetime import datetime import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"slate_template.psd\" ] with Session ( file_path , action = \"open\" , auto_close = True ) as ps : layer_set = ps . active_document . layerSets . getByName ( \"template\" ) data = { \"project name\" : \"test_project\" , \"datetime\" : datetime . today () . strftime ( \"%Y-%m- %d \" ), } for layer in layer_set . layers : if layer . kind == ps . LayerKind . TextLayer : layer . textItem . contents = data [ layer . textItem . contents . strip ()] jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"slate.jpg\" ) ps . active_document . saveAs ( jpg_file , ps . JPEGSaveOptions ()) os . startfile ( jpg_file )","title":"Photoshop Session"},{"location":"examples/#apply-filters","text":"\"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ApplyFilters.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules # selections in the open document. import photoshop.api as ps PSD_FILE = psd . get_psd_files () # Start up Photoshop application app = ps . Application () # We don't want any Photoshop dialogs displayed during automated execution app . displayDialogs = ps . DialogModes . DisplayNoDialogs psPixels = 1 start_ruler_units = app . preferences . rulerUnits if start_ruler_units is not psPixels : app . preferences . rulerUnits = psPixels fileName = PSD_FILE [ \"layer_comps.psd\" ] docRef = app . open ( fileName ) nLayerSets = len ( list (( i , x ) for i , x in enumerate ( docRef . layerSets ))) - 1 nArtLayers = len ( list (( i , x ) for i , x in enumerate ( docRef . layerSets [ nLayerSets ] . artLayers )), ) active_layer = docRef . activeLayer = docRef . layerSets [ nLayerSets ] . artLayers [ nArtLayers ] sel_area = (( 0 , 212 ), ( 300 , 212 ), ( 300 , 300 ), ( 0 , 300 )) docRef . selection . select ( sel_area , ps . SelectionType . ReplaceSelection , 20 , True ) print ( f \"Current active layer: { active_layer . name } \" ) active_layer . applyAddNoise ( 15 , ps . NoiseDistribution . GaussianNoise , False ) backColor = ps . SolidColor () backColor . hsb . hue = 0 backColor . hsb . saturation = 0 backColor . hsb . brightness = 100 app . backgroundColor = backColor sel_area2 = (( 120 , 20 ), ( 210 , 20 ), ( 210 , 110 ), ( 120 , 110 )) docRef . selection . select ( sel_area2 , ps . SelectionType . ReplaceSelection , 25 , False ) active_layer . applyDiffuseGlow ( 9 , 12 , 15 ) active_layer . applyGlassEffect ( 7 , 3 , 7 , False , ps . TextureType . TinyLensTexture , None , ) docRef . selection . deselect () # Set ruler units back the way we found it. if start_ruler_units is not psPixels : app . Preferences . RulerUnits = start_ruler_units","title":"Apply Filters"},{"location":"examples/#operate-layer-set","text":"\"\"\"A examples to show you how to operate layerSet.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : docRef = ps . active_document # Add a new layerSet. new_layer_set = docRef . layerSets . add () # Print the layerSet count. ps . echo ( docRef . layerSets . length ) ps . echo ( len ( docRef . layerSets )) # Rename the layerSet. docRef . layerSets [ 0 ] . name = \"New Name\" ps . echo ( new_layer_set . name ) # Change the layerSet opacity new_layer_set . opacity = 90 ps . echo ( new_layer_set . opacity ) # Duplicate the layerSet. duplicate_layer_set = new_layer_set . duplicate () # Add a new artLayer in current active document. layer = docRef . artLayers . add () # Move the artLayer under the duplicate layerSet. layer . move ( duplicate_layer_set , ps . ElementPlacement . PlaceInside ) # Merge the layerSet. merged_layer = duplicate_layer_set . merge () ps . echo ( merged_layer . name ) # Set visible. new_layer_set . visible = False merged_layer . remove ()","title":"Operate Layer Set"},{"location":"examples/#selection-stroke","text":"\"\"\"Create a stroke around the current selection, Set the stroke color and width of the new stroke. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SelectionStroke.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if len ( list (( i , x ) for i , x in enumerate ( app . documents , 1 ))) > 0 : if not app . activeDocument . activeLayer . isBackgroundLayer : psPixels = 1 start_ruler_units = app . Preferences . RulerUnits app . preferences . rulerUnits = ps . Units . Pixels selRef = app . activeDocument . selection offset = 10 selBounds = ( ( offset , offset ), ( app . activeDocument . width - offset , offset ), ( app . activeDocument . width - offset , app . activeDocument . height - offset ), ( offset , app . activeDocument . height - offset ), ) selRef . select ( selBounds ) selRef . selectBorder ( 5 ) # create text color properties strokeColor = ps . SolidColor () strokeColor . cmyk . cyan = 58 strokeColor . cmyk . magenta = 0 strokeColor . cmyk . yellow = 70 strokeColor . cmyk . black = 0 app . displayDialogs = ps . DialogModes . DisplayNoDialogs selRef . stroke ( strokeColor , 2 , ps . StrokeLocation . OutsideStroke , ps . ColorBlendMode . ColorBlendMode , 75 , True , ) # Set ruler units back the way we found it. app . preferences . rulerUnits = start_ruler_units else : print ( \"Operation cannot be performed on background layer\" ) else : print ( \"Create a document with an active selection before running this \" \"script!\" )","title":"Selection Stroke"},{"location":"examples/#cropping","text":"\"\"\"A cropping example.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : ps . active_document . crop ( bounds = [ 100 , 12 , 354 , 246 ], width = 1920 , height = 1080 )","title":"Cropping"},{"location":"examples/#create-new-document","text":"\"\"\"Create a new document.\"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . preferences . rulerUnits = ps . Units . Pixels ps . app . documents . add ( 1920 , 1080 , name = \"my_new_document\" )","title":"Create New Document"},{"location":"examples/#replace-images","text":"\"\"\"Replace the image of the current active layer with a new image.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () with Session ( PSD_FILE [ \"replace_images.psd\" ], action = \"open\" ) as ps : active_layer = ps . active_document . activeLayer bounds = active_layer . bounds print ( f \"current layer { active_layer . name } : { bounds } \" ) input_file = PSD_FILE [ \"red_100x200.png\" ] replace_contents = ps . app . stringIDToTypeID ( \"placedLayerReplaceContents\" ) desc = ps . ActionDescriptor idnull = ps . app . charIDToTypeID ( \"null\" ) desc . putPath ( idnull , input_file ) ps . app . executeAction ( replace_contents , desc ) # replaced image. active_layer = ps . active_document . activeLayer current_bounds = active_layer . bounds width = bounds [ 2 ] - bounds [ 0 ] height = bounds [ 3 ] - bounds [ 1 ] current_width = current_bounds [ 2 ] - current_bounds [ 0 ] current_height = current_bounds [ 3 ] - current_bounds [ 1 ] new_size = width / current_width * 100 active_layer . resize ( new_size , new_size , ps . AnchorPosition . MiddleCenter ) print ( f \"current layer { active_layer . name } : { current_bounds } \" )","title":"Replace Images"},{"location":"examples/#link-layer","text":"# Import local modules import photoshop.api as ps app = ps . Application () start_ruler_units = app . preferences . rulerUnits if len ( app . documents ) < 1 : if start_ruler_units is not ps . Units . Pixels : app . preferences . rulerUnits = ps . Units . Pixels docRef = app . documents . add ( 320 , 240 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . BackgroundColor , ) else : docRef = app . activeDocument layerRef = docRef . artLayers . add () layerRef2 = docRef . artLayers . add () layerRef . link ( layerRef2 ) # Set the ruler back to where it was app . preferences . rulerUnits = start_ruler_units","title":"Link Layer"},{"location":"examples/#fill-selection","text":"# Fill the current selection with an RGB color. # Import local modules from photoshop import Session with Session () as ps : start_ruler_units = ps . app . Preferences . RulerUnits if len ( ps . app . documents ) < 1 : if start_ruler_units is not ps . Units . Pixels : ps . app . Preferences . RulerUnits = ps . Units . Pixels docRef = ps . app . documents . add ( 320 , 240 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . White ) docRef . artLayers . add () ps . app . preferences . rulerUnits = start_ruler_units if not ps . active_document . activeLayer . isBackgroundLayer : selRef = ps . active_document . selection fillcolor = ps . SolidColor () fillcolor . rgb . red = 225 fillcolor . rgb . green = 0 fillcolor . rgb . blue = 0 selRef . fill ( fillcolor , ps . ColorBlendMode . NormalBlendColor , 25 , False ) else : ps . echo ( \"Can't perform operation on background layer.\" )","title":"Fill Selection"},{"location":"examples/#change-color-of-background-and-foreground","text":"\"\"\"Change the color of the background and foreground.\"\"\" # Import local modules from photoshop import Session with Session () as ps : foregroundColor = ps . SolidColor () foregroundColor . rgb . red = 255 foregroundColor . rgb . green = 0 foregroundColor . rgb . blue = 0 ps . app . foregroundColor = foregroundColor backgroundColor = ps . SolidColor () backgroundColor . rgb . red = 0 backgroundColor . rgb . green = 0 backgroundColor . rgb . blue = 0 ps . app . backgroundColor = backgroundColor","title":"Change Color Of Background And Foreground"},{"location":"examples/#add-slate","text":"\"\"\"Add slate information dynamically. - Open template. - Update info. - Save as jpg. - Close current document. \"\"\" # Import built-in modules from datetime import datetime import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () slate_template = PSD_FILE [ \"slate_template.psd\" ] with Session ( slate_template , action = \"open\" , auto_close = True ) as ps : layer_set = ps . active_document . layerSets . getByName ( \"template\" ) data = { \"project name\" : \"test_project\" , \"datetime\" : datetime . today () . strftime ( \"%Y-%m- %d \" ), } for layer in layer_set . layers : if layer . kind == ps . LayerKind . TextLayer : layer . textItem . contents = data [ layer . textItem . contents . strip ()] jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"slate.jpg\" ) ps . active_document . saveAs ( jpg_file , ps . JPEGSaveOptions ()) print ( f \"Save jpg to { jpg_file } \" ) os . startfile ( jpg_file )","title":"Add Slate"},{"location":"examples/#new-document","text":"# Create a new Photoshop document with diminsions 4 inches by 4 inches. # Import local modules import photoshop.api as ps # Start up Photoshop application app = ps . Application () start_ruler_units = app . preferences . rulerUnits app . preferences . rulerUnits = ps . Units . Pixels # Create the document docRef = app . documents . add ( 1920 , 1080 , 72.0 , \"My New Document\" ) # Make sure to set the ruler units prior to creating the document. app . preferences . rulerUnits = start_ruler_units","title":"New Document"},{"location":"examples/#export-layers-as-png","text":"\"\"\"Export every layer as a .png file.\"\"\" # Import built-in modules import os # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () def hide_all_layers ( layers ): for layer in layers : layer . visible = False def main (): psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" ) as ps : doc = ps . active_document options = ps . PNGSaveOptions () options . compression = 1 layers = doc . artLayers for layer in layers : hide_all_layers ( layers ) layer . visible = True layer_path = os . path . join ( doc . path , layer . name ) print ( layer_path ) if not os . path . exists ( layer_path ): os . makedirs ( layer_path ) image_path = os . path . join ( layer_path , f \" { layer . name } .png\" ) doc . saveAs ( image_path , options = options , asCopy = True ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) if __name__ == \"__main__\" : main ()","title":"Export Layers As Png"},{"location":"examples/#import-image-as-layer","text":"\"\"\"Import a image as a artLayer.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : desc = ps . ActionDescriptor desc . putPath ( ps . app . charIDToTypeID ( \"null\" ), \"your/image/path\" ) event_id = ps . app . charIDToTypeID ( \"Plc \" ) # `Plc` need one space in here. ps . app . executeAction ( ps . app . charIDToTypeID ( \"Plc \" ), desc )","title":"Import Image As Layer"},{"location":"examples/#list-documents","text":"\"\"\"List current photoshop all documents.\"\"\" # Import local modules import photoshop.api as ps app = ps . Application () doc = app . documents [ 0 ] print ( doc . name ) for doc in app . documents : print ( doc . name )","title":"List Documents"},{"location":"examples/#export-layers-use-export-options-saveforweb","text":"\"\"\"Export every layer as a .png file use `ExportOptionsSaveForWeb`.\"\"\" # Import built-in modules import os # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () def hide_all_layers ( layers ): for layer in layers : layer . visible = False def main (): psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" ) as ps : doc = ps . active_document options = ps . ExportOptionsSaveForWeb () layers = doc . artLayers for layer in layers : hide_all_layers ( layers ) layer . visible = True layer_path = os . path . join ( doc . path , layer . name ) print ( layer_path ) if not os . path . exists ( layer_path ): os . makedirs ( layer_path ) image_path = os . path . join ( layer_path , f \" { layer . name } .png\" ) doc . exportDocument ( image_path , exportAs = ps . ExportType . SaveForWeb , options = options ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) if __name__ == \"__main__\" : main ()","title":"Export Layers Use Export Options Saveforweb"},{"location":"examples/#add-start-application-event","text":"\"\"\"Add event for Photoshop start application. In the current example, every time we start photoshop it will alert \"Start Application Event\". Just like you manually in Script> Script Events Manager to enable the event. \"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as ps : root = mkdtemp () jsx_file = os . path . join ( root , \"event.jsx\" ) with open ( jsx_file , \"w\" ) as f : f . write ( 'alert(\"Start Application event.\")' ) ps . app . notifiers . add ( ps . EventID . Notify , jsx_file ) print ( \"Add event done.\" )","title":"Add Start Application Event"},{"location":"examples/#session-document-duplicate","text":"\"\"\"Action for duplicate current active document.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"document_duplicate\" ) as ps : ps . echo ( ps . active_document . name )","title":"Session Document Duplicate"},{"location":"examples/#save-to-psd","text":"\"\"\"Save your current active document as a .psd file.\"\"\" # Import local modules from photoshop import Session with Session () as ps : psd_file = \"your/psd/save/file/path.psd\" doc = ps . active_document options = ps . PhotoshopSaveOptions () layers = doc . artLayers doc . saveAs ( psd_file , options , True ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer )","title":"Save To Psd"},{"location":"examples/#set-active-layer","text":"\"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ActiveLayer.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if app . documents . length < 1 : docRef = app . documents . add () else : docRef = app . activeDocument if docRef . layers . length < 2 : docRef . artLayers . add () activeLayerName = docRef . activeLayer . name if docRef . activeLayer . name != docRef . layers . item ( docRef . layers . length ) . name : docRef . activeLayer = docRef . layers . item ( docRef . layers . length ) else : docRef . activeLayer = docRef . layers . item ( 1 )","title":"Set Active Layer"},{"location":"examples/#smart-sharpen","text":"\"\"\"This script demonstrates how you can use the action manager to execute the Emboss filter. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SmartSharpen.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules import photoshop.api as ps app = ps . Application () PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"layer_comps.psd\" ] docRef = app . open ( file_path ) nlayerSets = docRef . layerSets nArtLayers = docRef . layerSets . item ( nlayerSets . length ) docRef . activeLayer = nArtLayers . artLayers . item ( nArtLayers . artLayers . length ) def SmartSharpen ( inAmount , inRadius , inNoise ): idsmart_sharpen_id = app . stringIDToTypeID ( ps . EventID . SmartSharpen ) desc37 = ps . ActionDescriptor () idpresetKind = app . stringIDToTypeID ( ps . EventID . PresetKind ) idpresetKindType = app . stringIDToTypeID ( ps . EventID . PresetKindType ) idpresetKindCustom = app . stringIDToTypeID ( ps . EventID . PresetKindCustom ) desc37 . putEnumerated ( idpresetKind , idpresetKindType , idpresetKindCustom ) idAmnt = app . charIDToTypeID ( \"Amnt\" ) idPrc = app . charIDToTypeID ( \"Rds \" ) desc37 . putUnitDouble ( idAmnt , idPrc , inAmount ) idRds = app . charIDToTypeID ( \"Rds \" ) idPxl = app . charIDToTypeID ( \"#Pxl\" ) desc37 . putUnitDouble ( idRds , idPxl , inRadius ) idnoiseReduction = app . stringIDToTypeID ( \"noiseReduction\" ) idPrc = app . charIDToTypeID ( \"#Prc\" ) desc37 . putUnitDouble ( idnoiseReduction , idPrc , inNoise ) idblur = app . charIDToTypeID ( \"blur\" ) idblurType = app . stringIDToTypeID ( \"blurType\" ) idGsnB = app . charIDToTypeID ( \"GsnB\" ) desc37 . putEnumerated ( idblur , idblurType , idGsnB ) app . ExecuteAction ( idsmart_sharpen_id , desc37 ) SmartSharpen ( 300 , 2.0 , 20 )","title":"Smart Sharpen"},{"location":"examples/#revert-changes","text":"\"\"\"This example demonstrates how to roll back history.\"\"\" # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document old_state = doc . activeHistoryState print ( old_state . name ) doc . artLayers . add () last_state = doc . activeHistoryState print ( last_state . name ) doc . activeHistoryState = old_state print ( doc . activeHistoryState . name )","title":"Revert Changes"},{"location":"examples/#toggle-proof-colors","text":"\"\"\"Toggle the proof color. Like operating in the menu: **View** > **Proof Colors** (Ctrl + Y) \"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . runMenuItem ( ps . app . stringIDToTypeID ( \"toggleProofColors\" ))","title":"Toggle Proof Colors"},{"location":"examples/#fit-on-screen","text":"\"\"\"Let the current document Fit on screen.\"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . runMenuItem ( ps . app . charIDToTypeID ( \"FtOn\" ))","title":"Fit On Screen"},{"location":"examples/#session-callback","text":"# Import local modules from photoshop import Session def do_something ( photoshop_api ): print ( photoshop_api . active_document ) print ( \"Do something.\" ) with Session ( callback = do_something ) as ps : ps . echo ( ps . active_document . name ) ps . alert ( ps . active_document . name )","title":"Session Callback"},{"location":"examples/#session-hello-world","text":"\"\"\"Add slate information dynamically.\"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as adobe : doc = adobe . app . documents . add ( 2000 , 2000 ) text_color = adobe . SolidColor () text_color . rgb . red = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = adobe . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = adobe . JPEGSaveOptions ( quality = 1 ) jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"hello_world.jpg\" ) doc . saveAs ( jpg_file , options , asCopy = True ) adobe . app . doJavaScript ( f 'alert(\"save to jpg: { jpg_file } \")' )","title":"Session Hello World"},{"location":"examples/#get-layer-by-name","text":"# Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" , auto_close = True ) as ps : art_layer = ps . active_document . artLayers . getByName ( \"blue\" ) assert art_layer . name == \"blue\"","title":"Get Layer By Name"},{"location":"examples/#save-as-tga","text":"# Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 text_color . rgb . red = 0 text_color . rgb . blue = 0 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color tga_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"test.tga\" ) doc . saveAs ( tga_file , ps . TargaSaveOptions (), asCopy = True ) os . startfile ( tga_file )","title":"Save As Tga"},{"location":"examples/#compare-colors","text":"\"\"\"Check whether the foreground is equal to the background color. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/CompareColors.py \"\"\" # Import local modules from photoshop import Session with Session () as ps : if ps . app . foregroundColor . isEqual ( ps . app . backgroundColor ): ps . echo ( \"They're Equal.\" ) else : ps . echo ( \"NOT Equal.\" )","title":"Compare Colors"},{"location":"examples/#hello-world","text":"# Import built-in modules import os from tempfile import mkdtemp # Import local modules import photoshop.api as ps def hello_world (): app = ps . Application () doc = app . documents . add () text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"hello_world.jpg\" ) doc . saveAs ( jpg_file , options , asCopy = True ) os . startfile ( jpg_file ) if __name__ == \"__main__\" : hello_world ()","title":"Hello World"},{"location":"examples/#emboss-action","text":"# Import local modules from photoshop import Session with Session () as ps : app = ps . app for index , x in enumerate ( range ( 50 )): # Execute an existing action from action palette. idPly = app . charIDToTypeID ( \"Ply \" ) desc8 = ps . ActionDescriptor () idnull = app . charIDToTypeID ( \"null\" ) ref3 = ps . ActionReference () idActn = app . charIDToTypeID ( \"Actn\" ) ref3 . putName ( idActn , \"Sepia Toning (layer)\" ) idASet = app . charIDToTypeID ( \"ASet\" ) ref3 . PutName ( idASet , \"Default Actions\" ) desc8 . putReference ( idnull , ref3 ) app . executeAction ( idPly , desc8 , ps . DialogModes . DisplayNoDialogs ) # Create solid color fill layer. idMk = app . charIDToTypeID ( \"Mk \" ) desc21 = ps . ActionDescriptor () idNull = app . charIDToTypeID ( \"null\" ) ref12 = ps . ActionReference () idContentLayer1 = app . stringIDToTypeID ( \"contentLayer\" ) ref12 . putClass ( idContentLayer1 ) desc21 . putReference ( idNull , ref12 ) idUsng = app . charIDToTypeID ( \"Usng\" ) desc22 = ps . ActionDescriptor () idType = app . charIDToTypeID ( \"Type\" ) desc23 = ps . ActionDescriptor () idClr = app . charIDToTypeID ( \"Clr \" ) desc24 = ps . ActionDescriptor () idRd = app . charIDToTypeID ( \"Rd \" ) desc24 . putDouble ( idRd , index ) idGrn = app . charIDToTypeID ( \"Grn \" ) desc24 . putDouble ( idGrn , index ) idBl = app . charIDToTypeID ( \"Bl \" ) desc24 . putDouble ( idBl , index ) idRGBC = app . charIDToTypeID ( \"RGBC\" ) desc23 . putObject ( idClr , idRGBC , desc24 ) idSolidColorLayer = app . StringIDToTypeID ( \"solidColorLayer\" ) desc22 . putObject ( idType , idSolidColorLayer , desc23 ) idContentLayer2 = app . StringIDToTypeID ( \"contentLayer\" ) desc21 . putObject ( idUsng , idContentLayer2 , desc22 ) app . executeAction ( idMk , desc21 , ps . DialogModes . DisplayNoDialogs ) # Select mask. idSlct = app . charIDToTypeID ( \"slct\" ) desc38 = ps . ActionDescriptor () idNull1 = app . charIDToTypeID ( \"null\" ) ref20 = ps . ActionReference () idChnl1 = app . charIDToTypeID ( \"Chnl\" ) idChnl2 = app . charIDToTypeID ( \"Chnl\" ) idMsk = app . charIDToTypeID ( \"Msk \" ) ref20 . putEnumerated ( idChnl1 , idChnl2 , idMsk ) desc38 . putReference ( idNull1 , ref20 ) idMkVs = app . charIDToTypeID ( \"MkVs\" ) desc38 . putBoolean ( idMkVs , False ) app . executeAction ( idSlct , desc38 , ps . DialogModes . DisplayNoDialogs ) app . activeDocument . activeLayer . invert ()","title":"Emboss Action"},{"location":"examples/#rotate-layer","text":"\"\"\"This scripts demonstrates how to rotate a layer 45 degrees clockwise. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/RotateLayer.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if len ( app . documents ) > 0 : print ( app . activeDocument . activeLayer . typename ) if not app . activeDocument . activeLayer . isBackgroundLayer : docRef = app . activeDocument layerRef = docRef . layers [ 0 ] layerRef . rotate ( 45.0 ) else : print ( \"Operation cannot be performed on background layer\" ) else : print ( \"You must have at least one open document to run this script!\" )","title":"Rotate Layer"},{"location":"examples/#trim","text":"\"\"\"A trim example.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () example_file = PSD_FILE [ \"trim.psd\" ] with Session ( example_file , action = \"open\" ) as ps : ps . active_document . trim ( ps . TrimType . TopLeftPixel , True , True , True , True )","title":"Trim"},{"location":"examples/#save-as-pdf","text":"\"\"\"Save current active document as a PDF file.\"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as ps : option = ps . PDFSaveOptions ( jpegQuality = 12 , layers = True , view = True ) pdf = os . path . join ( mkdtemp (), \"test.pdf\" ) ps . active_document . saveAs ( pdf , option ) with Session () as ps : option = ps . PDFSaveOptions () option . jpegQuality = 12 option . layers = True option . view = True # opens the saved PDF in Acrobat. pdf = os . path . join ( mkdtemp (), \"test.pdf\" ) ps . active_document . saveAs ( pdf , option )","title":"Save As Pdf"},{"location":"examples/#color","text":"# Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document # Add a solid color. textColor = ps . SolidColor () textColor . rgb . red = 255.0 textColor . rgb . green = 197 textColor . rgb . blue = 255 # Create empty layer. new_text_layer = doc . artLayers . add () # Set empty layer type to text layer new_text_layer . kind = ps . LayerKind . TextLayer # Set current text layer contents to \"Hello, World!\". new_text_layer . textItem . contents = \"Hello, World!\" # Change current text layer position. new_text_layer . textItem . position = [ 160 , 167 ] # Change current text layer text size. new_text_layer . textItem . size = 36 # Change current text layer color. new_text_layer . textItem . color = textColor assert new_text_layer . textItem . color . rgb . red == textColor . rgb . red","title":"Color"},{"location":"examples/#operate-channels","text":"\"\"\"A examples to show you how to operate active document channels.\"\"\" # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document print ( len ( doc . channels )) doc . channels . add () doc . channels . removeAll () channel = doc . channels . getByName ( \"Red\" ) print ( channel . name ) channel . remove ()","title":"Operate Channels"},{"location":"examples/#enable-generator","text":"\"\"\"Enable Generator features.\"\"\" # Import local modules from photoshop import Session with Session () as ps : plugin_name = \"generator-assets-dummy-menu\" generatorDesc = ps . ActionDescriptor generatorDesc . putString ( ps . app . stringIDToTypeID ( \"name\" ), plugin_name ) ps . app . executeAction ( ps . app . stringIDToTypeID ( \"generateAssets\" ), generatorDesc )","title":"Enable Generator"},{"location":"examples/#copy-and-paste","text":"\"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/CopyAndPaste.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () startRulerUnits = app . preferences . rulerUnits app . preferences . rulerUnits = ps . Units . Inches doc = app . documents . add ( 7 , 5 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . White ) # Make sure the active layer is not a text layer, which cannot be copied to the # clipboard. if doc . activeLayer . kind != ps . LayerKind . TextLayer : # Select the left half of the document. Selections are always expressed # in pixels regardless of the current ruler unit type, so we're computing # the selection corner points based on the inch unit width and height # of the document x2 = ( doc . width * doc . resolution ) / 2 y2 = doc . height * doc . resolution sel_area = (( 0 , 0 ), ( x2 , 0 ), ( x2 , y2 ), ( 0 , y2 )) doc . selection . select ( sel_area , ps . SelectionType . ReplaceSelection , 0 , False ) doc . selection . copy () # The new doc is created # need to change ruler units to pixels because x2 and y2 are pixel units. app . preferences . rulerUnits = ps . Units . Pixels pasteDoc = app . documents . add ( x2 , y2 , doc . resolution , \"Paste Target\" ) pasteDoc . paste () else : print ( \"You cannot copy from a text layer\" ) if startRulerUnits != app . preferences . rulerUnits : app . preferences . rulerUnits = startRulerUnits","title":"Copy And Paste"},{"location":"examples/#apply-crystallize-filter-action","text":"\"\"\" This script demonstrates how you can use the action manager to execute the Crystallize filter. In order to find all the IDs, see https://helpx.adobe.com/photoshop/kb/downloadable-plugins-and-content.html#ScriptingListenerplugin # noqa: E501 This blog here explains what a script listener is http://blogs.adobe.com/crawlspace/2006/05/installing_and_1.html References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ApplyCrystallizeFilterAction.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () with Session ( PSD_FILE [ \"layer_comps.psd\" ], \"open\" ) as ps : active_document = ps . active_document nLayerSets = active_document . layerSets print ( f \"The total amount of current layerSet (Group) is \" f \" { len ( nLayerSets ) } .\" ) nArtLayers = active_document . layerSets . item ( len ( nLayerSets )) . artLayers # get the last layer in LayerSets active_document . activeLayer = active_document . layerSets . item ( len ( nLayerSets )) . artLayers . item ( len ( nArtLayers )) def applyCrystallize ( cellSize ): cellSizeID = ps . app . CharIDToTypeID ( \"ClSz\" ) eventCrystallizeID = ps . app . CharIDToTypeID ( \"Crst\" ) filterDescriptor = ps . ActionDescriptor filterDescriptor . putInteger ( cellSizeID , cellSize ) ps . app . executeAction ( eventCrystallizeID , filterDescriptor ) applyCrystallize ( 25 ) print ( \"Apply crystallize done.\" )","title":"Apply Crystallize Filter Action"},{"location":"examples/#eval-javascript","text":"# Import local modules import photoshop.api as ps app = ps . Application () jsx = r \"\"\" var doc = app.activeDocument; var orig_name = doc.name; alert(orig_name); \"\"\" app . doJavaScript ( jsx ) # Print name of current active document. print ( app . doJavaScript ( \"app.activeDocument.name\" ))","title":"Eval Javascript"},{"location":"examples/#do-photoshop-action","text":"\"\"\"Do a photoshop action.\"\"\" # Import local modules from photoshop import Session with Session () as api : api . app . doAction ( action = \"Frame Channel - 50 pixel\" )","title":"Do Photoshop Action"},{"location":"reference/SUMMARY/","text":"photoshop api active_layer artlayer artlayers channel channels core document documentinfo documents layerComp layerComps layerSet layerSets layers measurement_log notifier notifiers preferences selection text_fonts action_descriptor action_list action_reference application batch_options colors cmyk gray hsb lab rgb constants enumerations errors event_id open_options eps save_options bmp eps gif jpg pdf png psd tag tif solid_color text_font text_item session","title":"SUMMARY"},{"location":"reference/photoshop/session/","text":"Provides a public session class for Photoshop api. Usually we only need to manipulate the currently active document of photoshop. So as follows: from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) ps . app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' ) Session Session of photoshop. We can control active documents in this Session. Attributes: Name Type Description app Application Application of Photoshop. ActionReference ActionReference ActionDescriptor ActionDescriptor Source code in photoshop/session.py 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 class Session : \"\"\"Session of photoshop. We can control active documents in this Session. Attributes: app: Application of Photoshop. ActionReference: ActionDescriptor: \"\"\" def __init__ ( self , file_path : str = None , action : str = None , callback : Any = None , auto_close : bool = False , ps_version : str = None , ): \"\"\"Session of Photoshop. Examples: ```python from photoshop import Session with Session(\"your/psd/or/psb/file_path.psd\", action=\"open\") as ps: ps.echo(ps.active_document.name) ``` Args: file_path: The absolute path of the file. This path can be used together with action. If the path is an existing ``psd` or image path, use ``open`` action to open this file in the current session. action: Name of the action. .e.g: - open Open the file from the option `file_path`. - new_document Create a new document. - document_duplicate Duplicate current active document. callback: The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. auto_close: Is it necessary to close the current document when exiting the current context session. The default is ``False`` not to exit current session. ps_version: Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 \"\"\" super () . __init__ () self . path = file_path self . _auto_close = auto_close self . _callback = callback self . _action = action self . _active_document = None self . app : Application = Application ( version = ps_version ) self . ActionReference : ActionReference = ActionReference () self . ActionDescriptor : ActionDescriptor = ActionDescriptor () self . ActionList : ActionList = ActionList () self . EventID = EventID self . SolidColor = SolidColor self . TextItem = TextItem self . BatchOptions = BatchOptions # The save options. self . GIFSaveOptions = GIFSaveOptions self . JPEGSaveOptions = JPEGSaveOptions self . PDFSaveOptions = PDFSaveOptions self . EPSSaveOptions = EPSSaveOptions self . PNGSaveOptions = PNGSaveOptions self . PhotoshopSaveOptions = PhotoshopSaveOptions self . ExportOptionsSaveForWeb = ExportOptionsSaveForWeb self . BMPSaveOptions = BMPSaveOptions self . TiffSaveOptions = TiffSaveOptions self . TargaSaveOptions = TargaSaveOptions # The colors. self . LabColor = LabColor self . HSBColor = HSBColor self . CMYKColor = CMYKColor self . RGBColor = RGBColor self . GrayColor = GrayColor # From enumerations self . LensType = enumerations . LensType self . AdjustmentReference = enumerations . AdjustmentReference self . AnchorPosition = enumerations . AnchorPosition self . AntiAlias = enumerations . AntiAlias self . AutoKernType = enumerations . AutoKernType self . BMPDepthType = enumerations . BMPDepthType self . BatchDestinationType = enumerations . BatchDestinationType self . BitmapConversionType = enumerations . BitmapConversionType self . BitmapHalfToneType = enumerations . BitmapHalfToneType self . BitsPerChannelType = enumerations . BitsPerChannelType self . BlendMode = enumerations . BlendMode self . ByteOrderType = enumerations . ByteOrderType self . CameraRAWSettingsType = enumerations . CameraRAWSettingsType self . CameraRAWSize = enumerations . CameraRAWSize self . Case = enumerations . Case self . ChangeMode = enumerations . ChangeMode self . ChannelType = enumerations . ChannelType self . ColorBlendMode = enumerations . ColorBlendMode self . ColorModel = enumerations . ColorModel self . ColorPicker = enumerations . ColorPicker self . ColorProfileType = enumerations . ColorProfileType self . ColorReductionType = enumerations . ColorReductionType self . ColorSpaceType = enumerations . ColorSpaceType self . CopyrightedType = enumerations . CopyrightedType self . CreateFields = enumerations . CreateFields self . CropToType = enumerations . CropToType self . DCSType = enumerations . DCSType self . DepthMaource = enumerations . DepthMaource self . DescValueType = enumerations . DescValueType self . DialogModes = enumerations . DialogModes self . Direction = enumerations . Direction self . DisplacementMapType = enumerations . DisplacementMapType self . DitherType = enumerations . DitherType self . DocumentFill = enumerations . DocumentFill self . DocumentMode = enumerations . DocumentMode self . EditLogItemsType = enumerations . EditLogItemsType self . ElementPlacement = enumerations . ElementPlacement self . EliminateFields = enumerations . EliminateFields self . ExportType = enumerations . ExportType self . ExtensionType = enumerations . ExtensionType self . FileNamingType = enumerations . FileNamingType self . FontPreviewType = enumerations . FontPreviewType self . ForcedColors = enumerations . ForcedColors self . FormatOptionsType = enumerations . FormatOptionsType self . GalleryConstrainType = enumerations . GalleryConstrainType self . GalleryFontType = enumerations . GalleryFontType self . GallerySecurityTextColorType = enumerations . GallerySecurityTextColorType self . GallerySecurityTextPositionType = enumerations . GallerySecurityTextPositionType self . GallerySecurityTextRotateType = enumerations . GallerySecurityTextRotateType self . GallerySecurityType = enumerations . GallerySecurityType self . GalleryThumbSizeType = enumerations . GalleryThumbSizeType self . Geometry = enumerations . Geometry self . GridLineStyle = enumerations . GridLineStyle self . GridSize = enumerations . GridSize self . GuideLineStyle = enumerations . GuideLineStyle self . IllustratorPathType = enumerations . IllustratorPathType self . Intent = enumerations . Intent self . JavaScriptExecutionMode = enumerations . JavaScriptExecutionMode self . Justification = enumerations . Justification self . Language = enumerations . Language self . LayerCompressionType = enumerations . LayerCompressionType self . LayerKind = enumerations . LayerKind self . LayerType = enumerations . LayerType self . MagnificationType = enumerations . MagnificationType self . MatteType = enumerations . MatteType self . MeasurementRange = enumerations . MeasurementRange self . MeasurementSource = enumerations . MeasurementSource self . NewDocumentMode = enumerations . NewDocumentMode self . NoiseDistribution = enumerations . NoiseDistribution self . OffsetUndefinedAreas = enumerations . OffsetUndefinedAreas self . OpenDocumentMode = enumerations . OpenDocumentMode self . OpenDocumentType = enumerations . OpenDocumentType self . OperatingSystem = enumerations . OperatingSystem self . Orientation = enumerations . Orientation self . OtherPaintingCursors = enumerations . OtherPaintingCursors self . PDFCompatibilityType = enumerations . PDFCompatibilityType self . PDFEncodingType = enumerations . PDFEncodingType self . PDFResampleType = enumerations . PDFResampleType self . PDFStandardType = enumerations . PDFStandardType self . PICTBitsPerPixel = enumerations . PICTBitsPerPixel self . PICTCompression = enumerations . PICTCompression self . PaintingCursors = enumerations . PaintingCursors self . PaletteType = enumerations . PaletteType self . PathKind = enumerations . PathKind self . PhotoCDColorSpace = enumerations . PhotoCDColorSpace self . PhotoCDSize = enumerations . PhotoCDSize self . PicturePackageTextType = enumerations . PicturePackageTextType self . PointKind = enumerations . PointKind self . PointType = enumerations . PointType self . PolarConversionType = enumerations . PolarConversionType self . PreviewType = enumerations . PreviewType self . PurgeTarget = enumerations . PurgeTarget self . QueryStateType = enumerations . QueryStateType self . RadialBlurMethod = enumerations . RadialBlurMethod self . RadialBlurBest = enumerations . RadialBlurBest self . RasterizeType = enumerations . RasterizeType self . ReferenceFormType = enumerations . ReferenceFormType self . ResampleMethod = enumerations . ResampleMethod self . ResetTarget = enumerations . ResetTarget self . RippleSize = enumerations . RippleSize self . SaveBehavior = enumerations . SaveBehavior self . SaveDocumentType = enumerations . SaveDocumentType self . SaveEncoding = enumerations . SaveEncoding self . SaveLogItemsType = enumerations . SaveLogItemsType self . SaveOptions = enumerations . SaveOptions self . SelectionType = enumerations . SelectionType self . ShapeOperation = enumerations . ShapeOperation self . SmartBlurMode = enumerations . SmartBlurMode self . SmartBlurQuality = enumerations . SmartBlurQuality self . SourceSpaceType = enumerations . SourceSpaceType self . SpherizeMode = enumerations . SpherizeMode self . StrikeThruType = enumerations . StrikeThruType self . StrokeLocation = enumerations . StrokeLocation self . TargaBitsPerPixels = enumerations . TargaBitsPerPixels self . TextComposer = enumerations . TextComposer self . TextType = enumerations . TextType self . TextureType = enumerations . TextureType self . TiffEncodingType = enumerations . TiffEncodingType self . ToolType = enumerations . ToolType self . TransitionType = enumerations . TransitionType self . TrimType = enumerations . TrimType self . TypeUnits = enumerations . TypeUnits self . UndefinedAreas = enumerations . UndefinedAreas self . UnderlineType = enumerations . UnderlineType self . Units = enumerations . Units self . Urgency = enumerations . Urgency self . Wartyle = enumerations . Wartyle self . WaveType = enumerations . WaveType self . WhiteBalanceType = enumerations . WhiteBalanceType self . ZigZagType = enumerations . ZigZagType @property def active_document ( self ): \"\"\"Get current active document. Raises: - PhotoshopPythonAPICOMError: No active document available. \"\"\" try : if not self . _active_document : return self . app . activeDocument return self . _active_document except errors . PhotoshopPythonAPICOMError : raise errors . PhotoshopPythonAPIError ( \"No active document available.\" ) @staticmethod def echo ( * args , ** kwargs ): \"\"\"Print message.\"\"\" print ( * args , ** kwargs ) def alert ( self , text : str ): \"\"\"Alert message box in photoshop. Args: text (str): The text will pop up in photoshop. \"\"\" self . app . doJavaScript ( f \"alert(' { text } ')\" ) @active_document . setter def active_document ( self , active_document ): \"\"\"Set active document.\"\"\" self . _active_document = active_document def _action_open ( self ): self . active_document = self . app . open ( self . path ) def _action_new_document ( self ): self . active_document = self . app . documents . add () def _action_document_duplicate ( self ): self . active_document = self . active_document . duplicate () def run_action ( self ): try : _action = getattr ( self , f \"_action_ { self . _action } \" ) _action () except AttributeError : pass def close ( self ): \"\"\"closing current session.\"\"\" if self . _auto_close : self . active_document . close () def __enter__ ( self ): self . run_action () return self def __exit__ ( self , exc_type , exc_val , exc_tb ): try : if self . _callback : self . _callback ( self ) except Exception as err : raise errors . PhotoshopPythonAPIError ( err ) finally : self . close () active_document property writable Get current active document. Raises: Type Description - PhotoshopPythonAPICOMError No active document available. __init__ ( file_path = None , action = None , callback = None , auto_close = False , ps_version = None ) Session of Photoshop. Examples: from photoshop import Session with Session ( \"your/psd/or/psb/file_path.psd\" , action = \"open\" ) as ps : ps . echo ( ps . active_document . name ) Parameters: Name Type Description Default file_path str The absolute path of the file. This path can be used together with action. If the path is an existing psd` or image path, use open`` action to open this file in the current session. None action str Name of the action. .e.g: - open Open the file from the option file_path . - new_document Create a new document. - document_duplicate Duplicate current active document. None callback Any The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. None auto_close bool Is it necessary to close the current document when exiting the current context session. The default is False not to exit current session. False ps_version str Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 None Source code in photoshop/session.py 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 def __init__ ( self , file_path : str = None , action : str = None , callback : Any = None , auto_close : bool = False , ps_version : str = None , ): \"\"\"Session of Photoshop. Examples: ```python from photoshop import Session with Session(\"your/psd/or/psb/file_path.psd\", action=\"open\") as ps: ps.echo(ps.active_document.name) ``` Args: file_path: The absolute path of the file. This path can be used together with action. If the path is an existing ``psd` or image path, use ``open`` action to open this file in the current session. action: Name of the action. .e.g: - open Open the file from the option `file_path`. - new_document Create a new document. - document_duplicate Duplicate current active document. callback: The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. auto_close: Is it necessary to close the current document when exiting the current context session. The default is ``False`` not to exit current session. ps_version: Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 \"\"\" super () . __init__ () self . path = file_path self . _auto_close = auto_close self . _callback = callback self . _action = action self . _active_document = None self . app : Application = Application ( version = ps_version ) self . ActionReference : ActionReference = ActionReference () self . ActionDescriptor : ActionDescriptor = ActionDescriptor () self . ActionList : ActionList = ActionList () self . EventID = EventID self . SolidColor = SolidColor self . TextItem = TextItem self . BatchOptions = BatchOptions # The save options. self . GIFSaveOptions = GIFSaveOptions self . JPEGSaveOptions = JPEGSaveOptions self . PDFSaveOptions = PDFSaveOptions self . EPSSaveOptions = EPSSaveOptions self . PNGSaveOptions = PNGSaveOptions self . PhotoshopSaveOptions = PhotoshopSaveOptions self . ExportOptionsSaveForWeb = ExportOptionsSaveForWeb self . BMPSaveOptions = BMPSaveOptions self . TiffSaveOptions = TiffSaveOptions self . TargaSaveOptions = TargaSaveOptions # The colors. self . LabColor = LabColor self . HSBColor = HSBColor self . CMYKColor = CMYKColor self . RGBColor = RGBColor self . GrayColor = GrayColor # From enumerations self . LensType = enumerations . LensType self . AdjustmentReference = enumerations . AdjustmentReference self . AnchorPosition = enumerations . AnchorPosition self . AntiAlias = enumerations . AntiAlias self . AutoKernType = enumerations . AutoKernType self . BMPDepthType = enumerations . BMPDepthType self . BatchDestinationType = enumerations . BatchDestinationType self . BitmapConversionType = enumerations . BitmapConversionType self . BitmapHalfToneType = enumerations . BitmapHalfToneType self . BitsPerChannelType = enumerations . BitsPerChannelType self . BlendMode = enumerations . BlendMode self . ByteOrderType = enumerations . ByteOrderType self . CameraRAWSettingsType = enumerations . CameraRAWSettingsType self . CameraRAWSize = enumerations . CameraRAWSize self . Case = enumerations . Case self . ChangeMode = enumerations . ChangeMode self . ChannelType = enumerations . ChannelType self . ColorBlendMode = enumerations . ColorBlendMode self . ColorModel = enumerations . ColorModel self . ColorPicker = enumerations . ColorPicker self . ColorProfileType = enumerations . ColorProfileType self . ColorReductionType = enumerations . ColorReductionType self . ColorSpaceType = enumerations . ColorSpaceType self . CopyrightedType = enumerations . CopyrightedType self . CreateFields = enumerations . CreateFields self . CropToType = enumerations . CropToType self . DCSType = enumerations . DCSType self . DepthMaource = enumerations . DepthMaource self . DescValueType = enumerations . DescValueType self . DialogModes = enumerations . DialogModes self . Direction = enumerations . Direction self . DisplacementMapType = enumerations . DisplacementMapType self . DitherType = enumerations . DitherType self . DocumentFill = enumerations . DocumentFill self . DocumentMode = enumerations . DocumentMode self . EditLogItemsType = enumerations . EditLogItemsType self . ElementPlacement = enumerations . ElementPlacement self . EliminateFields = enumerations . EliminateFields self . ExportType = enumerations . ExportType self . ExtensionType = enumerations . ExtensionType self . FileNamingType = enumerations . FileNamingType self . FontPreviewType = enumerations . FontPreviewType self . ForcedColors = enumerations . ForcedColors self . FormatOptionsType = enumerations . FormatOptionsType self . GalleryConstrainType = enumerations . GalleryConstrainType self . GalleryFontType = enumerations . GalleryFontType self . GallerySecurityTextColorType = enumerations . GallerySecurityTextColorType self . GallerySecurityTextPositionType = enumerations . GallerySecurityTextPositionType self . GallerySecurityTextRotateType = enumerations . GallerySecurityTextRotateType self . GallerySecurityType = enumerations . GallerySecurityType self . GalleryThumbSizeType = enumerations . GalleryThumbSizeType self . Geometry = enumerations . Geometry self . GridLineStyle = enumerations . GridLineStyle self . GridSize = enumerations . GridSize self . GuideLineStyle = enumerations . GuideLineStyle self . IllustratorPathType = enumerations . IllustratorPathType self . Intent = enumerations . Intent self . JavaScriptExecutionMode = enumerations . JavaScriptExecutionMode self . Justification = enumerations . Justification self . Language = enumerations . Language self . LayerCompressionType = enumerations . LayerCompressionType self . LayerKind = enumerations . LayerKind self . LayerType = enumerations . LayerType self . MagnificationType = enumerations . MagnificationType self . MatteType = enumerations . MatteType self . MeasurementRange = enumerations . MeasurementRange self . MeasurementSource = enumerations . MeasurementSource self . NewDocumentMode = enumerations . NewDocumentMode self . NoiseDistribution = enumerations . NoiseDistribution self . OffsetUndefinedAreas = enumerations . OffsetUndefinedAreas self . OpenDocumentMode = enumerations . OpenDocumentMode self . OpenDocumentType = enumerations . OpenDocumentType self . OperatingSystem = enumerations . OperatingSystem self . Orientation = enumerations . Orientation self . OtherPaintingCursors = enumerations . OtherPaintingCursors self . PDFCompatibilityType = enumerations . PDFCompatibilityType self . PDFEncodingType = enumerations . PDFEncodingType self . PDFResampleType = enumerations . PDFResampleType self . PDFStandardType = enumerations . PDFStandardType self . PICTBitsPerPixel = enumerations . PICTBitsPerPixel self . PICTCompression = enumerations . PICTCompression self . PaintingCursors = enumerations . PaintingCursors self . PaletteType = enumerations . PaletteType self . PathKind = enumerations . PathKind self . PhotoCDColorSpace = enumerations . PhotoCDColorSpace self . PhotoCDSize = enumerations . PhotoCDSize self . PicturePackageTextType = enumerations . PicturePackageTextType self . PointKind = enumerations . PointKind self . PointType = enumerations . PointType self . PolarConversionType = enumerations . PolarConversionType self . PreviewType = enumerations . PreviewType self . PurgeTarget = enumerations . PurgeTarget self . QueryStateType = enumerations . QueryStateType self . RadialBlurMethod = enumerations . RadialBlurMethod self . RadialBlurBest = enumerations . RadialBlurBest self . RasterizeType = enumerations . RasterizeType self . ReferenceFormType = enumerations . ReferenceFormType self . ResampleMethod = enumerations . ResampleMethod self . ResetTarget = enumerations . ResetTarget self . RippleSize = enumerations . RippleSize self . SaveBehavior = enumerations . SaveBehavior self . SaveDocumentType = enumerations . SaveDocumentType self . SaveEncoding = enumerations . SaveEncoding self . SaveLogItemsType = enumerations . SaveLogItemsType self . SaveOptions = enumerations . SaveOptions self . SelectionType = enumerations . SelectionType self . ShapeOperation = enumerations . ShapeOperation self . SmartBlurMode = enumerations . SmartBlurMode self . SmartBlurQuality = enumerations . SmartBlurQuality self . SourceSpaceType = enumerations . SourceSpaceType self . SpherizeMode = enumerations . SpherizeMode self . StrikeThruType = enumerations . StrikeThruType self . StrokeLocation = enumerations . StrokeLocation self . TargaBitsPerPixels = enumerations . TargaBitsPerPixels self . TextComposer = enumerations . TextComposer self . TextType = enumerations . TextType self . TextureType = enumerations . TextureType self . TiffEncodingType = enumerations . TiffEncodingType self . ToolType = enumerations . ToolType self . TransitionType = enumerations . TransitionType self . TrimType = enumerations . TrimType self . TypeUnits = enumerations . TypeUnits self . UndefinedAreas = enumerations . UndefinedAreas self . UnderlineType = enumerations . UnderlineType self . Units = enumerations . Units self . Urgency = enumerations . Urgency self . Wartyle = enumerations . Wartyle self . WaveType = enumerations . WaveType self . WhiteBalanceType = enumerations . WhiteBalanceType self . ZigZagType = enumerations . ZigZagType alert ( text ) Alert message box in photoshop. Parameters: Name Type Description Default text str The text will pop up in photoshop. required Source code in photoshop/session.py 305 306 307 308 309 310 311 312 def alert ( self , text : str ): \"\"\"Alert message box in photoshop. Args: text (str): The text will pop up in photoshop. \"\"\" self . app . doJavaScript ( f \"alert(' { text } ')\" ) close () closing current session. Source code in photoshop/session.py 335 336 337 338 def close ( self ): \"\"\"closing current session.\"\"\" if self . _auto_close : self . active_document . close () echo ( * args , ** kwargs ) staticmethod Print message. Source code in photoshop/session.py 300 301 302 303 @staticmethod def echo ( * args , ** kwargs ): \"\"\"Print message.\"\"\" print ( * args , ** kwargs )","title":"session"},{"location":"reference/photoshop/session/#photoshop.session.Session","text":"Session of photoshop. We can control active documents in this Session. Attributes: Name Type Description app Application Application of Photoshop. ActionReference ActionReference ActionDescriptor ActionDescriptor Source code in photoshop/session.py 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 class Session : \"\"\"Session of photoshop. We can control active documents in this Session. Attributes: app: Application of Photoshop. ActionReference: ActionDescriptor: \"\"\" def __init__ ( self , file_path : str = None , action : str = None , callback : Any = None , auto_close : bool = False , ps_version : str = None , ): \"\"\"Session of Photoshop. Examples: ```python from photoshop import Session with Session(\"your/psd/or/psb/file_path.psd\", action=\"open\") as ps: ps.echo(ps.active_document.name) ``` Args: file_path: The absolute path of the file. This path can be used together with action. If the path is an existing ``psd` or image path, use ``open`` action to open this file in the current session. action: Name of the action. .e.g: - open Open the file from the option `file_path`. - new_document Create a new document. - document_duplicate Duplicate current active document. callback: The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. auto_close: Is it necessary to close the current document when exiting the current context session. The default is ``False`` not to exit current session. ps_version: Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 \"\"\" super () . __init__ () self . path = file_path self . _auto_close = auto_close self . _callback = callback self . _action = action self . _active_document = None self . app : Application = Application ( version = ps_version ) self . ActionReference : ActionReference = ActionReference () self . ActionDescriptor : ActionDescriptor = ActionDescriptor () self . ActionList : ActionList = ActionList () self . EventID = EventID self . SolidColor = SolidColor self . TextItem = TextItem self . BatchOptions = BatchOptions # The save options. self . GIFSaveOptions = GIFSaveOptions self . JPEGSaveOptions = JPEGSaveOptions self . PDFSaveOptions = PDFSaveOptions self . EPSSaveOptions = EPSSaveOptions self . PNGSaveOptions = PNGSaveOptions self . PhotoshopSaveOptions = PhotoshopSaveOptions self . ExportOptionsSaveForWeb = ExportOptionsSaveForWeb self . BMPSaveOptions = BMPSaveOptions self . TiffSaveOptions = TiffSaveOptions self . TargaSaveOptions = TargaSaveOptions # The colors. self . LabColor = LabColor self . HSBColor = HSBColor self . CMYKColor = CMYKColor self . RGBColor = RGBColor self . GrayColor = GrayColor # From enumerations self . LensType = enumerations . LensType self . AdjustmentReference = enumerations . AdjustmentReference self . AnchorPosition = enumerations . AnchorPosition self . AntiAlias = enumerations . AntiAlias self . AutoKernType = enumerations . AutoKernType self . BMPDepthType = enumerations . BMPDepthType self . BatchDestinationType = enumerations . BatchDestinationType self . BitmapConversionType = enumerations . BitmapConversionType self . BitmapHalfToneType = enumerations . BitmapHalfToneType self . BitsPerChannelType = enumerations . BitsPerChannelType self . BlendMode = enumerations . BlendMode self . ByteOrderType = enumerations . ByteOrderType self . CameraRAWSettingsType = enumerations . CameraRAWSettingsType self . CameraRAWSize = enumerations . CameraRAWSize self . Case = enumerations . Case self . ChangeMode = enumerations . ChangeMode self . ChannelType = enumerations . ChannelType self . ColorBlendMode = enumerations . ColorBlendMode self . ColorModel = enumerations . ColorModel self . ColorPicker = enumerations . ColorPicker self . ColorProfileType = enumerations . ColorProfileType self . ColorReductionType = enumerations . ColorReductionType self . ColorSpaceType = enumerations . ColorSpaceType self . CopyrightedType = enumerations . CopyrightedType self . CreateFields = enumerations . CreateFields self . CropToType = enumerations . CropToType self . DCSType = enumerations . DCSType self . DepthMaource = enumerations . DepthMaource self . DescValueType = enumerations . DescValueType self . DialogModes = enumerations . DialogModes self . Direction = enumerations . Direction self . DisplacementMapType = enumerations . DisplacementMapType self . DitherType = enumerations . DitherType self . DocumentFill = enumerations . DocumentFill self . DocumentMode = enumerations . DocumentMode self . EditLogItemsType = enumerations . EditLogItemsType self . ElementPlacement = enumerations . ElementPlacement self . EliminateFields = enumerations . EliminateFields self . ExportType = enumerations . ExportType self . ExtensionType = enumerations . ExtensionType self . FileNamingType = enumerations . FileNamingType self . FontPreviewType = enumerations . FontPreviewType self . ForcedColors = enumerations . ForcedColors self . FormatOptionsType = enumerations . FormatOptionsType self . GalleryConstrainType = enumerations . GalleryConstrainType self . GalleryFontType = enumerations . GalleryFontType self . GallerySecurityTextColorType = enumerations . GallerySecurityTextColorType self . GallerySecurityTextPositionType = enumerations . GallerySecurityTextPositionType self . GallerySecurityTextRotateType = enumerations . GallerySecurityTextRotateType self . GallerySecurityType = enumerations . GallerySecurityType self . GalleryThumbSizeType = enumerations . GalleryThumbSizeType self . Geometry = enumerations . Geometry self . GridLineStyle = enumerations . GridLineStyle self . GridSize = enumerations . GridSize self . GuideLineStyle = enumerations . GuideLineStyle self . IllustratorPathType = enumerations . IllustratorPathType self . Intent = enumerations . Intent self . JavaScriptExecutionMode = enumerations . JavaScriptExecutionMode self . Justification = enumerations . Justification self . Language = enumerations . Language self . LayerCompressionType = enumerations . LayerCompressionType self . LayerKind = enumerations . LayerKind self . LayerType = enumerations . LayerType self . MagnificationType = enumerations . MagnificationType self . MatteType = enumerations . MatteType self . MeasurementRange = enumerations . MeasurementRange self . MeasurementSource = enumerations . MeasurementSource self . NewDocumentMode = enumerations . NewDocumentMode self . NoiseDistribution = enumerations . NoiseDistribution self . OffsetUndefinedAreas = enumerations . OffsetUndefinedAreas self . OpenDocumentMode = enumerations . OpenDocumentMode self . OpenDocumentType = enumerations . OpenDocumentType self . OperatingSystem = enumerations . OperatingSystem self . Orientation = enumerations . Orientation self . OtherPaintingCursors = enumerations . OtherPaintingCursors self . PDFCompatibilityType = enumerations . PDFCompatibilityType self . PDFEncodingType = enumerations . PDFEncodingType self . PDFResampleType = enumerations . PDFResampleType self . PDFStandardType = enumerations . PDFStandardType self . PICTBitsPerPixel = enumerations . PICTBitsPerPixel self . PICTCompression = enumerations . PICTCompression self . PaintingCursors = enumerations . PaintingCursors self . PaletteType = enumerations . PaletteType self . PathKind = enumerations . PathKind self . PhotoCDColorSpace = enumerations . PhotoCDColorSpace self . PhotoCDSize = enumerations . PhotoCDSize self . PicturePackageTextType = enumerations . PicturePackageTextType self . PointKind = enumerations . PointKind self . PointType = enumerations . PointType self . PolarConversionType = enumerations . PolarConversionType self . PreviewType = enumerations . PreviewType self . PurgeTarget = enumerations . PurgeTarget self . QueryStateType = enumerations . QueryStateType self . RadialBlurMethod = enumerations . RadialBlurMethod self . RadialBlurBest = enumerations . RadialBlurBest self . RasterizeType = enumerations . RasterizeType self . ReferenceFormType = enumerations . ReferenceFormType self . ResampleMethod = enumerations . ResampleMethod self . ResetTarget = enumerations . ResetTarget self . RippleSize = enumerations . RippleSize self . SaveBehavior = enumerations . SaveBehavior self . SaveDocumentType = enumerations . SaveDocumentType self . SaveEncoding = enumerations . SaveEncoding self . SaveLogItemsType = enumerations . SaveLogItemsType self . SaveOptions = enumerations . SaveOptions self . SelectionType = enumerations . SelectionType self . ShapeOperation = enumerations . ShapeOperation self . SmartBlurMode = enumerations . SmartBlurMode self . SmartBlurQuality = enumerations . SmartBlurQuality self . SourceSpaceType = enumerations . SourceSpaceType self . SpherizeMode = enumerations . SpherizeMode self . StrikeThruType = enumerations . StrikeThruType self . StrokeLocation = enumerations . StrokeLocation self . TargaBitsPerPixels = enumerations . TargaBitsPerPixels self . TextComposer = enumerations . TextComposer self . TextType = enumerations . TextType self . TextureType = enumerations . TextureType self . TiffEncodingType = enumerations . TiffEncodingType self . ToolType = enumerations . ToolType self . TransitionType = enumerations . TransitionType self . TrimType = enumerations . TrimType self . TypeUnits = enumerations . TypeUnits self . UndefinedAreas = enumerations . UndefinedAreas self . UnderlineType = enumerations . UnderlineType self . Units = enumerations . Units self . Urgency = enumerations . Urgency self . Wartyle = enumerations . Wartyle self . WaveType = enumerations . WaveType self . WhiteBalanceType = enumerations . WhiteBalanceType self . ZigZagType = enumerations . ZigZagType @property def active_document ( self ): \"\"\"Get current active document. Raises: - PhotoshopPythonAPICOMError: No active document available. \"\"\" try : if not self . _active_document : return self . app . activeDocument return self . _active_document except errors . PhotoshopPythonAPICOMError : raise errors . PhotoshopPythonAPIError ( \"No active document available.\" ) @staticmethod def echo ( * args , ** kwargs ): \"\"\"Print message.\"\"\" print ( * args , ** kwargs ) def alert ( self , text : str ): \"\"\"Alert message box in photoshop. Args: text (str): The text will pop up in photoshop. \"\"\" self . app . doJavaScript ( f \"alert(' { text } ')\" ) @active_document . setter def active_document ( self , active_document ): \"\"\"Set active document.\"\"\" self . _active_document = active_document def _action_open ( self ): self . active_document = self . app . open ( self . path ) def _action_new_document ( self ): self . active_document = self . app . documents . add () def _action_document_duplicate ( self ): self . active_document = self . active_document . duplicate () def run_action ( self ): try : _action = getattr ( self , f \"_action_ { self . _action } \" ) _action () except AttributeError : pass def close ( self ): \"\"\"closing current session.\"\"\" if self . _auto_close : self . active_document . close () def __enter__ ( self ): self . run_action () return self def __exit__ ( self , exc_type , exc_val , exc_tb ): try : if self . _callback : self . _callback ( self ) except Exception as err : raise errors . PhotoshopPythonAPIError ( err ) finally : self . close ()","title":"Session"},{"location":"reference/photoshop/session/#photoshop.session.Session.active_document","text":"Get current active document. Raises: Type Description - PhotoshopPythonAPICOMError No active document available.","title":"active_document"},{"location":"reference/photoshop/session/#photoshop.session.Session.__init__","text":"Session of Photoshop. Examples: from photoshop import Session with Session ( \"your/psd/or/psb/file_path.psd\" , action = \"open\" ) as ps : ps . echo ( ps . active_document . name ) Parameters: Name Type Description Default file_path str The absolute path of the file. This path can be used together with action. If the path is an existing psd` or image path, use open`` action to open this file in the current session. None action str Name of the action. .e.g: - open Open the file from the option file_path . - new_document Create a new document. - document_duplicate Duplicate current active document. None callback Any The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. None auto_close bool Is it necessary to close the current document when exiting the current context session. The default is False not to exit current session. False ps_version str Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 None Source code in photoshop/session.py 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 def __init__ ( self , file_path : str = None , action : str = None , callback : Any = None , auto_close : bool = False , ps_version : str = None , ): \"\"\"Session of Photoshop. Examples: ```python from photoshop import Session with Session(\"your/psd/or/psb/file_path.psd\", action=\"open\") as ps: ps.echo(ps.active_document.name) ``` Args: file_path: The absolute path of the file. This path can be used together with action. If the path is an existing ``psd` or image path, use ``open`` action to open this file in the current session. action: Name of the action. .e.g: - open Open the file from the option `file_path`. - new_document Create a new document. - document_duplicate Duplicate current active document. callback: The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. auto_close: Is it necessary to close the current document when exiting the current context session. The default is ``False`` not to exit current session. ps_version: Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 \"\"\" super () . __init__ () self . path = file_path self . _auto_close = auto_close self . _callback = callback self . _action = action self . _active_document = None self . app : Application = Application ( version = ps_version ) self . ActionReference : ActionReference = ActionReference () self . ActionDescriptor : ActionDescriptor = ActionDescriptor () self . ActionList : ActionList = ActionList () self . EventID = EventID self . SolidColor = SolidColor self . TextItem = TextItem self . BatchOptions = BatchOptions # The save options. self . GIFSaveOptions = GIFSaveOptions self . JPEGSaveOptions = JPEGSaveOptions self . PDFSaveOptions = PDFSaveOptions self . EPSSaveOptions = EPSSaveOptions self . PNGSaveOptions = PNGSaveOptions self . PhotoshopSaveOptions = PhotoshopSaveOptions self . ExportOptionsSaveForWeb = ExportOptionsSaveForWeb self . BMPSaveOptions = BMPSaveOptions self . TiffSaveOptions = TiffSaveOptions self . TargaSaveOptions = TargaSaveOptions # The colors. self . LabColor = LabColor self . HSBColor = HSBColor self . CMYKColor = CMYKColor self . RGBColor = RGBColor self . GrayColor = GrayColor # From enumerations self . LensType = enumerations . LensType self . AdjustmentReference = enumerations . AdjustmentReference self . AnchorPosition = enumerations . AnchorPosition self . AntiAlias = enumerations . AntiAlias self . AutoKernType = enumerations . AutoKernType self . BMPDepthType = enumerations . BMPDepthType self . BatchDestinationType = enumerations . BatchDestinationType self . BitmapConversionType = enumerations . BitmapConversionType self . BitmapHalfToneType = enumerations . BitmapHalfToneType self . BitsPerChannelType = enumerations . BitsPerChannelType self . BlendMode = enumerations . BlendMode self . ByteOrderType = enumerations . ByteOrderType self . CameraRAWSettingsType = enumerations . CameraRAWSettingsType self . CameraRAWSize = enumerations . CameraRAWSize self . Case = enumerations . Case self . ChangeMode = enumerations . ChangeMode self . ChannelType = enumerations . ChannelType self . ColorBlendMode = enumerations . ColorBlendMode self . ColorModel = enumerations . ColorModel self . ColorPicker = enumerations . ColorPicker self . ColorProfileType = enumerations . ColorProfileType self . ColorReductionType = enumerations . ColorReductionType self . ColorSpaceType = enumerations . ColorSpaceType self . CopyrightedType = enumerations . CopyrightedType self . CreateFields = enumerations . CreateFields self . CropToType = enumerations . CropToType self . DCSType = enumerations . DCSType self . DepthMaource = enumerations . DepthMaource self . DescValueType = enumerations . DescValueType self . DialogModes = enumerations . DialogModes self . Direction = enumerations . Direction self . DisplacementMapType = enumerations . DisplacementMapType self . DitherType = enumerations . DitherType self . DocumentFill = enumerations . DocumentFill self . DocumentMode = enumerations . DocumentMode self . EditLogItemsType = enumerations . EditLogItemsType self . ElementPlacement = enumerations . ElementPlacement self . EliminateFields = enumerations . EliminateFields self . ExportType = enumerations . ExportType self . ExtensionType = enumerations . ExtensionType self . FileNamingType = enumerations . FileNamingType self . FontPreviewType = enumerations . FontPreviewType self . ForcedColors = enumerations . ForcedColors self . FormatOptionsType = enumerations . FormatOptionsType self . GalleryConstrainType = enumerations . GalleryConstrainType self . GalleryFontType = enumerations . GalleryFontType self . GallerySecurityTextColorType = enumerations . GallerySecurityTextColorType self . GallerySecurityTextPositionType = enumerations . GallerySecurityTextPositionType self . GallerySecurityTextRotateType = enumerations . GallerySecurityTextRotateType self . GallerySecurityType = enumerations . GallerySecurityType self . GalleryThumbSizeType = enumerations . GalleryThumbSizeType self . Geometry = enumerations . Geometry self . GridLineStyle = enumerations . GridLineStyle self . GridSize = enumerations . GridSize self . GuideLineStyle = enumerations . GuideLineStyle self . IllustratorPathType = enumerations . IllustratorPathType self . Intent = enumerations . Intent self . JavaScriptExecutionMode = enumerations . JavaScriptExecutionMode self . Justification = enumerations . Justification self . Language = enumerations . Language self . LayerCompressionType = enumerations . LayerCompressionType self . LayerKind = enumerations . LayerKind self . LayerType = enumerations . LayerType self . MagnificationType = enumerations . MagnificationType self . MatteType = enumerations . MatteType self . MeasurementRange = enumerations . MeasurementRange self . MeasurementSource = enumerations . MeasurementSource self . NewDocumentMode = enumerations . NewDocumentMode self . NoiseDistribution = enumerations . NoiseDistribution self . OffsetUndefinedAreas = enumerations . OffsetUndefinedAreas self . OpenDocumentMode = enumerations . OpenDocumentMode self . OpenDocumentType = enumerations . OpenDocumentType self . OperatingSystem = enumerations . OperatingSystem self . Orientation = enumerations . Orientation self . OtherPaintingCursors = enumerations . OtherPaintingCursors self . PDFCompatibilityType = enumerations . PDFCompatibilityType self . PDFEncodingType = enumerations . PDFEncodingType self . PDFResampleType = enumerations . PDFResampleType self . PDFStandardType = enumerations . PDFStandardType self . PICTBitsPerPixel = enumerations . PICTBitsPerPixel self . PICTCompression = enumerations . PICTCompression self . PaintingCursors = enumerations . PaintingCursors self . PaletteType = enumerations . PaletteType self . PathKind = enumerations . PathKind self . PhotoCDColorSpace = enumerations . PhotoCDColorSpace self . PhotoCDSize = enumerations . PhotoCDSize self . PicturePackageTextType = enumerations . PicturePackageTextType self . PointKind = enumerations . PointKind self . PointType = enumerations . PointType self . PolarConversionType = enumerations . PolarConversionType self . PreviewType = enumerations . PreviewType self . PurgeTarget = enumerations . PurgeTarget self . QueryStateType = enumerations . QueryStateType self . RadialBlurMethod = enumerations . RadialBlurMethod self . RadialBlurBest = enumerations . RadialBlurBest self . RasterizeType = enumerations . RasterizeType self . ReferenceFormType = enumerations . ReferenceFormType self . ResampleMethod = enumerations . ResampleMethod self . ResetTarget = enumerations . ResetTarget self . RippleSize = enumerations . RippleSize self . SaveBehavior = enumerations . SaveBehavior self . SaveDocumentType = enumerations . SaveDocumentType self . SaveEncoding = enumerations . SaveEncoding self . SaveLogItemsType = enumerations . SaveLogItemsType self . SaveOptions = enumerations . SaveOptions self . SelectionType = enumerations . SelectionType self . ShapeOperation = enumerations . ShapeOperation self . SmartBlurMode = enumerations . SmartBlurMode self . SmartBlurQuality = enumerations . SmartBlurQuality self . SourceSpaceType = enumerations . SourceSpaceType self . SpherizeMode = enumerations . SpherizeMode self . StrikeThruType = enumerations . StrikeThruType self . StrokeLocation = enumerations . StrokeLocation self . TargaBitsPerPixels = enumerations . TargaBitsPerPixels self . TextComposer = enumerations . TextComposer self . TextType = enumerations . TextType self . TextureType = enumerations . TextureType self . TiffEncodingType = enumerations . TiffEncodingType self . ToolType = enumerations . ToolType self . TransitionType = enumerations . TransitionType self . TrimType = enumerations . TrimType self . TypeUnits = enumerations . TypeUnits self . UndefinedAreas = enumerations . UndefinedAreas self . UnderlineType = enumerations . UnderlineType self . Units = enumerations . Units self . Urgency = enumerations . Urgency self . Wartyle = enumerations . Wartyle self . WaveType = enumerations . WaveType self . WhiteBalanceType = enumerations . WhiteBalanceType self . ZigZagType = enumerations . ZigZagType","title":"__init__()"},{"location":"reference/photoshop/session/#photoshop.session.Session.alert","text":"Alert message box in photoshop. Parameters: Name Type Description Default text str The text will pop up in photoshop. required Source code in photoshop/session.py 305 306 307 308 309 310 311 312 def alert ( self , text : str ): \"\"\"Alert message box in photoshop. Args: text (str): The text will pop up in photoshop. \"\"\" self . app . doJavaScript ( f \"alert(' { text } ')\" )","title":"alert()"},{"location":"reference/photoshop/session/#photoshop.session.Session.close","text":"closing current session. Source code in photoshop/session.py 335 336 337 338 def close ( self ): \"\"\"closing current session.\"\"\" if self . _auto_close : self . active_document . close ()","title":"close()"},{"location":"reference/photoshop/session/#photoshop.session.Session.echo","text":"Print message. Source code in photoshop/session.py 300 301 302 303 @staticmethod def echo ( * args , ** kwargs ): \"\"\"Print message.\"\"\" print ( * args , ** kwargs )","title":"echo()"},{"location":"reference/photoshop/api/_active_layer/","text":"ActiveLayer Bases: Photoshop The selected layer. Source code in photoshop/api/_active_layer.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 class ActiveLayer ( Photoshop ): \"\"\"The selected layer.\"\"\" def __int__ ( self ): super () . __init__ () @property def name ( self ) -> str : \"\"\"The name of the layer.\"\"\" return self . active_layer . Typename def add ( self ): \"\"\"Adds an element.\"\"\" self . app . ActiveDocument . ArtLayers . Add () name : str property The name of the layer. add () Adds an element. Source code in photoshop/api/_active_layer.py 16 17 18 def add ( self ): \"\"\"Adds an element.\"\"\" self . app . ActiveDocument . ArtLayers . Add ()","title":"active_layer"},{"location":"reference/photoshop/api/_active_layer/#photoshop.api._active_layer.ActiveLayer","text":"Bases: Photoshop The selected layer. Source code in photoshop/api/_active_layer.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 class ActiveLayer ( Photoshop ): \"\"\"The selected layer.\"\"\" def __int__ ( self ): super () . __init__ () @property def name ( self ) -> str : \"\"\"The name of the layer.\"\"\" return self . active_layer . Typename def add ( self ): \"\"\"Adds an element.\"\"\" self . app . ActiveDocument . ArtLayers . Add ()","title":"ActiveLayer"},{"location":"reference/photoshop/api/_active_layer/#photoshop.api._active_layer.ActiveLayer.name","text":"The name of the layer.","title":"name"},{"location":"reference/photoshop/api/_active_layer/#photoshop.api._active_layer.ActiveLayer.add","text":"Adds an element. Source code in photoshop/api/_active_layer.py 16 17 18 def add ( self ): \"\"\"Adds an element.\"\"\" self . app . ActiveDocument . ArtLayers . Add ()","title":"add()"},{"location":"reference/photoshop/api/_artlayer/","text":"ArtLayer Bases: Photoshop An object within a document that contains the visual elements of the image (equivalent to a layer in the Adobe Photoshop application). Source code in photoshop/api/_artlayer.py 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 class ArtLayer ( Photoshop ): \"\"\"An object within a document that contains the visual elements of the image (equivalent to a layer in the Adobe Photoshop application). \"\"\" def __init__ ( self , parent : Any = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"adjustBrightnessContrast\" , \"adjustColorBalance\" , \"adjustCurves\" , \"adjustLevels\" , \"applyAddNoise\" , \"applyAverage\" , \"applyBlur\" , \"applyBlurMore\" , \"applyClouds\" , \"applyCustomFilter\" , \"applyDeInterlace\" , \"applyDespeckle\" , \"applyDifferenceClouds\" , \"applyDiffuseGlow\" , \"applyDisplace\" , \"applyDustAndScratches\" , \"applyGaussianBlur\" , \"applyGlassEffect\" , \"applyHighPass\" , \"applyLensBlur\" , \"applyLensFlare\" , \"applyMaximum\" , \"applyMedianNoise\" , \"applyMinimum\" , \"applyMotionBlur\" , \"applyNTSC\" , \"applyOceanRipple\" , \"applyOffset\" , \"applyPinch\" , \"delete\" , \"duplicate\" , \"invert\" , \"link\" , \"merge\" , \"move\" , \"posterize\" , \"rasterize\" , \"unlink\" , ) @property def allLocked ( self ): return self . app . allLocked @allLocked . setter def allLocked ( self , value ): self . app . allLocked = value @property def blendMode ( self ): return self . app . blendMode @blendMode . setter def blendMode ( self , mode ): self . app . blendMode = mode @property def bounds ( self ): \"\"\"The bounding rectangle of the layer.\"\"\" return self . app . bounds @property def linkedLayers ( self ) -> list : \"\"\"Get all layers linked to this layer. Returns: list: Layer objects\"\"\" return [ ArtLayer ( layer ) for layer in self . app . linkedLayers ] @property def name ( self ) -> str : return self . app . name @name . setter def name ( self , text : str ): self . app . name = text @property def fillOpacity ( self ): \"\"\"The interior opacity of the layer. Range: 0.0 to 100.0.\"\"\" return self . app . fillOpacity @fillOpacity . setter def fillOpacity ( self , value ): \"\"\"The interior opacity of the layer. Range: 0.0 to 100.0.\"\"\" self . app . fillOpacity = value @property def filterMaskDensity ( self ): return self . app . filterMaskDensity @filterMaskDensity . setter def filterMaskDensity ( self , value ): self . app . filterMaskDensity = value @property def filterMaskFeather ( self ): return self . app . filterMaskFeather @filterMaskFeather . setter def filterMaskFeather ( self , value ): self . app . filterMaskFeather = value @property def grouped ( self ) -> bool : \"\"\"If true, the layer is grouped with the layer below.\"\"\" return self . app . grouped @grouped . setter def grouped ( self , value ): self . app . grouped = value @property def isBackgroundLayer ( self ): \"\"\"bool: If true, the layer is a background layer.\"\"\" return self . app . isBackgroundLayer @isBackgroundLayer . setter def isBackgroundLayer ( self , value ): self . app . isBackgroundLayer = value @property def kind ( self ): \"\"\"Sets the layer kind (such as \u2018text layer\u2019) for an empty layer. Valid only when the layer is empty and when `isBackgroundLayer` is false. You can use the \u2018kind \u2018 property to make a background layer a normal layer; however, to make a layer a background layer, you must set `isBackgroundLayer` to true. \"\"\" return LayerKind ( self . app . kind ) @kind . setter def kind ( self , layer_type ): \"\"\"set the layer kind.\"\"\" self . app . kind = layer_type @property def layerMaskDensity ( self ): \"\"\"The density of the layer mask (between 0.0 and 100.0).\"\"\" return self . app . layerMaskDensity @layerMaskDensity . setter def layerMaskDensity ( self , value ): self . app . layerMaskDensity = value @property def layerMaskFeather ( self ): \"\"\"The feather of the layer mask (between 0.0 and 250.0).\"\"\" return self . app . layerMaskFeather @layerMaskFeather . setter def layerMaskFeather ( self , value ): self . app . layerMaskFeather = value @property def opacity ( self ): \"\"\"The master opacity of the layer.\"\"\" return round ( self . app . opacity ) @opacity . setter def opacity ( self , value ): self . app . opacity = value @property def parent ( self ): \"\"\"The object\u2019s container.\"\"\" return self . app . parent @parent . setter def parent ( self , value ): \"\"\"Set the object\u2019s container.\"\"\" self . app . parent = value @property def pixelsLocked ( self ): \"\"\"If true, the pixels in the layer\u2019s image cannot be edited.\"\"\" return self . app . pixelsLocked @pixelsLocked . setter def pixelsLocked ( self , value ): self . app . pixelsLocked = value @property def positionLocked ( self ): \"\"\"bool: If true, the pixels in the layer\u2019s image cannot be moved within the layer.\"\"\" return self . app . positionLocked @positionLocked . setter def positionLocked ( self , value ): self . app . positionLocked = value @property def textItem ( self ) -> TextItem : \"\"\"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. returns: TextItem: \"\"\" return TextItem ( self . app . textItem ) @textItem . setter def textItem ( self , value ): self . app . textItem = value @property def transparentPixelsLocked ( self ): return self . app . transparentPixelsLocked @transparentPixelsLocked . setter def transparentPixelsLocked ( self , value ): self . app . transparentPixelsLocked = value @property def vectorMaskDensity ( self ): return self . app . vectorMaskDensity @vectorMaskDensity . setter def vectorMaskDensity ( self , value ): self . app . vectorMaskDensity = value @property def vectorMaskFeather ( self ): return self . app . vectorMaskFeather @vectorMaskFeather . setter def vectorMaskFeather ( self , value ): self . app . vectorMaskFeather = value @property def visible ( self ): return self . app . visible @visible . setter def visible ( self , value ): self . app . visible = value @property def length ( self ): return len ( list ( self . app )) def add ( self ): return self . app . add () def adjustBrightnessContrast ( self , brightness , contrast ): \"\"\"Adjusts the brightness and contrast. Args: brightness (int): The brightness amount. Range: -100 to 100. contrast (int): The contrast amount. Range: -100 to 100. \"\"\" return self . app . adjustBrightnessContrast ( brightness , contrast ) def adjustColorBalance ( self , shadows , midtones , highlights , preserveLuminosity , ): \"\"\"Adjusts the color balance of the layer\u2019s component channels. Args: shadows: The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. midtones: The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. highlights: The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. preserveLuminosity: If true, luminosity is preserved. \"\"\" return self . app . adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity , ) def adjustCurves ( self , curveShape ): \"\"\"Adjusts the tonal range of the selected channel using up to fourteen points. Args: curveShape: The curve points. The number of points must be between 2 and 14. Returns: \"\"\" return self . app . adjustCurves ( curveShape ) def adjustLevels ( self , inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ): \"\"\"Adjusts levels of the selected channels. Args: inputRangeStart: inputRangeEnd: inputRangeGamma: outputRangeStart: outputRangeEnd: Returns: \"\"\" return self . app . adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ) def applyAddNoise ( self , amount , distribution , monochromatic ): return self . app . applyAddNoise ( amount , distribution , monochromatic ) def applyDiffuseGlow ( self , graininess , amount , clear_amount ): \"\"\"Applies the diffuse glow filter. Args: graininess: The amount of graininess. Range: 0 to 10. amount: The glow amount. Range: 0 to 20. clear_amount: The clear amount. Range: 0 to 20. Returns: \"\"\" return self . app . applyDiffuseGlow ( graininess , amount , clear_amount ) def applyAverage ( self ): \"\"\"Applies the average filter.\"\"\" return self . app . applyAverage () def applyBlur ( self ): \"\"\"Applies the blur filter.\"\"\" return self . app . applyBlur () def applyBlurMore ( self ): \"\"\"Applies the blur more filter.\"\"\" return self . app . applyBlurMore () def applyClouds ( self ): \"\"\"Applies the clouds filter.\"\"\" return self . app . applyClouds () def applyCustomFilter ( self , characteristics , scale , offset ): \"\"\"Applies the custom filter.\"\"\" return self . app . applyCustomFilter ( characteristics , scale , offset ) def applyDeInterlace ( self , eliminateFields , createFields ): \"\"\"Applies the de-interlace filter.\"\"\" return self . app . applyDeInterlace ( eliminateFields , createFields ) def applyDespeckle ( self ): return self . app . applyDespeckle () def applyDifferenceClouds ( self ): \"\"\"Applies the difference clouds filter.\"\"\" return self . app . applyDifferenceClouds () def applyDisplace ( self , horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ): \"\"\"Applies the displace filter.\"\"\" return self . app . applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ) def applyDustAndScratches ( self , radius , threshold ): \"\"\"Applies the dust and scratches filter.\"\"\" return self . app . applyDustAndScratches ( radius , threshold ) def applyGaussianBlur ( self , radius ): \"\"\"Applies the gaussian blur filter.\"\"\" return self . app . applyGaussianBlur ( radius ) def applyGlassEffect ( self , distortion , smoothness , scaling , invert , texture , textureFile , ): return self . app . applyGlassEffect ( distortion , smoothness , scaling , invert , texture , textureFile , ) def applyHighPass ( self , radius ): \"\"\"Applies the high pass filter.\"\"\" return self . app . applyHighPass ( radius ) def applyLensBlur ( self , source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ): \"\"\"Apply the lens blur filter.\"\"\" return self . app . applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ) def applyLensFlare ( self , brightness , flareCenter , lensType ): return self . app . applyLensFlare ( brightness , flareCenter , lensType ) def applyMaximum ( self , radius ): self . app . applyMaximum ( radius ) def applyMedianNoise ( self , radius ): self . app . applyMedianNoise ( radius ) def applyMinimum ( self , radius ): self . app . applyMinimum ( radius ) def applyMotionBlur ( self , angle , radius ): self . app . applyMotionBlur ( angle , radius ) def applyNTSC ( self ): self . app . applyNTSC () def applyOceanRipple ( self , size , magnitude ): self . app . applyOceanRipple ( size , magnitude ) def applyOffset ( self , horizontal , vertical , undefinedAreas ): self . app . applyOffset ( horizontal , vertical , undefinedAreas ) def applyPinch ( self , amount ): self . app . applyPinch ( amount ) def remove ( self ): \"\"\"Removes this layer from the document.\"\"\" self . app . delete () def rasterize ( self , target : RasterizeType ): self . app . rasterize ( target ) def posterize ( self , levels ): self . app . posterize ( levels ) def move ( self , relativeObject , insertionLocation ): self . app . move ( relativeObject , insertionLocation ) def merge ( self ): return ArtLayer ( self . app . merge ()) def link ( self , with_layer ): self . app . link ( with_layer ) def unlink ( self ): \"\"\"Unlink this layer from any linked layers.\"\"\" self . app . unlink () def invert ( self ): self . app . invert () def duplicate ( self , relativeObject = None , insertionLocation = None ): return ArtLayer ( self . app . duplicate ( relativeObject , insertionLocation )) bounds property The bounding rectangle of the layer. fillOpacity property writable The interior opacity of the layer. Range: 0.0 to 100.0. grouped : bool property writable If true, the layer is grouped with the layer below. isBackgroundLayer property writable kind property writable Sets the layer kind (such as \u2018text layer\u2019) for an empty layer. Valid only when the layer is empty and when isBackgroundLayer is false. You can use the \u2018kind \u2018 property to make a background layer a normal layer; however, to make a layer a background layer, you must set isBackgroundLayer to true. layerMaskDensity property writable The density of the layer mask (between 0.0 and 100.0). layerMaskFeather property writable The feather of the layer mask (between 0.0 and 250.0). linkedLayers : list property Get all layers linked to this layer. Returns: Name Type Description list list Layer objects opacity property writable The master opacity of the layer. parent property writable The object\u2019s container. pixelsLocked property writable If true, the pixels in the layer\u2019s image cannot be edited. positionLocked property writable within the layer. textItem : TextItem property writable The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. Returns: Name Type Description TextItem TextItem adjustBrightnessContrast ( brightness , contrast ) Adjusts the brightness and contrast. Parameters: Name Type Description Default brightness int The brightness amount. Range: -100 to 100. required contrast int The contrast amount. Range: -100 to 100. required Source code in photoshop/api/_artlayer.py 270 271 272 273 274 275 276 277 278 def adjustBrightnessContrast ( self , brightness , contrast ): \"\"\"Adjusts the brightness and contrast. Args: brightness (int): The brightness amount. Range: -100 to 100. contrast (int): The contrast amount. Range: -100 to 100. \"\"\" return self . app . adjustBrightnessContrast ( brightness , contrast ) adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity ) Adjusts the color balance of the layer\u2019s component channels. Parameters: Name Type Description Default shadows The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required midtones The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required highlights The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required preserveLuminosity If true, luminosity is preserved. required Source code in photoshop/api/_artlayer.py 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 def adjustColorBalance ( self , shadows , midtones , highlights , preserveLuminosity , ): \"\"\"Adjusts the color balance of the layer\u2019s component channels. Args: shadows: The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. midtones: The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. highlights: The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. preserveLuminosity: If true, luminosity is preserved. \"\"\" return self . app . adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity , ) adjustCurves ( curveShape ) Adjusts the tonal range of the selected channel using up to fourteen points. Parameters: Name Type Description Default curveShape The curve points. The number of points must be between 2 and 14. required Source code in photoshop/api/_artlayer.py 312 313 314 315 316 317 318 319 320 321 322 323 324 325 def adjustCurves ( self , curveShape ): \"\"\"Adjusts the tonal range of the selected channel using up to fourteen points. Args: curveShape: The curve points. The number of points must be between 2 and 14. Returns: \"\"\" return self . app . adjustCurves ( curveShape ) adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd ) Adjusts levels of the selected channels. Parameters: Name Type Description Default inputRangeStart required inputRangeEnd required inputRangeGamma required outputRangeStart required outputRangeEnd required Source code in photoshop/api/_artlayer.py 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 def adjustLevels ( self , inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ): \"\"\"Adjusts levels of the selected channels. Args: inputRangeStart: inputRangeEnd: inputRangeGamma: outputRangeStart: outputRangeEnd: Returns: \"\"\" return self . app . adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ) applyAverage () Applies the average filter. Source code in photoshop/api/_artlayer.py 371 372 373 def applyAverage ( self ): \"\"\"Applies the average filter.\"\"\" return self . app . applyAverage () applyBlur () Applies the blur filter. Source code in photoshop/api/_artlayer.py 375 376 377 def applyBlur ( self ): \"\"\"Applies the blur filter.\"\"\" return self . app . applyBlur () applyBlurMore () Applies the blur more filter. Source code in photoshop/api/_artlayer.py 379 380 381 def applyBlurMore ( self ): \"\"\"Applies the blur more filter.\"\"\" return self . app . applyBlurMore () applyClouds () Applies the clouds filter. Source code in photoshop/api/_artlayer.py 383 384 385 def applyClouds ( self ): \"\"\"Applies the clouds filter.\"\"\" return self . app . applyClouds () applyCustomFilter ( characteristics , scale , offset ) Applies the custom filter. Source code in photoshop/api/_artlayer.py 387 388 389 def applyCustomFilter ( self , characteristics , scale , offset ): \"\"\"Applies the custom filter.\"\"\" return self . app . applyCustomFilter ( characteristics , scale , offset ) applyDeInterlace ( eliminateFields , createFields ) Applies the de-interlace filter. Source code in photoshop/api/_artlayer.py 391 392 393 def applyDeInterlace ( self , eliminateFields , createFields ): \"\"\"Applies the de-interlace filter.\"\"\" return self . app . applyDeInterlace ( eliminateFields , createFields ) applyDifferenceClouds () Applies the difference clouds filter. Source code in photoshop/api/_artlayer.py 398 399 400 def applyDifferenceClouds ( self ): \"\"\"Applies the difference clouds filter.\"\"\" return self . app . applyDifferenceClouds () applyDiffuseGlow ( graininess , amount , clear_amount ) Applies the diffuse glow filter. Parameters: Name Type Description Default graininess The amount of graininess. Range: 0 to 10. required amount The glow amount. Range: 0 to 20. required clear_amount The clear amount. Range: 0 to 20. required Source code in photoshop/api/_artlayer.py 358 359 360 361 362 363 364 365 366 367 368 369 def applyDiffuseGlow ( self , graininess , amount , clear_amount ): \"\"\"Applies the diffuse glow filter. Args: graininess: The amount of graininess. Range: 0 to 10. amount: The glow amount. Range: 0 to 20. clear_amount: The clear amount. Range: 0 to 20. Returns: \"\"\" return self . app . applyDiffuseGlow ( graininess , amount , clear_amount ) applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile ) Applies the displace filter. Source code in photoshop/api/_artlayer.py 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 def applyDisplace ( self , horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ): \"\"\"Applies the displace filter.\"\"\" return self . app . applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ) applyDustAndScratches ( radius , threshold ) Applies the dust and scratches filter. Source code in photoshop/api/_artlayer.py 419 420 421 def applyDustAndScratches ( self , radius , threshold ): \"\"\"Applies the dust and scratches filter.\"\"\" return self . app . applyDustAndScratches ( radius , threshold ) applyGaussianBlur ( radius ) Applies the gaussian blur filter. Source code in photoshop/api/_artlayer.py 423 424 425 def applyGaussianBlur ( self , radius ): \"\"\"Applies the gaussian blur filter.\"\"\" return self . app . applyGaussianBlur ( radius ) applyHighPass ( radius ) Applies the high pass filter. Source code in photoshop/api/_artlayer.py 445 446 447 def applyHighPass ( self , radius ): \"\"\"Applies the high pass filter.\"\"\" return self . app . applyHighPass ( radius ) applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic ) Apply the lens blur filter. Source code in photoshop/api/_artlayer.py 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 def applyLensBlur ( self , source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ): \"\"\"Apply the lens blur filter.\"\"\" return self . app . applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ) remove () Removes this layer from the document. Source code in photoshop/api/_artlayer.py 507 508 509 def remove ( self ): \"\"\"Removes this layer from the document.\"\"\" self . app . delete () unlink () Unlink this layer from any linked layers. Source code in photoshop/api/_artlayer.py 526 527 528 def unlink ( self ): \"\"\"Unlink this layer from any linked layers.\"\"\" self . app . unlink ()","title":"artlayer"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer","text":"Bases: Photoshop An object within a document that contains the visual elements of the image (equivalent to a layer in the Adobe Photoshop application). Source code in photoshop/api/_artlayer.py 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 class ArtLayer ( Photoshop ): \"\"\"An object within a document that contains the visual elements of the image (equivalent to a layer in the Adobe Photoshop application). \"\"\" def __init__ ( self , parent : Any = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"adjustBrightnessContrast\" , \"adjustColorBalance\" , \"adjustCurves\" , \"adjustLevels\" , \"applyAddNoise\" , \"applyAverage\" , \"applyBlur\" , \"applyBlurMore\" , \"applyClouds\" , \"applyCustomFilter\" , \"applyDeInterlace\" , \"applyDespeckle\" , \"applyDifferenceClouds\" , \"applyDiffuseGlow\" , \"applyDisplace\" , \"applyDustAndScratches\" , \"applyGaussianBlur\" , \"applyGlassEffect\" , \"applyHighPass\" , \"applyLensBlur\" , \"applyLensFlare\" , \"applyMaximum\" , \"applyMedianNoise\" , \"applyMinimum\" , \"applyMotionBlur\" , \"applyNTSC\" , \"applyOceanRipple\" , \"applyOffset\" , \"applyPinch\" , \"delete\" , \"duplicate\" , \"invert\" , \"link\" , \"merge\" , \"move\" , \"posterize\" , \"rasterize\" , \"unlink\" , ) @property def allLocked ( self ): return self . app . allLocked @allLocked . setter def allLocked ( self , value ): self . app . allLocked = value @property def blendMode ( self ): return self . app . blendMode @blendMode . setter def blendMode ( self , mode ): self . app . blendMode = mode @property def bounds ( self ): \"\"\"The bounding rectangle of the layer.\"\"\" return self . app . bounds @property def linkedLayers ( self ) -> list : \"\"\"Get all layers linked to this layer. Returns: list: Layer objects\"\"\" return [ ArtLayer ( layer ) for layer in self . app . linkedLayers ] @property def name ( self ) -> str : return self . app . name @name . setter def name ( self , text : str ): self . app . name = text @property def fillOpacity ( self ): \"\"\"The interior opacity of the layer. Range: 0.0 to 100.0.\"\"\" return self . app . fillOpacity @fillOpacity . setter def fillOpacity ( self , value ): \"\"\"The interior opacity of the layer. Range: 0.0 to 100.0.\"\"\" self . app . fillOpacity = value @property def filterMaskDensity ( self ): return self . app . filterMaskDensity @filterMaskDensity . setter def filterMaskDensity ( self , value ): self . app . filterMaskDensity = value @property def filterMaskFeather ( self ): return self . app . filterMaskFeather @filterMaskFeather . setter def filterMaskFeather ( self , value ): self . app . filterMaskFeather = value @property def grouped ( self ) -> bool : \"\"\"If true, the layer is grouped with the layer below.\"\"\" return self . app . grouped @grouped . setter def grouped ( self , value ): self . app . grouped = value @property def isBackgroundLayer ( self ): \"\"\"bool: If true, the layer is a background layer.\"\"\" return self . app . isBackgroundLayer @isBackgroundLayer . setter def isBackgroundLayer ( self , value ): self . app . isBackgroundLayer = value @property def kind ( self ): \"\"\"Sets the layer kind (such as \u2018text layer\u2019) for an empty layer. Valid only when the layer is empty and when `isBackgroundLayer` is false. You can use the \u2018kind \u2018 property to make a background layer a normal layer; however, to make a layer a background layer, you must set `isBackgroundLayer` to true. \"\"\" return LayerKind ( self . app . kind ) @kind . setter def kind ( self , layer_type ): \"\"\"set the layer kind.\"\"\" self . app . kind = layer_type @property def layerMaskDensity ( self ): \"\"\"The density of the layer mask (between 0.0 and 100.0).\"\"\" return self . app . layerMaskDensity @layerMaskDensity . setter def layerMaskDensity ( self , value ): self . app . layerMaskDensity = value @property def layerMaskFeather ( self ): \"\"\"The feather of the layer mask (between 0.0 and 250.0).\"\"\" return self . app . layerMaskFeather @layerMaskFeather . setter def layerMaskFeather ( self , value ): self . app . layerMaskFeather = value @property def opacity ( self ): \"\"\"The master opacity of the layer.\"\"\" return round ( self . app . opacity ) @opacity . setter def opacity ( self , value ): self . app . opacity = value @property def parent ( self ): \"\"\"The object\u2019s container.\"\"\" return self . app . parent @parent . setter def parent ( self , value ): \"\"\"Set the object\u2019s container.\"\"\" self . app . parent = value @property def pixelsLocked ( self ): \"\"\"If true, the pixels in the layer\u2019s image cannot be edited.\"\"\" return self . app . pixelsLocked @pixelsLocked . setter def pixelsLocked ( self , value ): self . app . pixelsLocked = value @property def positionLocked ( self ): \"\"\"bool: If true, the pixels in the layer\u2019s image cannot be moved within the layer.\"\"\" return self . app . positionLocked @positionLocked . setter def positionLocked ( self , value ): self . app . positionLocked = value @property def textItem ( self ) -> TextItem : \"\"\"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. returns: TextItem: \"\"\" return TextItem ( self . app . textItem ) @textItem . setter def textItem ( self , value ): self . app . textItem = value @property def transparentPixelsLocked ( self ): return self . app . transparentPixelsLocked @transparentPixelsLocked . setter def transparentPixelsLocked ( self , value ): self . app . transparentPixelsLocked = value @property def vectorMaskDensity ( self ): return self . app . vectorMaskDensity @vectorMaskDensity . setter def vectorMaskDensity ( self , value ): self . app . vectorMaskDensity = value @property def vectorMaskFeather ( self ): return self . app . vectorMaskFeather @vectorMaskFeather . setter def vectorMaskFeather ( self , value ): self . app . vectorMaskFeather = value @property def visible ( self ): return self . app . visible @visible . setter def visible ( self , value ): self . app . visible = value @property def length ( self ): return len ( list ( self . app )) def add ( self ): return self . app . add () def adjustBrightnessContrast ( self , brightness , contrast ): \"\"\"Adjusts the brightness and contrast. Args: brightness (int): The brightness amount. Range: -100 to 100. contrast (int): The contrast amount. Range: -100 to 100. \"\"\" return self . app . adjustBrightnessContrast ( brightness , contrast ) def adjustColorBalance ( self , shadows , midtones , highlights , preserveLuminosity , ): \"\"\"Adjusts the color balance of the layer\u2019s component channels. Args: shadows: The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. midtones: The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. highlights: The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. preserveLuminosity: If true, luminosity is preserved. \"\"\" return self . app . adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity , ) def adjustCurves ( self , curveShape ): \"\"\"Adjusts the tonal range of the selected channel using up to fourteen points. Args: curveShape: The curve points. The number of points must be between 2 and 14. Returns: \"\"\" return self . app . adjustCurves ( curveShape ) def adjustLevels ( self , inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ): \"\"\"Adjusts levels of the selected channels. Args: inputRangeStart: inputRangeEnd: inputRangeGamma: outputRangeStart: outputRangeEnd: Returns: \"\"\" return self . app . adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ) def applyAddNoise ( self , amount , distribution , monochromatic ): return self . app . applyAddNoise ( amount , distribution , monochromatic ) def applyDiffuseGlow ( self , graininess , amount , clear_amount ): \"\"\"Applies the diffuse glow filter. Args: graininess: The amount of graininess. Range: 0 to 10. amount: The glow amount. Range: 0 to 20. clear_amount: The clear amount. Range: 0 to 20. Returns: \"\"\" return self . app . applyDiffuseGlow ( graininess , amount , clear_amount ) def applyAverage ( self ): \"\"\"Applies the average filter.\"\"\" return self . app . applyAverage () def applyBlur ( self ): \"\"\"Applies the blur filter.\"\"\" return self . app . applyBlur () def applyBlurMore ( self ): \"\"\"Applies the blur more filter.\"\"\" return self . app . applyBlurMore () def applyClouds ( self ): \"\"\"Applies the clouds filter.\"\"\" return self . app . applyClouds () def applyCustomFilter ( self , characteristics , scale , offset ): \"\"\"Applies the custom filter.\"\"\" return self . app . applyCustomFilter ( characteristics , scale , offset ) def applyDeInterlace ( self , eliminateFields , createFields ): \"\"\"Applies the de-interlace filter.\"\"\" return self . app . applyDeInterlace ( eliminateFields , createFields ) def applyDespeckle ( self ): return self . app . applyDespeckle () def applyDifferenceClouds ( self ): \"\"\"Applies the difference clouds filter.\"\"\" return self . app . applyDifferenceClouds () def applyDisplace ( self , horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ): \"\"\"Applies the displace filter.\"\"\" return self . app . applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ) def applyDustAndScratches ( self , radius , threshold ): \"\"\"Applies the dust and scratches filter.\"\"\" return self . app . applyDustAndScratches ( radius , threshold ) def applyGaussianBlur ( self , radius ): \"\"\"Applies the gaussian blur filter.\"\"\" return self . app . applyGaussianBlur ( radius ) def applyGlassEffect ( self , distortion , smoothness , scaling , invert , texture , textureFile , ): return self . app . applyGlassEffect ( distortion , smoothness , scaling , invert , texture , textureFile , ) def applyHighPass ( self , radius ): \"\"\"Applies the high pass filter.\"\"\" return self . app . applyHighPass ( radius ) def applyLensBlur ( self , source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ): \"\"\"Apply the lens blur filter.\"\"\" return self . app . applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ) def applyLensFlare ( self , brightness , flareCenter , lensType ): return self . app . applyLensFlare ( brightness , flareCenter , lensType ) def applyMaximum ( self , radius ): self . app . applyMaximum ( radius ) def applyMedianNoise ( self , radius ): self . app . applyMedianNoise ( radius ) def applyMinimum ( self , radius ): self . app . applyMinimum ( radius ) def applyMotionBlur ( self , angle , radius ): self . app . applyMotionBlur ( angle , radius ) def applyNTSC ( self ): self . app . applyNTSC () def applyOceanRipple ( self , size , magnitude ): self . app . applyOceanRipple ( size , magnitude ) def applyOffset ( self , horizontal , vertical , undefinedAreas ): self . app . applyOffset ( horizontal , vertical , undefinedAreas ) def applyPinch ( self , amount ): self . app . applyPinch ( amount ) def remove ( self ): \"\"\"Removes this layer from the document.\"\"\" self . app . delete () def rasterize ( self , target : RasterizeType ): self . app . rasterize ( target ) def posterize ( self , levels ): self . app . posterize ( levels ) def move ( self , relativeObject , insertionLocation ): self . app . move ( relativeObject , insertionLocation ) def merge ( self ): return ArtLayer ( self . app . merge ()) def link ( self , with_layer ): self . app . link ( with_layer ) def unlink ( self ): \"\"\"Unlink this layer from any linked layers.\"\"\" self . app . unlink () def invert ( self ): self . app . invert () def duplicate ( self , relativeObject = None , insertionLocation = None ): return ArtLayer ( self . app . duplicate ( relativeObject , insertionLocation ))","title":"ArtLayer"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.bounds","text":"The bounding rectangle of the layer.","title":"bounds"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.fillOpacity","text":"The interior opacity of the layer. Range: 0.0 to 100.0.","title":"fillOpacity"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.grouped","text":"If true, the layer is grouped with the layer below.","title":"grouped"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.isBackgroundLayer","text":"","title":"isBackgroundLayer"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.kind","text":"Sets the layer kind (such as \u2018text layer\u2019) for an empty layer. Valid only when the layer is empty and when isBackgroundLayer is false. You can use the \u2018kind \u2018 property to make a background layer a normal layer; however, to make a layer a background layer, you must set isBackgroundLayer to true.","title":"kind"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.layerMaskDensity","text":"The density of the layer mask (between 0.0 and 100.0).","title":"layerMaskDensity"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.layerMaskFeather","text":"The feather of the layer mask (between 0.0 and 250.0).","title":"layerMaskFeather"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.linkedLayers","text":"Get all layers linked to this layer. Returns: Name Type Description list list Layer objects","title":"linkedLayers"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.opacity","text":"The master opacity of the layer.","title":"opacity"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.parent","text":"The object\u2019s container.","title":"parent"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.pixelsLocked","text":"If true, the pixels in the layer\u2019s image cannot be edited.","title":"pixelsLocked"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.positionLocked","text":"within the layer.","title":"positionLocked"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.textItem","text":"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. Returns: Name Type Description TextItem TextItem","title":"textItem"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.adjustBrightnessContrast","text":"Adjusts the brightness and contrast. Parameters: Name Type Description Default brightness int The brightness amount. Range: -100 to 100. required contrast int The contrast amount. Range: -100 to 100. required Source code in photoshop/api/_artlayer.py 270 271 272 273 274 275 276 277 278 def adjustBrightnessContrast ( self , brightness , contrast ): \"\"\"Adjusts the brightness and contrast. Args: brightness (int): The brightness amount. Range: -100 to 100. contrast (int): The contrast amount. Range: -100 to 100. \"\"\" return self . app . adjustBrightnessContrast ( brightness , contrast )","title":"adjustBrightnessContrast()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.adjustColorBalance","text":"Adjusts the color balance of the layer\u2019s component channels. Parameters: Name Type Description Default shadows The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required midtones The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required highlights The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required preserveLuminosity If true, luminosity is preserved. required Source code in photoshop/api/_artlayer.py 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 def adjustColorBalance ( self , shadows , midtones , highlights , preserveLuminosity , ): \"\"\"Adjusts the color balance of the layer\u2019s component channels. Args: shadows: The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. midtones: The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. highlights: The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. preserveLuminosity: If true, luminosity is preserved. \"\"\" return self . app . adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity , )","title":"adjustColorBalance()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.adjustCurves","text":"Adjusts the tonal range of the selected channel using up to fourteen points. Parameters: Name Type Description Default curveShape The curve points. The number of points must be between 2 and 14. required Source code in photoshop/api/_artlayer.py 312 313 314 315 316 317 318 319 320 321 322 323 324 325 def adjustCurves ( self , curveShape ): \"\"\"Adjusts the tonal range of the selected channel using up to fourteen points. Args: curveShape: The curve points. The number of points must be between 2 and 14. Returns: \"\"\" return self . app . adjustCurves ( curveShape )","title":"adjustCurves()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.adjustLevels","text":"Adjusts levels of the selected channels. Parameters: Name Type Description Default inputRangeStart required inputRangeEnd required inputRangeGamma required outputRangeStart required outputRangeEnd required Source code in photoshop/api/_artlayer.py 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 def adjustLevels ( self , inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ): \"\"\"Adjusts levels of the selected channels. Args: inputRangeStart: inputRangeEnd: inputRangeGamma: outputRangeStart: outputRangeEnd: Returns: \"\"\" return self . app . adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , )","title":"adjustLevels()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyAverage","text":"Applies the average filter. Source code in photoshop/api/_artlayer.py 371 372 373 def applyAverage ( self ): \"\"\"Applies the average filter.\"\"\" return self . app . applyAverage ()","title":"applyAverage()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyBlur","text":"Applies the blur filter. Source code in photoshop/api/_artlayer.py 375 376 377 def applyBlur ( self ): \"\"\"Applies the blur filter.\"\"\" return self . app . applyBlur ()","title":"applyBlur()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyBlurMore","text":"Applies the blur more filter. Source code in photoshop/api/_artlayer.py 379 380 381 def applyBlurMore ( self ): \"\"\"Applies the blur more filter.\"\"\" return self . app . applyBlurMore ()","title":"applyBlurMore()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyClouds","text":"Applies the clouds filter. Source code in photoshop/api/_artlayer.py 383 384 385 def applyClouds ( self ): \"\"\"Applies the clouds filter.\"\"\" return self . app . applyClouds ()","title":"applyClouds()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyCustomFilter","text":"Applies the custom filter. Source code in photoshop/api/_artlayer.py 387 388 389 def applyCustomFilter ( self , characteristics , scale , offset ): \"\"\"Applies the custom filter.\"\"\" return self . app . applyCustomFilter ( characteristics , scale , offset )","title":"applyCustomFilter()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDeInterlace","text":"Applies the de-interlace filter. Source code in photoshop/api/_artlayer.py 391 392 393 def applyDeInterlace ( self , eliminateFields , createFields ): \"\"\"Applies the de-interlace filter.\"\"\" return self . app . applyDeInterlace ( eliminateFields , createFields )","title":"applyDeInterlace()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDifferenceClouds","text":"Applies the difference clouds filter. Source code in photoshop/api/_artlayer.py 398 399 400 def applyDifferenceClouds ( self ): \"\"\"Applies the difference clouds filter.\"\"\" return self . app . applyDifferenceClouds ()","title":"applyDifferenceClouds()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDiffuseGlow","text":"Applies the diffuse glow filter. Parameters: Name Type Description Default graininess The amount of graininess. Range: 0 to 10. required amount The glow amount. Range: 0 to 20. required clear_amount The clear amount. Range: 0 to 20. required Source code in photoshop/api/_artlayer.py 358 359 360 361 362 363 364 365 366 367 368 369 def applyDiffuseGlow ( self , graininess , amount , clear_amount ): \"\"\"Applies the diffuse glow filter. Args: graininess: The amount of graininess. Range: 0 to 10. amount: The glow amount. Range: 0 to 20. clear_amount: The clear amount. Range: 0 to 20. Returns: \"\"\" return self . app . applyDiffuseGlow ( graininess , amount , clear_amount )","title":"applyDiffuseGlow()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDisplace","text":"Applies the displace filter. Source code in photoshop/api/_artlayer.py 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 def applyDisplace ( self , horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ): \"\"\"Applies the displace filter.\"\"\" return self . app . applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , )","title":"applyDisplace()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDustAndScratches","text":"Applies the dust and scratches filter. Source code in photoshop/api/_artlayer.py 419 420 421 def applyDustAndScratches ( self , radius , threshold ): \"\"\"Applies the dust and scratches filter.\"\"\" return self . app . applyDustAndScratches ( radius , threshold )","title":"applyDustAndScratches()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyGaussianBlur","text":"Applies the gaussian blur filter. Source code in photoshop/api/_artlayer.py 423 424 425 def applyGaussianBlur ( self , radius ): \"\"\"Applies the gaussian blur filter.\"\"\" return self . app . applyGaussianBlur ( radius )","title":"applyGaussianBlur()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyHighPass","text":"Applies the high pass filter. Source code in photoshop/api/_artlayer.py 445 446 447 def applyHighPass ( self , radius ): \"\"\"Applies the high pass filter.\"\"\" return self . app . applyHighPass ( radius )","title":"applyHighPass()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyLensBlur","text":"Apply the lens blur filter. Source code in photoshop/api/_artlayer.py 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 def applyLensBlur ( self , source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ): \"\"\"Apply the lens blur filter.\"\"\" return self . app . applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , )","title":"applyLensBlur()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.remove","text":"Removes this layer from the document. Source code in photoshop/api/_artlayer.py 507 508 509 def remove ( self ): \"\"\"Removes this layer from the document.\"\"\" self . app . delete ()","title":"remove()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.unlink","text":"Unlink this layer from any linked layers. Source code in photoshop/api/_artlayer.py 526 527 528 def unlink ( self ): \"\"\"Unlink this layer from any linked layers.\"\"\" self . app . unlink ()","title":"unlink()"},{"location":"reference/photoshop/api/_artlayers/","text":"ArtLayers Bases: Photoshop The collection of art layer objects in the document. Source code in photoshop/api/_artlayers.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 class ArtLayers ( Photoshop ): \"\"\"The collection of art layer objects in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , ) @property def _layers ( self ): return list ( self . app ) def __len__ ( self ): return self . length def __iter__ ( self ): for layer in self . app : yield layer def __getitem__ ( self , key : str ): \"\"\"Access a given ArtLayer using dictionary key lookup.\"\"\" try : return ArtLayer ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { key } \"' ) @property def length ( self ): return len ( self . _layers ) @property def parent ( self ): return self . app . parent @property def typename ( self ): return self . app . typename def add ( self ): \"\"\"Adds an element.\"\"\" return ArtLayer ( self . app . add ()) def getByIndex ( self , index : int ): \"\"\"Access ArtLayer using list index lookup.\"\"\" return ArtLayer ( self . _layers [ index ]) def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name. Raises: PhotoshopPythonAPIError: Could not find a artLayer. \"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { name } \"' ) def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove () __getitem__ ( key ) Access a given ArtLayer using dictionary key lookup. Source code in photoshop/api/_artlayers.py 31 32 33 34 35 36 def __getitem__ ( self , key : str ): \"\"\"Access a given ArtLayer using dictionary key lookup.\"\"\" try : return ArtLayer ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { key } \"' ) add () Adds an element. Source code in photoshop/api/_artlayers.py 50 51 52 def add ( self ): \"\"\"Adds an element.\"\"\" return ArtLayer ( self . app . add ()) getByIndex ( index ) Access ArtLayer using list index lookup. Source code in photoshop/api/_artlayers.py 54 55 56 def getByIndex ( self , index : int ): \"\"\"Access ArtLayer using list index lookup.\"\"\" return ArtLayer ( self . _layers [ index ]) getByName ( name ) Get the first element in the collection with the provided name. Raises: Type Description PhotoshopPythonAPIError Could not find a artLayer. Source code in photoshop/api/_artlayers.py 58 59 60 61 62 63 64 65 66 67 def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name. Raises: PhotoshopPythonAPIError: Could not find a artLayer. \"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { name } \"' ) removeAll () Deletes all elements. Source code in photoshop/api/_artlayers.py 69 70 71 72 def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"artlayers"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers","text":"Bases: Photoshop The collection of art layer objects in the document. Source code in photoshop/api/_artlayers.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 class ArtLayers ( Photoshop ): \"\"\"The collection of art layer objects in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , ) @property def _layers ( self ): return list ( self . app ) def __len__ ( self ): return self . length def __iter__ ( self ): for layer in self . app : yield layer def __getitem__ ( self , key : str ): \"\"\"Access a given ArtLayer using dictionary key lookup.\"\"\" try : return ArtLayer ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { key } \"' ) @property def length ( self ): return len ( self . _layers ) @property def parent ( self ): return self . app . parent @property def typename ( self ): return self . app . typename def add ( self ): \"\"\"Adds an element.\"\"\" return ArtLayer ( self . app . add ()) def getByIndex ( self , index : int ): \"\"\"Access ArtLayer using list index lookup.\"\"\" return ArtLayer ( self . _layers [ index ]) def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name. Raises: PhotoshopPythonAPIError: Could not find a artLayer. \"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { name } \"' ) def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"ArtLayers"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.__getitem__","text":"Access a given ArtLayer using dictionary key lookup. Source code in photoshop/api/_artlayers.py 31 32 33 34 35 36 def __getitem__ ( self , key : str ): \"\"\"Access a given ArtLayer using dictionary key lookup.\"\"\" try : return ArtLayer ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { key } \"' )","title":"__getitem__()"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.add","text":"Adds an element. Source code in photoshop/api/_artlayers.py 50 51 52 def add ( self ): \"\"\"Adds an element.\"\"\" return ArtLayer ( self . app . add ())","title":"add()"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.getByIndex","text":"Access ArtLayer using list index lookup. Source code in photoshop/api/_artlayers.py 54 55 56 def getByIndex ( self , index : int ): \"\"\"Access ArtLayer using list index lookup.\"\"\" return ArtLayer ( self . _layers [ index ])","title":"getByIndex()"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.getByName","text":"Get the first element in the collection with the provided name. Raises: Type Description PhotoshopPythonAPIError Could not find a artLayer. Source code in photoshop/api/_artlayers.py 58 59 60 61 62 63 64 65 66 67 def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name. Raises: PhotoshopPythonAPIError: Could not find a artLayer. \"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { name } \"' )","title":"getByName()"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.removeAll","text":"Deletes all elements. Source code in photoshop/api/_artlayers.py 69 70 71 72 def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"removeAll()"},{"location":"reference/photoshop/api/_channel/","text":"","title":"channel"},{"location":"reference/photoshop/api/_channels/","text":"","title":"channels"},{"location":"reference/photoshop/api/_core/","text":"This class provides all photoshop API core functions. Photoshop Core API for all photoshop objects. Source code in photoshop/api/_core.py 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 class Photoshop : \"\"\"Core API for all photoshop objects.\"\"\" _root = \"Photoshop\" _reg_path = \"SOFTWARE \\\\ Adobe \\\\ Photoshop\" object_name : str = \"Application\" def __init__ ( self , ps_version : Optional [ str ] = None , parent : Any = None ): \"\"\" Initialize the Photoshop core object. Args: ps_version: Optional, Photoshop version to look for explicitly in registry. parent: Optional, parent instance to use as app object. \"\"\" # Establish the initial app and program ID ps_version = os . getenv ( \"PS_VERSION\" , ps_version ) self . _app_id = PHOTOSHOP_VERSION_MAPPINGS . get ( ps_version , \"\" ) self . _has_parent , self . adobe , self . app = False , None , None # Store current photoshop version if ps_version : os . environ [ \"PS_VERSION\" ] = ps_version # Establish the application object using provided version ID if self . app_id : self . app = self . _get_application_object ([ self . app_id ]) if not self . app : # Attempt unsuccessful self . _logger . debug ( f \"Unable to retrieve Photoshop object ' { self . typename } ' using version ' { ps_version } '.\" ) # Look for version ID in registry data if not self . app : versions = self . _get_photoshop_versions () self . app = self . _get_application_object ( versions ) if not self . app : # All attempts exhausted raise PhotoshopPythonAPIError ( \"Please check if you have Photoshop installed correctly.\" ) # Add the parent app object if parent : self . adobe = self . app self . app = parent self . _has_parent = True def __repr__ ( self ): return self def __call__ ( self , * args , ** kwargs ): return self . app def __str__ ( self ): return f \" { self . __class__ . __name__ } < { self . program_name } >\" def __getattribute__ ( self , item ): try : return super () . __getattribute__ ( item ) except AttributeError : return getattr ( self . app , item ) \"\"\" * Debug Logger \"\"\" @cached_property def _debug ( self ) -> bool : \"\"\"bool: Enable DEBUG level in logger if PS_DEBUG environment variable is truthy.\"\"\" return bool ( os . getenv ( \"PS_DEBUG\" , \"False\" ) . lower () in [ \"y\" , \"t\" , \"on\" , \"yes\" , \"true\" ]) @cached_property def _logger ( self ) -> Logger : \"\"\"Logger: Logging object for warning output.\"\"\" logr = getLogger ( \"photoshop\" ) logr . setLevel ( DEBUG if self . _debug else CRITICAL ) return logr \"\"\" * Properties \"\"\" @property def typename ( self ) -> str : \"\"\"str: Current typename.\"\"\" return self . __class__ . __name__ @property def program_name ( self ) -> str : \"\"\"str: Formatted program name found in the Windows Classes registry, e.g. Photoshop.Application.140. Examples: - Photoshop.ActionDescriptor - Photoshop.ActionDescriptor.140 - Photoshop.ActionList - Photoshop.ActionList.140 - Photoshop.ActionReference - Photoshop.ActionReference.140 - Photoshop.Application - Photoshop.Application.140 - Photoshop.BatchOptions - Photoshop.BatchOptions.140 - Photoshop.BitmapConversionOptions - Photoshop.BMPSaveOptions - Photoshop.BMPSaveOptions.140 - Photoshop.CameraRAWOpenOptions - Photoshop.CameraRAWOpenOptions.140 \"\"\" if self . app_id : return f \" { self . _root } . { self . object_name } . { self . app_id } \" return f \" { self . _root } . { self . object_name } \" @property def app_id ( self ) -> str : \"\"\"str: Photoshop version ID from Windows registry, e.g. 180.\"\"\" return self . _app_id @app_id . setter def app_id ( self , value : str ): self . _app_id = value \"\"\" * Private Methods \"\"\" def _flag_as_method ( self , * names : str ): \"\"\" * This is a hack for Photoshop's broken COM implementation. * Photoshop does not implement 'IDispatch::GetTypeInfo', so when getting a field from the COM object, comtypes will first try to fetch it as a property, then treat it as a method if it fails. * In this case, Photoshop does not return the proper error code, since it blindly treats the property getter as a method call. * Fortunately, comtypes provides a way to explicitly flag methods. \"\"\" if isinstance ( self . app , FullyDynamicDispatch ): self . app . _FlagAsMethod ( * names ) def _get_photoshop_versions ( self ) -> List [ str ]: \"\"\"Retrieve a list of Photoshop version ID's from registry.\"\"\" with suppress ( OSError , IndexError ): key = self . _open_key ( self . _reg_path ) key_count = winreg . QueryInfoKey ( key )[ 0 ] versions = [ winreg . EnumKey ( key , i ) . split ( \".\" )[ 0 ] for i in range ( key_count )] # Sort from latest version to oldest, use blank version as a fallback return [ * sorted ( versions , reverse = True ), \"\" ] self . _logger . debug ( \"Unable to find Photoshop version number in HKEY_LOCAL_MACHINE registry!\" ) return [] def _get_application_object ( self , versions : List [ str ] = None ) -> Optional [ Dispatch ]: \"\"\" Try each version string until a valid Photoshop application Dispatch object is returned. Args: versions: List of Photoshop version ID's found in registry. Returns: Photoshop application Dispatch object. Raises: OSError: If a Dispatch object wasn't resolved. \"\"\" for v in versions : self . app_id = v with suppress ( OSError ): return CreateObject ( self . program_name , dynamic = True ) return \"\"\" * Public Methods \"\"\" def get_application_path ( self ) -> str : \"\"\"str: The absolute path of Photoshop installed location.\"\"\" key = self . open_key ( f \" { self . _reg_path } \\\\ { self . program_id } \" ) return winreg . QueryValueEx ( key , \"ApplicationPath\" )[ 0 ] def get_plugin_path ( self ) -> str : \"\"\"str: The absolute plugin path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Plug-ins\" ) def get_presets_path ( self ) -> str : \"\"\"str: The absolute presets path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Presets\" ) def get_script_path ( self ) -> str : \"\"\"str: The absolute scripts path of Photoshop.\"\"\" return os . path . join ( self . presets_path , \"Scripts\" ) def eval_javascript ( self , javascript : str , Arguments : Any = None , ExecutionMode : Any = None ) -> str : \"\"\"Instruct the application to execute javascript code.\"\"\" executor = self . adobe if self . _has_parent else self . app return executor . doJavaScript ( javascript , Arguments , ExecutionMode ) \"\"\" * Private Static Methods \"\"\" @staticmethod def _open_key ( key : str ) -> winreg . HKEYType : \"\"\"Open the register key. Args: key: Photoshop application key path. Returns: The handle to the specified key. Raises: OSError: if registry key cannot be read. \"\"\" machine_type = platform . machine () mappings = { \"AMD64\" : winreg . KEY_WOW64_64KEY } access = winreg . KEY_READ | mappings . get ( machine_type , winreg . KEY_WOW64_32KEY ) try : return winreg . OpenKey ( key = winreg . HKEY_LOCAL_MACHINE , sub_key = key , access = access ) except FileNotFoundError as err : raise OSError ( \"Failed to read the registration: < {path} > \\n \" \"Please check if you have Photoshop installed correctly.\" . format ( path = f \"HKEY_LOCAL_MACHINE \\\\ { key } \" ) ) from err app_id : str property writable program_name : str property Examples: Photoshop.ActionDescriptor Photoshop.ActionDescriptor.140 Photoshop.ActionList Photoshop.ActionList.140 Photoshop.ActionReference Photoshop.ActionReference.140 Photoshop.Application Photoshop.Application.140 Photoshop.BatchOptions Photoshop.BatchOptions.140 Photoshop.BitmapConversionOptions Photoshop.BMPSaveOptions Photoshop.BMPSaveOptions.140 Photoshop.CameraRAWOpenOptions Photoshop.CameraRAWOpenOptions.140 typename : str property __init__ ( ps_version = None , parent = None ) Initialize the Photoshop core object. Parameters: Name Type Description Default ps_version Optional [ str ] Optional, Photoshop version to look for explicitly in registry. None parent Any Optional, parent instance to use as app object. None Source code in photoshop/api/_core.py 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 def __init__ ( self , ps_version : Optional [ str ] = None , parent : Any = None ): \"\"\" Initialize the Photoshop core object. Args: ps_version: Optional, Photoshop version to look for explicitly in registry. parent: Optional, parent instance to use as app object. \"\"\" # Establish the initial app and program ID ps_version = os . getenv ( \"PS_VERSION\" , ps_version ) self . _app_id = PHOTOSHOP_VERSION_MAPPINGS . get ( ps_version , \"\" ) self . _has_parent , self . adobe , self . app = False , None , None # Store current photoshop version if ps_version : os . environ [ \"PS_VERSION\" ] = ps_version # Establish the application object using provided version ID if self . app_id : self . app = self . _get_application_object ([ self . app_id ]) if not self . app : # Attempt unsuccessful self . _logger . debug ( f \"Unable to retrieve Photoshop object ' { self . typename } ' using version ' { ps_version } '.\" ) # Look for version ID in registry data if not self . app : versions = self . _get_photoshop_versions () self . app = self . _get_application_object ( versions ) if not self . app : # All attempts exhausted raise PhotoshopPythonAPIError ( \"Please check if you have Photoshop installed correctly.\" ) # Add the parent app object if parent : self . adobe = self . app self . app = parent self . _has_parent = True eval_javascript ( javascript , Arguments = None , ExecutionMode = None ) Instruct the application to execute javascript code. Source code in photoshop/api/_core.py 215 216 217 218 def eval_javascript ( self , javascript : str , Arguments : Any = None , ExecutionMode : Any = None ) -> str : \"\"\"Instruct the application to execute javascript code.\"\"\" executor = self . adobe if self . _has_parent else self . app return executor . doJavaScript ( javascript , Arguments , ExecutionMode ) get_application_path () Source code in photoshop/api/_core.py 198 199 200 201 def get_application_path ( self ) -> str : \"\"\"str: The absolute path of Photoshop installed location.\"\"\" key = self . open_key ( f \" { self . _reg_path } \\\\ { self . program_id } \" ) return winreg . QueryValueEx ( key , \"ApplicationPath\" )[ 0 ] get_plugin_path () Source code in photoshop/api/_core.py 203 204 205 def get_plugin_path ( self ) -> str : \"\"\"str: The absolute plugin path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Plug-ins\" ) get_presets_path () Source code in photoshop/api/_core.py 207 208 209 def get_presets_path ( self ) -> str : \"\"\"str: The absolute presets path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Presets\" ) get_script_path () Source code in photoshop/api/_core.py 211 212 213 def get_script_path ( self ) -> str : \"\"\"str: The absolute scripts path of Photoshop.\"\"\" return os . path . join ( self . presets_path , \"Scripts\" )","title":"core"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop","text":"Core API for all photoshop objects. Source code in photoshop/api/_core.py 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 class Photoshop : \"\"\"Core API for all photoshop objects.\"\"\" _root = \"Photoshop\" _reg_path = \"SOFTWARE \\\\ Adobe \\\\ Photoshop\" object_name : str = \"Application\" def __init__ ( self , ps_version : Optional [ str ] = None , parent : Any = None ): \"\"\" Initialize the Photoshop core object. Args: ps_version: Optional, Photoshop version to look for explicitly in registry. parent: Optional, parent instance to use as app object. \"\"\" # Establish the initial app and program ID ps_version = os . getenv ( \"PS_VERSION\" , ps_version ) self . _app_id = PHOTOSHOP_VERSION_MAPPINGS . get ( ps_version , \"\" ) self . _has_parent , self . adobe , self . app = False , None , None # Store current photoshop version if ps_version : os . environ [ \"PS_VERSION\" ] = ps_version # Establish the application object using provided version ID if self . app_id : self . app = self . _get_application_object ([ self . app_id ]) if not self . app : # Attempt unsuccessful self . _logger . debug ( f \"Unable to retrieve Photoshop object ' { self . typename } ' using version ' { ps_version } '.\" ) # Look for version ID in registry data if not self . app : versions = self . _get_photoshop_versions () self . app = self . _get_application_object ( versions ) if not self . app : # All attempts exhausted raise PhotoshopPythonAPIError ( \"Please check if you have Photoshop installed correctly.\" ) # Add the parent app object if parent : self . adobe = self . app self . app = parent self . _has_parent = True def __repr__ ( self ): return self def __call__ ( self , * args , ** kwargs ): return self . app def __str__ ( self ): return f \" { self . __class__ . __name__ } < { self . program_name } >\" def __getattribute__ ( self , item ): try : return super () . __getattribute__ ( item ) except AttributeError : return getattr ( self . app , item ) \"\"\" * Debug Logger \"\"\" @cached_property def _debug ( self ) -> bool : \"\"\"bool: Enable DEBUG level in logger if PS_DEBUG environment variable is truthy.\"\"\" return bool ( os . getenv ( \"PS_DEBUG\" , \"False\" ) . lower () in [ \"y\" , \"t\" , \"on\" , \"yes\" , \"true\" ]) @cached_property def _logger ( self ) -> Logger : \"\"\"Logger: Logging object for warning output.\"\"\" logr = getLogger ( \"photoshop\" ) logr . setLevel ( DEBUG if self . _debug else CRITICAL ) return logr \"\"\" * Properties \"\"\" @property def typename ( self ) -> str : \"\"\"str: Current typename.\"\"\" return self . __class__ . __name__ @property def program_name ( self ) -> str : \"\"\"str: Formatted program name found in the Windows Classes registry, e.g. Photoshop.Application.140. Examples: - Photoshop.ActionDescriptor - Photoshop.ActionDescriptor.140 - Photoshop.ActionList - Photoshop.ActionList.140 - Photoshop.ActionReference - Photoshop.ActionReference.140 - Photoshop.Application - Photoshop.Application.140 - Photoshop.BatchOptions - Photoshop.BatchOptions.140 - Photoshop.BitmapConversionOptions - Photoshop.BMPSaveOptions - Photoshop.BMPSaveOptions.140 - Photoshop.CameraRAWOpenOptions - Photoshop.CameraRAWOpenOptions.140 \"\"\" if self . app_id : return f \" { self . _root } . { self . object_name } . { self . app_id } \" return f \" { self . _root } . { self . object_name } \" @property def app_id ( self ) -> str : \"\"\"str: Photoshop version ID from Windows registry, e.g. 180.\"\"\" return self . _app_id @app_id . setter def app_id ( self , value : str ): self . _app_id = value \"\"\" * Private Methods \"\"\" def _flag_as_method ( self , * names : str ): \"\"\" * This is a hack for Photoshop's broken COM implementation. * Photoshop does not implement 'IDispatch::GetTypeInfo', so when getting a field from the COM object, comtypes will first try to fetch it as a property, then treat it as a method if it fails. * In this case, Photoshop does not return the proper error code, since it blindly treats the property getter as a method call. * Fortunately, comtypes provides a way to explicitly flag methods. \"\"\" if isinstance ( self . app , FullyDynamicDispatch ): self . app . _FlagAsMethod ( * names ) def _get_photoshop_versions ( self ) -> List [ str ]: \"\"\"Retrieve a list of Photoshop version ID's from registry.\"\"\" with suppress ( OSError , IndexError ): key = self . _open_key ( self . _reg_path ) key_count = winreg . QueryInfoKey ( key )[ 0 ] versions = [ winreg . EnumKey ( key , i ) . split ( \".\" )[ 0 ] for i in range ( key_count )] # Sort from latest version to oldest, use blank version as a fallback return [ * sorted ( versions , reverse = True ), \"\" ] self . _logger . debug ( \"Unable to find Photoshop version number in HKEY_LOCAL_MACHINE registry!\" ) return [] def _get_application_object ( self , versions : List [ str ] = None ) -> Optional [ Dispatch ]: \"\"\" Try each version string until a valid Photoshop application Dispatch object is returned. Args: versions: List of Photoshop version ID's found in registry. Returns: Photoshop application Dispatch object. Raises: OSError: If a Dispatch object wasn't resolved. \"\"\" for v in versions : self . app_id = v with suppress ( OSError ): return CreateObject ( self . program_name , dynamic = True ) return \"\"\" * Public Methods \"\"\" def get_application_path ( self ) -> str : \"\"\"str: The absolute path of Photoshop installed location.\"\"\" key = self . open_key ( f \" { self . _reg_path } \\\\ { self . program_id } \" ) return winreg . QueryValueEx ( key , \"ApplicationPath\" )[ 0 ] def get_plugin_path ( self ) -> str : \"\"\"str: The absolute plugin path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Plug-ins\" ) def get_presets_path ( self ) -> str : \"\"\"str: The absolute presets path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Presets\" ) def get_script_path ( self ) -> str : \"\"\"str: The absolute scripts path of Photoshop.\"\"\" return os . path . join ( self . presets_path , \"Scripts\" ) def eval_javascript ( self , javascript : str , Arguments : Any = None , ExecutionMode : Any = None ) -> str : \"\"\"Instruct the application to execute javascript code.\"\"\" executor = self . adobe if self . _has_parent else self . app return executor . doJavaScript ( javascript , Arguments , ExecutionMode ) \"\"\" * Private Static Methods \"\"\" @staticmethod def _open_key ( key : str ) -> winreg . HKEYType : \"\"\"Open the register key. Args: key: Photoshop application key path. Returns: The handle to the specified key. Raises: OSError: if registry key cannot be read. \"\"\" machine_type = platform . machine () mappings = { \"AMD64\" : winreg . KEY_WOW64_64KEY } access = winreg . KEY_READ | mappings . get ( machine_type , winreg . KEY_WOW64_32KEY ) try : return winreg . OpenKey ( key = winreg . HKEY_LOCAL_MACHINE , sub_key = key , access = access ) except FileNotFoundError as err : raise OSError ( \"Failed to read the registration: < {path} > \\n \" \"Please check if you have Photoshop installed correctly.\" . format ( path = f \"HKEY_LOCAL_MACHINE \\\\ { key } \" ) ) from err","title":"Photoshop"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.app_id","text":"","title":"app_id"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.program_name","text":"Examples: Photoshop.ActionDescriptor Photoshop.ActionDescriptor.140 Photoshop.ActionList Photoshop.ActionList.140 Photoshop.ActionReference Photoshop.ActionReference.140 Photoshop.Application Photoshop.Application.140 Photoshop.BatchOptions Photoshop.BatchOptions.140 Photoshop.BitmapConversionOptions Photoshop.BMPSaveOptions Photoshop.BMPSaveOptions.140 Photoshop.CameraRAWOpenOptions Photoshop.CameraRAWOpenOptions.140","title":"program_name"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.typename","text":"","title":"typename"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.__init__","text":"Initialize the Photoshop core object. Parameters: Name Type Description Default ps_version Optional [ str ] Optional, Photoshop version to look for explicitly in registry. None parent Any Optional, parent instance to use as app object. None Source code in photoshop/api/_core.py 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 def __init__ ( self , ps_version : Optional [ str ] = None , parent : Any = None ): \"\"\" Initialize the Photoshop core object. Args: ps_version: Optional, Photoshop version to look for explicitly in registry. parent: Optional, parent instance to use as app object. \"\"\" # Establish the initial app and program ID ps_version = os . getenv ( \"PS_VERSION\" , ps_version ) self . _app_id = PHOTOSHOP_VERSION_MAPPINGS . get ( ps_version , \"\" ) self . _has_parent , self . adobe , self . app = False , None , None # Store current photoshop version if ps_version : os . environ [ \"PS_VERSION\" ] = ps_version # Establish the application object using provided version ID if self . app_id : self . app = self . _get_application_object ([ self . app_id ]) if not self . app : # Attempt unsuccessful self . _logger . debug ( f \"Unable to retrieve Photoshop object ' { self . typename } ' using version ' { ps_version } '.\" ) # Look for version ID in registry data if not self . app : versions = self . _get_photoshop_versions () self . app = self . _get_application_object ( versions ) if not self . app : # All attempts exhausted raise PhotoshopPythonAPIError ( \"Please check if you have Photoshop installed correctly.\" ) # Add the parent app object if parent : self . adobe = self . app self . app = parent self . _has_parent = True","title":"__init__()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.eval_javascript","text":"Instruct the application to execute javascript code. Source code in photoshop/api/_core.py 215 216 217 218 def eval_javascript ( self , javascript : str , Arguments : Any = None , ExecutionMode : Any = None ) -> str : \"\"\"Instruct the application to execute javascript code.\"\"\" executor = self . adobe if self . _has_parent else self . app return executor . doJavaScript ( javascript , Arguments , ExecutionMode )","title":"eval_javascript()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.get_application_path","text":"Source code in photoshop/api/_core.py 198 199 200 201 def get_application_path ( self ) -> str : \"\"\"str: The absolute path of Photoshop installed location.\"\"\" key = self . open_key ( f \" { self . _reg_path } \\\\ { self . program_id } \" ) return winreg . QueryValueEx ( key , \"ApplicationPath\" )[ 0 ]","title":"get_application_path()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.get_plugin_path","text":"Source code in photoshop/api/_core.py 203 204 205 def get_plugin_path ( self ) -> str : \"\"\"str: The absolute plugin path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Plug-ins\" )","title":"get_plugin_path()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.get_presets_path","text":"Source code in photoshop/api/_core.py 207 208 209 def get_presets_path ( self ) -> str : \"\"\"str: The absolute presets path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Presets\" )","title":"get_presets_path()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.get_script_path","text":"Source code in photoshop/api/_core.py 211 212 213 def get_script_path ( self ) -> str : \"\"\"str: The absolute scripts path of Photoshop.\"\"\" return os . path . join ( self . presets_path , \"Scripts\" )","title":"get_script_path()"},{"location":"reference/photoshop/api/_document/","text":"The active containment object for layers and all other objects. The basic canvas for the file. Access the object for the currently active document through Application.activeDocument. You can access other documents or iterate through all open documents using in the Application.documents collection. You can access individual documents in the list by index, or use Documents.getByName() to retrieve them by name. Create documents programmatically using the Documents.add() method. Document Bases: Photoshop The active containment object for the layers and all other objects in the script. the basic canvas for the file. Source code in photoshop/api/_document.py 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 class Document ( Photoshop ): \"\"\"The active containment object for the layers and all other objects in the script. the basic canvas for the file. \"\"\" # noqa: E501 object_name = \"Application\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"autoCount\" , \"changeMode\" , \"close\" , \"convertProfile\" , \"Flatten\" , \"mergeVisibleLayers\" , \"crop\" , \"export\" , \"duplicate\" , \"printOneCopy\" , \"rasterizeAllLayers\" , \"recordMeasurements\" , \"revealAll\" , \"save\" , \"saveAs\" , \"splitChannels\" , \"trap\" , \"trim\" , \"resizeImage\" , ) @property def artLayers ( self ) -> ArtLayers : return ArtLayers ( self . app . artLayers ) @property def activeLayer ( self ) -> PS_Layer : \"\"\"The selected layer.\"\"\" type_ = self . eval_javascript ( \"app.activeDocument.activeLayer.typename\" ) mappings = { \"LayerSet\" : LayerSet , \"ArtLayer\" : ArtLayer } func = mappings [ type_ ] return func ( self . app . activeLayer ) @activeLayer . setter def activeLayer ( self , layer ) -> NoReturn : \"\"\"Sets the select layer as active layer. Args: layer (._artlayer.ArtLayer or ._layerSet.LayerSet): The artLayer. \"\"\" self . app . activeLayer = layer @property def activeChannels ( self ): \"\"\"The selected channels.\"\"\" return self . app . activeChannels @activeChannels . setter def activeChannels ( self , channels ): self . app . activeChannels = channels @property def activeHistoryBrushSource ( self ): \"\"\"The history state to use with the history brush.\"\"\" return self . app . activeHistoryBrushSource @property def activeHistoryState ( self ): \"\"\"The current history state for this document.\"\"\" return self . app . activeHistoryState @activeHistoryState . setter def activeHistoryState ( self , state ): self . app . activeHistoryState = state @property def backgroundLayer ( self ): \"\"\"The background layer for the Document.\"\"\" return self . app . backgroundLayer @property def bitsPerChannel ( self ): \"\"\"The number of bits per channel.\"\"\" return self . app . bitsPerChannel @bitsPerChannel . setter def bitsPerChannel ( self , value ): self . app . bitsPerChannel = value @property def channels ( self ): return Channels ( self . app . channels ) @property def colorProfileName ( self ): \"\"\"The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile).\"\"\" return self . app . colorProfileName @colorProfileName . setter def colorProfileName ( self , name ): self . app . colorProfileName = name @property def colorProfileType ( self ): \"\"\"The type of color model that defines the working space of the Document.\"\"\" return self . app . colorProfileType @colorProfileType . setter def colorProfileType ( self , profile_type ): self . app . colorProfileType = profile_type @property def colorSamplers ( self ): \"\"\"The current color samplers associated with the Document.\"\"\" return self . app . colorSamplers @property def componentChannels ( self ): \"\"\"The color component channels for this Document.\"\"\" return self . app . componentChannels @property def countItems ( self ): \"\"\"The current count items in the Document.\"\"\" return self . app . countItems @property def fullName ( self ): \"\"\"The full path name of the Document.\"\"\" try : return Path ( self . app . fullName ) except COMError : self . eval_javascript ( 'alert (\"Please save your Document first!\",' '\" {} \")' . format ( self . name ), ) @property def height ( self ): \"\"\"The height of the Document.\"\"\" return self . app . Height @property def histogram ( self ): \"\"\"A histogram showing the number of pixels at each color intensity level for the composite channel.\"\"\" return self . app . Histogram @property def history_states ( self ): \"\"\"The history states collection in this Document.\"\"\" return self . app . HistoryStates @property def id ( self ): \"\"\"The unique ID of this Document.\"\"\" return self . app . Id @property def info ( self ): \"\"\"Metadata about the Document.\"\"\" return DocumentInfo ( self . app . info ) @property def layerComps ( self ): \"\"\"The layer comps collection in this Document.\"\"\" return LayerComps ( self . app . layerComps ) @property def layers ( self ): \"\"\"The layers collection in the Document.\"\"\" return Layers ( self . app . Layers ) @property def layerSets ( self ): \"\"\"The layer sets collection in the Document.\"\"\" return LayerSets ( self . app . layerSets ) @property def managed ( self ): \"\"\"If true, the Document is a workgroup Document.\"\"\" return self . app . Managed @property def measurement_scale ( self ): \"\"\"The measurement scale of the Document.\"\"\" return self . app . MeasurementScale @property def mode ( self ): \"\"\"The color profile.\"\"\" return self . app . Mode @property def name ( self ) -> str : \"\"\"The Document name.\"\"\" return self . app . name @property def parent ( self ): \"\"\"The object's container.\"\"\" return self . app . Parent @property def path ( self ) -> str : \"\"\"The path to the Document.\"\"\" try : return Path ( self . app . path ) except COMError : self . eval_javascript ( 'alert (\"Please save your Document first!\",' '\" {} \")' . format ( self . name ), ) @path . setter def path ( self , path : str ) -> NoReturn : self . app . fullName = path @property def pathItems ( self ): return self . app . pathItems @property def pixelAspectRatio ( self ): \"\"\"The (custom) pixel aspect ratio of the Document. Range: 0.100 to 10.000. \"\"\" return self . app . pixelAspectRatio @property def printSettings ( self ): \"\"\"Document print settings.\"\"\" return self . app . printSettings @property def quickMaskMode ( self ): \"\"\"If true, the document is in Quick Mask mode.\"\"\" return self . app . quickMaskMode @property def saved ( self ): \"\"\"If true, the Document been saved since the last change.\"\"\" return self . app . Saved @property def resolution ( self ): \"\"\"The resolution of the Document (in pixels per inch)\"\"\" return self . app . resolution @property def selection ( self ): \"\"\"The selected area of the Document.\"\"\" return Selection ( self . app . selection ) @property def typename ( self ): \"\"\"The class name of the object.\"\"\" return self . app . typename @property def cloudDocument ( self ): \"\"\"This document is in the cloud.\"\"\" return self . app . cloudDocument @property def cloudWorkAreaDirectory ( self ): \"\"\"Local directory for this cloud document.\"\"\" return self . app . cloudWorkAreaDirectory @property def width ( self ): return self . app . Width @property def xmpMetadata ( self ): \"\"\"The XMP properties of the Document. The Camera RAW settings are stored here.\"\"\" return self . app . xmpMetadata # Methods def autoCount ( self , * args , ** kwargs ): \"\"\"Counts the objects in the Document.\"\"\" return self . app . autoCount ( * args , ** kwargs ) def changeMode ( self , * args , ** kwargs ): \"\"\"Changes the mode of the Document.\"\"\" return self . app . changeMode ( * args , ** kwargs ) def close ( self , saving = SaveOptions . DoNotSaveChanges ): return self . app . close ( saving ) def convertProfile ( self ): return self . app . convertProfile () def flatten ( self ): \"\"\"Flattens all layers.\"\"\" return self . app . Flatten () def mergeVisibleLayers ( self ): \"\"\"Flattens all visible layers in the Document.\"\"\" return self . app . mergeVisibleLayers () def crop ( self , bounds : List [ int ], angle : Optional [ float ] = None , width : Optional [ int ] = None , height : Optional [ int ] = None , ): \"\"\"Crops the document. Args: bounds: Four coordinates for the region remaining after cropping. angle: The angle of cropping bounds. width: The width of the resulting document. height: The height of the resulting document. \"\"\" return self . app . crop ( bounds , angle , width , height ) def exportDocument ( self , file_path : str , exportAs : ExportType , options : Union [ ExportOptionsSaveForWeb ]): \"\"\"Exports the Document. Note: This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References: - https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working \"\"\" file_path = file_path . replace ( \" \\\\ \" , \"/\" ) self . app . export ( file_path , exportAs , options ) def duplicate ( self , name = None , merge_layers_only = False ): return Document ( self . app . duplicate ( name , merge_layers_only )) def paste ( self ): \"\"\"Pastes contents of the clipboard into the Document.\"\"\" self . eval_javascript ( \"app.activeDocument.paste()\" ) return self . activeLayer def print ( self ): \"\"\"Prints the document.\"\"\" return self . app . print () def printOneCopy ( self ): self . app . printOneCopy () def rasterizeAllLayers ( self ): return self . app . rasterizeAllLayers () def recordMeasurements ( self , source , dataPoints ): \"\"\"Records the measurements of document.\"\"\" self . app . recordMeasurements ( source , dataPoints ) def reveal_all ( self ): \"\"\"Expands the Document to show clipped sections.\"\"\" return self . app . revealAll () def save ( self ): \"\"\"Saves the Document.\"\"\" return self . app . save () def saveAs ( self , file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ): \"\"\"Saves the documents with the specified save options. Args: file_path (str): Absolute path of psd file. options (JPEGSaveOptions): Save options. asCopy (bool): \"\"\" return self . app . saveAs ( file_path , options , asCopy , extensionType ) def splitChannels ( self ): \"\"\"Splits the channels of the document.\"\"\" self . app . splitChannels () def suspendHistory ( self , historyString , javaScriptString ): \"\"\"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. \"\"\" self . eval_javascript ( f \"app.activeDocument.suspendHistory(' { historyString } ', ' { javaScriptString } ')\" ) def trap ( self , width : int ): \"\"\" Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. \"\"\" self . app . trap ( width ) def trim ( self , trim_type : TrimType , top : Optional [ bool ] = True , left : Optional [ bool ] = True , bottom : Optional [ bool ] = True , right : Optional [ bool ] = True , ): \"\"\"Trims the transparent area around the image on the specified sides of the canvas. Args: trim_type: The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels top: If true, trims away the top of the document. left: If true, trims away the left of the document. bottom: If true, trims away the bottom of the document. right: If true, trims away the right of the document. \"\"\" return self . app . trim ( trim_type , top , left , bottom , right ) def resizeImage ( self , width : int , height : int , resolution : int = 72 , automatic : int = 8 ): \"\"\"Changes the size of the image. Args: width: The desired width of the image. height: The desired height of the image. resolution: The resolution (in pixels per inch) automatic: Value for automatic. \"\"\" return self . app . resizeImage ( width , height , resolution , automatic ) activeChannels property writable The selected channels. activeHistoryBrushSource property The history state to use with the history brush. activeHistoryState property writable The current history state for this document. activeLayer : PS_Layer property writable The selected layer. backgroundLayer property The background layer for the Document. bitsPerChannel property writable The number of bits per channel. cloudDocument property This document is in the cloud. cloudWorkAreaDirectory property Local directory for this cloud document. colorProfileName property writable The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile). colorProfileType property writable The type of color model that defines the working space of the Document. colorSamplers property The current color samplers associated with the Document. componentChannels property The color component channels for this Document. countItems property The current count items in the Document. fullName property The full path name of the Document. height property The height of the Document. histogram property A histogram showing the number of pixels at each color intensity level for the composite channel. history_states property The history states collection in this Document. id property The unique ID of this Document. info property Metadata about the Document. layerComps property The layer comps collection in this Document. layerSets property The layer sets collection in the Document. layers property The layers collection in the Document. managed property If true, the Document is a workgroup Document. measurement_scale property The measurement scale of the Document. mode property The color profile. name : str property The Document name. parent property The object's container. path : str property writable The path to the Document. pixelAspectRatio property The (custom) pixel aspect ratio of the Document. Range: 0.100 to 10.000. printSettings property Document print settings. quickMaskMode property If true, the document is in Quick Mask mode. resolution property The resolution of the Document (in pixels per inch) saved property If true, the Document been saved since the last change. selection property The selected area of the Document. typename property The class name of the object. xmpMetadata property The XMP properties of the Document. The Camera RAW settings are stored here. autoCount ( * args , ** kwargs ) Counts the objects in the Document. Source code in photoshop/api/_document.py 336 337 338 def autoCount ( self , * args , ** kwargs ): \"\"\"Counts the objects in the Document.\"\"\" return self . app . autoCount ( * args , ** kwargs ) changeMode ( * args , ** kwargs ) Changes the mode of the Document. Source code in photoshop/api/_document.py 340 341 342 def changeMode ( self , * args , ** kwargs ): \"\"\"Changes the mode of the Document.\"\"\" return self . app . changeMode ( * args , ** kwargs ) crop ( bounds , angle = None , width = None , height = None ) Crops the document. Parameters: Name Type Description Default bounds List [ int ] Four coordinates for the region remaining after cropping. required angle Optional [ float ] The angle of cropping bounds. None width Optional [ int ] The width of the resulting document. None height Optional [ int ] The height of the resulting document. None Source code in photoshop/api/_document.py 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 def crop ( self , bounds : List [ int ], angle : Optional [ float ] = None , width : Optional [ int ] = None , height : Optional [ int ] = None , ): \"\"\"Crops the document. Args: bounds: Four coordinates for the region remaining after cropping. angle: The angle of cropping bounds. width: The width of the resulting document. height: The height of the resulting document. \"\"\" return self . app . crop ( bounds , angle , width , height ) exportDocument ( file_path , exportAs , options ) Exports the Document. Note This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working Source code in photoshop/api/_document.py 376 377 378 379 380 381 382 383 384 385 386 387 388 def exportDocument ( self , file_path : str , exportAs : ExportType , options : Union [ ExportOptionsSaveForWeb ]): \"\"\"Exports the Document. Note: This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References: - https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working \"\"\" file_path = file_path . replace ( \" \\\\ \" , \"/\" ) self . app . export ( file_path , exportAs , options ) flatten () Flattens all layers. Source code in photoshop/api/_document.py 350 351 352 def flatten ( self ): \"\"\"Flattens all layers.\"\"\" return self . app . Flatten () mergeVisibleLayers () Flattens all visible layers in the Document. Source code in photoshop/api/_document.py 354 355 356 def mergeVisibleLayers ( self ): \"\"\"Flattens all visible layers in the Document.\"\"\" return self . app . mergeVisibleLayers () paste () Pastes contents of the clipboard into the Document. Source code in photoshop/api/_document.py 393 394 395 396 def paste ( self ): \"\"\"Pastes contents of the clipboard into the Document.\"\"\" self . eval_javascript ( \"app.activeDocument.paste()\" ) return self . activeLayer print () Prints the document. Source code in photoshop/api/_document.py 398 399 400 def print ( self ): \"\"\"Prints the document.\"\"\" return self . app . print () recordMeasurements ( source , dataPoints ) Records the measurements of document. Source code in photoshop/api/_document.py 408 409 410 def recordMeasurements ( self , source , dataPoints ): \"\"\"Records the measurements of document.\"\"\" self . app . recordMeasurements ( source , dataPoints ) resizeImage ( width , height , resolution = 72 , automatic = 8 ) Changes the size of the image. Parameters: Name Type Description Default width int The desired width of the image. required height int The desired height of the image. required resolution int The resolution (in pixels per inch) 72 automatic int Value for automatic. 8 Source code in photoshop/api/_document.py 476 477 478 479 480 481 482 483 484 485 486 def resizeImage ( self , width : int , height : int , resolution : int = 72 , automatic : int = 8 ): \"\"\"Changes the size of the image. Args: width: The desired width of the image. height: The desired height of the image. resolution: The resolution (in pixels per inch) automatic: Value for automatic. \"\"\" return self . app . resizeImage ( width , height , resolution , automatic ) reveal_all () Expands the Document to show clipped sections. Source code in photoshop/api/_document.py 412 413 414 def reveal_all ( self ): \"\"\"Expands the Document to show clipped sections.\"\"\" return self . app . revealAll () save () Saves the Document. Source code in photoshop/api/_document.py 416 417 418 def save ( self ): \"\"\"Saves the Document.\"\"\" return self . app . save () saveAs ( file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ) Saves the documents with the specified save options. Parameters: Name Type Description Default file_path str Absolute path of psd file. required options JPEGSaveOptions Save options. required asCopy bool True Source code in photoshop/api/_document.py 420 421 422 423 424 425 426 427 428 def saveAs ( self , file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ): \"\"\"Saves the documents with the specified save options. Args: file_path (str): Absolute path of psd file. options (JPEGSaveOptions): Save options. asCopy (bool): \"\"\" return self . app . saveAs ( file_path , options , asCopy , extensionType ) splitChannels () Splits the channels of the document. Source code in photoshop/api/_document.py 430 431 432 def splitChannels ( self ): \"\"\"Splits the channels of the document.\"\"\" self . app . splitChannels () suspendHistory ( historyString , javaScriptString ) Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. Source code in photoshop/api/_document.py 434 435 436 437 438 439 440 def suspendHistory ( self , historyString , javaScriptString ): \"\"\"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. \"\"\" self . eval_javascript ( f \"app.activeDocument.suspendHistory(' { historyString } ', ' { javaScriptString } ')\" ) trap ( width ) Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. Source code in photoshop/api/_document.py 442 443 444 445 446 447 448 def trap ( self , width : int ): \"\"\" Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. \"\"\" self . app . trap ( width ) trim ( trim_type , top = True , left = True , bottom = True , right = True ) Trims the transparent area around the image on the specified sides of the canvas. Parameters: Name Type Description Default trim_type TrimType The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels required top Optional [ bool ] If true, trims away the top of the document. True left Optional [ bool ] If true, trims away the left of the document. True bottom Optional [ bool ] If true, trims away the bottom of the document. True right Optional [ bool ] If true, trims away the right of the document. True Source code in photoshop/api/_document.py 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 def trim ( self , trim_type : TrimType , top : Optional [ bool ] = True , left : Optional [ bool ] = True , bottom : Optional [ bool ] = True , right : Optional [ bool ] = True , ): \"\"\"Trims the transparent area around the image on the specified sides of the canvas. Args: trim_type: The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels top: If true, trims away the top of the document. left: If true, trims away the left of the document. bottom: If true, trims away the bottom of the document. right: If true, trims away the right of the document. \"\"\" return self . app . trim ( trim_type , top , left , bottom , right )","title":"document"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document","text":"Bases: Photoshop The active containment object for the layers and all other objects in the script. the basic canvas for the file. Source code in photoshop/api/_document.py 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 class Document ( Photoshop ): \"\"\"The active containment object for the layers and all other objects in the script. the basic canvas for the file. \"\"\" # noqa: E501 object_name = \"Application\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"autoCount\" , \"changeMode\" , \"close\" , \"convertProfile\" , \"Flatten\" , \"mergeVisibleLayers\" , \"crop\" , \"export\" , \"duplicate\" , \"printOneCopy\" , \"rasterizeAllLayers\" , \"recordMeasurements\" , \"revealAll\" , \"save\" , \"saveAs\" , \"splitChannels\" , \"trap\" , \"trim\" , \"resizeImage\" , ) @property def artLayers ( self ) -> ArtLayers : return ArtLayers ( self . app . artLayers ) @property def activeLayer ( self ) -> PS_Layer : \"\"\"The selected layer.\"\"\" type_ = self . eval_javascript ( \"app.activeDocument.activeLayer.typename\" ) mappings = { \"LayerSet\" : LayerSet , \"ArtLayer\" : ArtLayer } func = mappings [ type_ ] return func ( self . app . activeLayer ) @activeLayer . setter def activeLayer ( self , layer ) -> NoReturn : \"\"\"Sets the select layer as active layer. Args: layer (._artlayer.ArtLayer or ._layerSet.LayerSet): The artLayer. \"\"\" self . app . activeLayer = layer @property def activeChannels ( self ): \"\"\"The selected channels.\"\"\" return self . app . activeChannels @activeChannels . setter def activeChannels ( self , channels ): self . app . activeChannels = channels @property def activeHistoryBrushSource ( self ): \"\"\"The history state to use with the history brush.\"\"\" return self . app . activeHistoryBrushSource @property def activeHistoryState ( self ): \"\"\"The current history state for this document.\"\"\" return self . app . activeHistoryState @activeHistoryState . setter def activeHistoryState ( self , state ): self . app . activeHistoryState = state @property def backgroundLayer ( self ): \"\"\"The background layer for the Document.\"\"\" return self . app . backgroundLayer @property def bitsPerChannel ( self ): \"\"\"The number of bits per channel.\"\"\" return self . app . bitsPerChannel @bitsPerChannel . setter def bitsPerChannel ( self , value ): self . app . bitsPerChannel = value @property def channels ( self ): return Channels ( self . app . channels ) @property def colorProfileName ( self ): \"\"\"The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile).\"\"\" return self . app . colorProfileName @colorProfileName . setter def colorProfileName ( self , name ): self . app . colorProfileName = name @property def colorProfileType ( self ): \"\"\"The type of color model that defines the working space of the Document.\"\"\" return self . app . colorProfileType @colorProfileType . setter def colorProfileType ( self , profile_type ): self . app . colorProfileType = profile_type @property def colorSamplers ( self ): \"\"\"The current color samplers associated with the Document.\"\"\" return self . app . colorSamplers @property def componentChannels ( self ): \"\"\"The color component channels for this Document.\"\"\" return self . app . componentChannels @property def countItems ( self ): \"\"\"The current count items in the Document.\"\"\" return self . app . countItems @property def fullName ( self ): \"\"\"The full path name of the Document.\"\"\" try : return Path ( self . app . fullName ) except COMError : self . eval_javascript ( 'alert (\"Please save your Document first!\",' '\" {} \")' . format ( self . name ), ) @property def height ( self ): \"\"\"The height of the Document.\"\"\" return self . app . Height @property def histogram ( self ): \"\"\"A histogram showing the number of pixels at each color intensity level for the composite channel.\"\"\" return self . app . Histogram @property def history_states ( self ): \"\"\"The history states collection in this Document.\"\"\" return self . app . HistoryStates @property def id ( self ): \"\"\"The unique ID of this Document.\"\"\" return self . app . Id @property def info ( self ): \"\"\"Metadata about the Document.\"\"\" return DocumentInfo ( self . app . info ) @property def layerComps ( self ): \"\"\"The layer comps collection in this Document.\"\"\" return LayerComps ( self . app . layerComps ) @property def layers ( self ): \"\"\"The layers collection in the Document.\"\"\" return Layers ( self . app . Layers ) @property def layerSets ( self ): \"\"\"The layer sets collection in the Document.\"\"\" return LayerSets ( self . app . layerSets ) @property def managed ( self ): \"\"\"If true, the Document is a workgroup Document.\"\"\" return self . app . Managed @property def measurement_scale ( self ): \"\"\"The measurement scale of the Document.\"\"\" return self . app . MeasurementScale @property def mode ( self ): \"\"\"The color profile.\"\"\" return self . app . Mode @property def name ( self ) -> str : \"\"\"The Document name.\"\"\" return self . app . name @property def parent ( self ): \"\"\"The object's container.\"\"\" return self . app . Parent @property def path ( self ) -> str : \"\"\"The path to the Document.\"\"\" try : return Path ( self . app . path ) except COMError : self . eval_javascript ( 'alert (\"Please save your Document first!\",' '\" {} \")' . format ( self . name ), ) @path . setter def path ( self , path : str ) -> NoReturn : self . app . fullName = path @property def pathItems ( self ): return self . app . pathItems @property def pixelAspectRatio ( self ): \"\"\"The (custom) pixel aspect ratio of the Document. Range: 0.100 to 10.000. \"\"\" return self . app . pixelAspectRatio @property def printSettings ( self ): \"\"\"Document print settings.\"\"\" return self . app . printSettings @property def quickMaskMode ( self ): \"\"\"If true, the document is in Quick Mask mode.\"\"\" return self . app . quickMaskMode @property def saved ( self ): \"\"\"If true, the Document been saved since the last change.\"\"\" return self . app . Saved @property def resolution ( self ): \"\"\"The resolution of the Document (in pixels per inch)\"\"\" return self . app . resolution @property def selection ( self ): \"\"\"The selected area of the Document.\"\"\" return Selection ( self . app . selection ) @property def typename ( self ): \"\"\"The class name of the object.\"\"\" return self . app . typename @property def cloudDocument ( self ): \"\"\"This document is in the cloud.\"\"\" return self . app . cloudDocument @property def cloudWorkAreaDirectory ( self ): \"\"\"Local directory for this cloud document.\"\"\" return self . app . cloudWorkAreaDirectory @property def width ( self ): return self . app . Width @property def xmpMetadata ( self ): \"\"\"The XMP properties of the Document. The Camera RAW settings are stored here.\"\"\" return self . app . xmpMetadata # Methods def autoCount ( self , * args , ** kwargs ): \"\"\"Counts the objects in the Document.\"\"\" return self . app . autoCount ( * args , ** kwargs ) def changeMode ( self , * args , ** kwargs ): \"\"\"Changes the mode of the Document.\"\"\" return self . app . changeMode ( * args , ** kwargs ) def close ( self , saving = SaveOptions . DoNotSaveChanges ): return self . app . close ( saving ) def convertProfile ( self ): return self . app . convertProfile () def flatten ( self ): \"\"\"Flattens all layers.\"\"\" return self . app . Flatten () def mergeVisibleLayers ( self ): \"\"\"Flattens all visible layers in the Document.\"\"\" return self . app . mergeVisibleLayers () def crop ( self , bounds : List [ int ], angle : Optional [ float ] = None , width : Optional [ int ] = None , height : Optional [ int ] = None , ): \"\"\"Crops the document. Args: bounds: Four coordinates for the region remaining after cropping. angle: The angle of cropping bounds. width: The width of the resulting document. height: The height of the resulting document. \"\"\" return self . app . crop ( bounds , angle , width , height ) def exportDocument ( self , file_path : str , exportAs : ExportType , options : Union [ ExportOptionsSaveForWeb ]): \"\"\"Exports the Document. Note: This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References: - https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working \"\"\" file_path = file_path . replace ( \" \\\\ \" , \"/\" ) self . app . export ( file_path , exportAs , options ) def duplicate ( self , name = None , merge_layers_only = False ): return Document ( self . app . duplicate ( name , merge_layers_only )) def paste ( self ): \"\"\"Pastes contents of the clipboard into the Document.\"\"\" self . eval_javascript ( \"app.activeDocument.paste()\" ) return self . activeLayer def print ( self ): \"\"\"Prints the document.\"\"\" return self . app . print () def printOneCopy ( self ): self . app . printOneCopy () def rasterizeAllLayers ( self ): return self . app . rasterizeAllLayers () def recordMeasurements ( self , source , dataPoints ): \"\"\"Records the measurements of document.\"\"\" self . app . recordMeasurements ( source , dataPoints ) def reveal_all ( self ): \"\"\"Expands the Document to show clipped sections.\"\"\" return self . app . revealAll () def save ( self ): \"\"\"Saves the Document.\"\"\" return self . app . save () def saveAs ( self , file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ): \"\"\"Saves the documents with the specified save options. Args: file_path (str): Absolute path of psd file. options (JPEGSaveOptions): Save options. asCopy (bool): \"\"\" return self . app . saveAs ( file_path , options , asCopy , extensionType ) def splitChannels ( self ): \"\"\"Splits the channels of the document.\"\"\" self . app . splitChannels () def suspendHistory ( self , historyString , javaScriptString ): \"\"\"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. \"\"\" self . eval_javascript ( f \"app.activeDocument.suspendHistory(' { historyString } ', ' { javaScriptString } ')\" ) def trap ( self , width : int ): \"\"\" Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. \"\"\" self . app . trap ( width ) def trim ( self , trim_type : TrimType , top : Optional [ bool ] = True , left : Optional [ bool ] = True , bottom : Optional [ bool ] = True , right : Optional [ bool ] = True , ): \"\"\"Trims the transparent area around the image on the specified sides of the canvas. Args: trim_type: The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels top: If true, trims away the top of the document. left: If true, trims away the left of the document. bottom: If true, trims away the bottom of the document. right: If true, trims away the right of the document. \"\"\" return self . app . trim ( trim_type , top , left , bottom , right ) def resizeImage ( self , width : int , height : int , resolution : int = 72 , automatic : int = 8 ): \"\"\"Changes the size of the image. Args: width: The desired width of the image. height: The desired height of the image. resolution: The resolution (in pixels per inch) automatic: Value for automatic. \"\"\" return self . app . resizeImage ( width , height , resolution , automatic )","title":"Document"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.activeChannels","text":"The selected channels.","title":"activeChannels"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.activeHistoryBrushSource","text":"The history state to use with the history brush.","title":"activeHistoryBrushSource"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.activeHistoryState","text":"The current history state for this document.","title":"activeHistoryState"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.activeLayer","text":"The selected layer.","title":"activeLayer"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.backgroundLayer","text":"The background layer for the Document.","title":"backgroundLayer"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.bitsPerChannel","text":"The number of bits per channel.","title":"bitsPerChannel"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.cloudDocument","text":"This document is in the cloud.","title":"cloudDocument"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.cloudWorkAreaDirectory","text":"Local directory for this cloud document.","title":"cloudWorkAreaDirectory"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.colorProfileName","text":"The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile).","title":"colorProfileName"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.colorProfileType","text":"The type of color model that defines the working space of the Document.","title":"colorProfileType"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.colorSamplers","text":"The current color samplers associated with the Document.","title":"colorSamplers"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.componentChannels","text":"The color component channels for this Document.","title":"componentChannels"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.countItems","text":"The current count items in the Document.","title":"countItems"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.fullName","text":"The full path name of the Document.","title":"fullName"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.height","text":"The height of the Document.","title":"height"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.histogram","text":"A histogram showing the number of pixels at each color intensity level for the composite channel.","title":"histogram"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.history_states","text":"The history states collection in this Document.","title":"history_states"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.id","text":"The unique ID of this Document.","title":"id"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.info","text":"Metadata about the Document.","title":"info"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.layerComps","text":"The layer comps collection in this Document.","title":"layerComps"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.layerSets","text":"The layer sets collection in the Document.","title":"layerSets"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.layers","text":"The layers collection in the Document.","title":"layers"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.managed","text":"If true, the Document is a workgroup Document.","title":"managed"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.measurement_scale","text":"The measurement scale of the Document.","title":"measurement_scale"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.mode","text":"The color profile.","title":"mode"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.name","text":"The Document name.","title":"name"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.parent","text":"The object's container.","title":"parent"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.path","text":"The path to the Document.","title":"path"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.pixelAspectRatio","text":"The (custom) pixel aspect ratio of the Document. Range: 0.100 to 10.000.","title":"pixelAspectRatio"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.printSettings","text":"Document print settings.","title":"printSettings"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.quickMaskMode","text":"If true, the document is in Quick Mask mode.","title":"quickMaskMode"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.resolution","text":"The resolution of the Document (in pixels per inch)","title":"resolution"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.saved","text":"If true, the Document been saved since the last change.","title":"saved"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.selection","text":"The selected area of the Document.","title":"selection"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.typename","text":"The class name of the object.","title":"typename"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.xmpMetadata","text":"The XMP properties of the Document. The Camera RAW settings are stored here.","title":"xmpMetadata"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.autoCount","text":"Counts the objects in the Document. Source code in photoshop/api/_document.py 336 337 338 def autoCount ( self , * args , ** kwargs ): \"\"\"Counts the objects in the Document.\"\"\" return self . app . autoCount ( * args , ** kwargs )","title":"autoCount()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.changeMode","text":"Changes the mode of the Document. Source code in photoshop/api/_document.py 340 341 342 def changeMode ( self , * args , ** kwargs ): \"\"\"Changes the mode of the Document.\"\"\" return self . app . changeMode ( * args , ** kwargs )","title":"changeMode()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.crop","text":"Crops the document. Parameters: Name Type Description Default bounds List [ int ] Four coordinates for the region remaining after cropping. required angle Optional [ float ] The angle of cropping bounds. None width Optional [ int ] The width of the resulting document. None height Optional [ int ] The height of the resulting document. None Source code in photoshop/api/_document.py 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 def crop ( self , bounds : List [ int ], angle : Optional [ float ] = None , width : Optional [ int ] = None , height : Optional [ int ] = None , ): \"\"\"Crops the document. Args: bounds: Four coordinates for the region remaining after cropping. angle: The angle of cropping bounds. width: The width of the resulting document. height: The height of the resulting document. \"\"\" return self . app . crop ( bounds , angle , width , height )","title":"crop()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.exportDocument","text":"Exports the Document. Note This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working Source code in photoshop/api/_document.py 376 377 378 379 380 381 382 383 384 385 386 387 388 def exportDocument ( self , file_path : str , exportAs : ExportType , options : Union [ ExportOptionsSaveForWeb ]): \"\"\"Exports the Document. Note: This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References: - https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working \"\"\" file_path = file_path . replace ( \" \\\\ \" , \"/\" ) self . app . export ( file_path , exportAs , options )","title":"exportDocument()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.flatten","text":"Flattens all layers. Source code in photoshop/api/_document.py 350 351 352 def flatten ( self ): \"\"\"Flattens all layers.\"\"\" return self . app . Flatten ()","title":"flatten()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.mergeVisibleLayers","text":"Flattens all visible layers in the Document. Source code in photoshop/api/_document.py 354 355 356 def mergeVisibleLayers ( self ): \"\"\"Flattens all visible layers in the Document.\"\"\" return self . app . mergeVisibleLayers ()","title":"mergeVisibleLayers()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.paste","text":"Pastes contents of the clipboard into the Document. Source code in photoshop/api/_document.py 393 394 395 396 def paste ( self ): \"\"\"Pastes contents of the clipboard into the Document.\"\"\" self . eval_javascript ( \"app.activeDocument.paste()\" ) return self . activeLayer","title":"paste()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.print","text":"Prints the document. Source code in photoshop/api/_document.py 398 399 400 def print ( self ): \"\"\"Prints the document.\"\"\" return self . app . print ()","title":"print()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.recordMeasurements","text":"Records the measurements of document. Source code in photoshop/api/_document.py 408 409 410 def recordMeasurements ( self , source , dataPoints ): \"\"\"Records the measurements of document.\"\"\" self . app . recordMeasurements ( source , dataPoints )","title":"recordMeasurements()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.resizeImage","text":"Changes the size of the image. Parameters: Name Type Description Default width int The desired width of the image. required height int The desired height of the image. required resolution int The resolution (in pixels per inch) 72 automatic int Value for automatic. 8 Source code in photoshop/api/_document.py 476 477 478 479 480 481 482 483 484 485 486 def resizeImage ( self , width : int , height : int , resolution : int = 72 , automatic : int = 8 ): \"\"\"Changes the size of the image. Args: width: The desired width of the image. height: The desired height of the image. resolution: The resolution (in pixels per inch) automatic: Value for automatic. \"\"\" return self . app . resizeImage ( width , height , resolution , automatic )","title":"resizeImage()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.reveal_all","text":"Expands the Document to show clipped sections. Source code in photoshop/api/_document.py 412 413 414 def reveal_all ( self ): \"\"\"Expands the Document to show clipped sections.\"\"\" return self . app . revealAll ()","title":"reveal_all()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.save","text":"Saves the Document. Source code in photoshop/api/_document.py 416 417 418 def save ( self ): \"\"\"Saves the Document.\"\"\" return self . app . save ()","title":"save()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.saveAs","text":"Saves the documents with the specified save options. Parameters: Name Type Description Default file_path str Absolute path of psd file. required options JPEGSaveOptions Save options. required asCopy bool True Source code in photoshop/api/_document.py 420 421 422 423 424 425 426 427 428 def saveAs ( self , file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ): \"\"\"Saves the documents with the specified save options. Args: file_path (str): Absolute path of psd file. options (JPEGSaveOptions): Save options. asCopy (bool): \"\"\" return self . app . saveAs ( file_path , options , asCopy , extensionType )","title":"saveAs()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.splitChannels","text":"Splits the channels of the document. Source code in photoshop/api/_document.py 430 431 432 def splitChannels ( self ): \"\"\"Splits the channels of the document.\"\"\" self . app . splitChannels ()","title":"splitChannels()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.suspendHistory","text":"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. Source code in photoshop/api/_document.py 434 435 436 437 438 439 440 def suspendHistory ( self , historyString , javaScriptString ): \"\"\"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. \"\"\" self . eval_javascript ( f \"app.activeDocument.suspendHistory(' { historyString } ', ' { javaScriptString } ')\" )","title":"suspendHistory()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.trap","text":"Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. Source code in photoshop/api/_document.py 442 443 444 445 446 447 448 def trap ( self , width : int ): \"\"\" Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. \"\"\" self . app . trap ( width )","title":"trap()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.trim","text":"Trims the transparent area around the image on the specified sides of the canvas. Parameters: Name Type Description Default trim_type TrimType The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels required top Optional [ bool ] If true, trims away the top of the document. True left Optional [ bool ] If true, trims away the left of the document. True bottom Optional [ bool ] If true, trims away the bottom of the document. True right Optional [ bool ] If true, trims away the right of the document. True Source code in photoshop/api/_document.py 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 def trim ( self , trim_type : TrimType , top : Optional [ bool ] = True , left : Optional [ bool ] = True , bottom : Optional [ bool ] = True , right : Optional [ bool ] = True , ): \"\"\"Trims the transparent area around the image on the specified sides of the canvas. Args: trim_type: The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels top: If true, trims away the top of the document. left: If true, trims away the left of the document. bottom: If true, trims away the bottom of the document. right: If true, trims away the right of the document. \"\"\" return self . app . trim ( trim_type , top , left , bottom , right )","title":"trim()"},{"location":"reference/photoshop/api/_documentinfo/","text":"Metadata about a document object. These values can be set by selecting File > File Info in the Adobe Photoshop application. DocumentInfo Bases: Photoshop Metadata about a document object. Source code in photoshop/api/_documentinfo.py 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 class DocumentInfo ( Photoshop ): \"\"\"Metadata about a document object.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) def __str__ ( self ): return pformat ( { \"author\" : self . author , \"authorPosition\" : self . authorPosition , \"caption\" : self . caption , \"captionWriter\" : self . captionWriter , \"category\" : self . category , \"city\" : self . city , \"country\" : self . country , \"copyrightNotice\" : self . copyrightNotice , \"copyrighted\" : self . copyrighted , \"creationDate\" : self . creationDate , \"credit\" : self . credit , \"exif\" : self . exif , \"headline\" : self . headline , \"instructions\" : self . instructions , \"jobName\" : self . jobName , \"keywords\" : self . keywords , \"provinceState\" : self . provinceState , \"source\" : self . source , \"ownerUrl\" : self . ownerUrl , \"supplementalCategories\" : self . supplementalCategories , \"title\" : self . title , \"transmissionReference\" : self . transmissionReference , \"urgency\" : self . urgency , } ) @property def author ( self ): \"\"\"str: The author.\"\"\" return self . app . author @author . setter def author ( self , name ): self . app . author = name @property def authorPosition ( self ): \"\"\"str:The author\u2019s position.\"\"\" return self . app . authorPosition @authorPosition . setter def authorPosition ( self , name ): self . app . authorPosition = name @property def caption ( self ): return self . app . caption @caption . setter def caption ( self , name ): self . app . caption = name @property def captionWriter ( self ): return self . app . captionWriter @captionWriter . setter def captionWriter ( self , name ): self . app . captionWriter = name @property def category ( self ): \"\"\"str: The document category.\"\"\" return self . app . category @category . setter def category ( self , name ): self . app . category = name @property def city ( self ): return self . app . city @city . setter def city ( self , city_name ): self . app . city = city_name @property def copyrightNotice ( self ): \"\"\"str: The copyright notice.\"\"\" return self . app . copyrightNotice @copyrightNotice . setter def copyrightNotice ( self , name ): self . app . copyrightNotice = name @property def copyrighted ( self ): \"\"\"str: The copyright status.\"\"\" return self . app . copyrighted @copyrighted . setter def copyrighted ( self , info ): self . app . copyrighted = info @property def country ( self ): return self . app . country @country . setter def country ( self , name ): self . app . country = name @property def creationDate ( self ): return self . app . creationDate @creationDate . setter def creationDate ( self , name ): self . app . creationDate = name @property def credit ( self ): \"\"\"str: The author credit.\"\"\" return self . app . credit @credit . setter def credit ( self , value ): self . app . credit = value @property def exif ( self ): return self . app . exif @exif . setter def exif ( self , info ): self . app . exif = info @property def headline ( self ): return self . app . headline @headline . setter def headline ( self , value ): self . app . headline = value @property def instructions ( self ): return self . app . instructions @instructions . setter def instructions ( self , value ): self . app . instructions = value @property def jobName ( self ): return self . app . jobName @jobName . setter def jobName ( self , job ): self . app . jobName = job @property def keywords ( self ): return self . app . keywords @keywords . setter def keywords ( self , words ): self . app . keywords = words @property def ownerUrl ( self ): return self . app . ownerUrl @ownerUrl . setter def ownerUrl ( self , url ): self . app . ownerUrl = url @property def provinceState ( self ): \"\"\"str: The state or province.\"\"\" return self . app . provinceState @provinceState . setter def provinceState ( self , state_name ): self . app . provinceState = state_name @property def source ( self ): return self . app . source @source . setter def source ( self , source_name ): self . app . source = source_name @property def supplementalCategories ( self ): \"\"\"str: Other categories.\"\"\" return self . app . supplementalCategories @supplementalCategories . setter def supplementalCategories ( self , info ): self . app . supplementalCategories = info @property def title ( self ): return self . app . title @title . setter def title ( self , name ): self . app . title = name @property def transmissionReference ( self ): \"\"\"str: The transmission reference.\"\"\" return self . app . transmissionReference @transmissionReference . setter def transmissionReference ( self , reference ): self . app . transmissionReference = reference @property def urgency ( self ): \"\"\"The document urgency.\"\"\" return self . app . urgency @urgency . setter def urgency ( self , status ): self . app . urgency = status author property writable authorPosition property writable category property writable copyrightNotice property writable copyrighted property writable credit property writable provinceState property writable supplementalCategories property writable transmissionReference property writable urgency property writable The document urgency.","title":"documentinfo"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo","text":"Bases: Photoshop Metadata about a document object. Source code in photoshop/api/_documentinfo.py 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 class DocumentInfo ( Photoshop ): \"\"\"Metadata about a document object.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) def __str__ ( self ): return pformat ( { \"author\" : self . author , \"authorPosition\" : self . authorPosition , \"caption\" : self . caption , \"captionWriter\" : self . captionWriter , \"category\" : self . category , \"city\" : self . city , \"country\" : self . country , \"copyrightNotice\" : self . copyrightNotice , \"copyrighted\" : self . copyrighted , \"creationDate\" : self . creationDate , \"credit\" : self . credit , \"exif\" : self . exif , \"headline\" : self . headline , \"instructions\" : self . instructions , \"jobName\" : self . jobName , \"keywords\" : self . keywords , \"provinceState\" : self . provinceState , \"source\" : self . source , \"ownerUrl\" : self . ownerUrl , \"supplementalCategories\" : self . supplementalCategories , \"title\" : self . title , \"transmissionReference\" : self . transmissionReference , \"urgency\" : self . urgency , } ) @property def author ( self ): \"\"\"str: The author.\"\"\" return self . app . author @author . setter def author ( self , name ): self . app . author = name @property def authorPosition ( self ): \"\"\"str:The author\u2019s position.\"\"\" return self . app . authorPosition @authorPosition . setter def authorPosition ( self , name ): self . app . authorPosition = name @property def caption ( self ): return self . app . caption @caption . setter def caption ( self , name ): self . app . caption = name @property def captionWriter ( self ): return self . app . captionWriter @captionWriter . setter def captionWriter ( self , name ): self . app . captionWriter = name @property def category ( self ): \"\"\"str: The document category.\"\"\" return self . app . category @category . setter def category ( self , name ): self . app . category = name @property def city ( self ): return self . app . city @city . setter def city ( self , city_name ): self . app . city = city_name @property def copyrightNotice ( self ): \"\"\"str: The copyright notice.\"\"\" return self . app . copyrightNotice @copyrightNotice . setter def copyrightNotice ( self , name ): self . app . copyrightNotice = name @property def copyrighted ( self ): \"\"\"str: The copyright status.\"\"\" return self . app . copyrighted @copyrighted . setter def copyrighted ( self , info ): self . app . copyrighted = info @property def country ( self ): return self . app . country @country . setter def country ( self , name ): self . app . country = name @property def creationDate ( self ): return self . app . creationDate @creationDate . setter def creationDate ( self , name ): self . app . creationDate = name @property def credit ( self ): \"\"\"str: The author credit.\"\"\" return self . app . credit @credit . setter def credit ( self , value ): self . app . credit = value @property def exif ( self ): return self . app . exif @exif . setter def exif ( self , info ): self . app . exif = info @property def headline ( self ): return self . app . headline @headline . setter def headline ( self , value ): self . app . headline = value @property def instructions ( self ): return self . app . instructions @instructions . setter def instructions ( self , value ): self . app . instructions = value @property def jobName ( self ): return self . app . jobName @jobName . setter def jobName ( self , job ): self . app . jobName = job @property def keywords ( self ): return self . app . keywords @keywords . setter def keywords ( self , words ): self . app . keywords = words @property def ownerUrl ( self ): return self . app . ownerUrl @ownerUrl . setter def ownerUrl ( self , url ): self . app . ownerUrl = url @property def provinceState ( self ): \"\"\"str: The state or province.\"\"\" return self . app . provinceState @provinceState . setter def provinceState ( self , state_name ): self . app . provinceState = state_name @property def source ( self ): return self . app . source @source . setter def source ( self , source_name ): self . app . source = source_name @property def supplementalCategories ( self ): \"\"\"str: Other categories.\"\"\" return self . app . supplementalCategories @supplementalCategories . setter def supplementalCategories ( self , info ): self . app . supplementalCategories = info @property def title ( self ): return self . app . title @title . setter def title ( self , name ): self . app . title = name @property def transmissionReference ( self ): \"\"\"str: The transmission reference.\"\"\" return self . app . transmissionReference @transmissionReference . setter def transmissionReference ( self , reference ): self . app . transmissionReference = reference @property def urgency ( self ): \"\"\"The document urgency.\"\"\" return self . app . urgency @urgency . setter def urgency ( self , status ): self . app . urgency = status","title":"DocumentInfo"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.author","text":"","title":"author"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.authorPosition","text":"","title":"authorPosition"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.category","text":"","title":"category"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.copyrightNotice","text":"","title":"copyrightNotice"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.copyrighted","text":"","title":"copyrighted"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.credit","text":"","title":"credit"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.provinceState","text":"","title":"provinceState"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.supplementalCategories","text":"","title":"supplementalCategories"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.transmissionReference","text":"","title":"transmissionReference"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.urgency","text":"The document urgency.","title":"urgency"},{"location":"reference/photoshop/api/_documents/","text":"Documents Bases: Photoshop The collection of open documents. Source code in photoshop/api/_documents.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 class Documents ( Photoshop ): \"\"\"The collection of open documents.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" ) def __len__ ( self ) -> int : return self . length def add ( self , width : int = 960 , height : int = 540 , resolution : float = 72.0 , name : str = None , mode : int = NewDocumentMode . NewRGB , initialFill : int = DocumentFill . White , pixelAspectRatio : float = 1.0 , bitsPerChannel : int = BitsPerChannelType . Document8Bits , colorProfileName : str = None , ) -> Document : \"\"\"Creates a new document object and adds it to this collections. Args: width (int): The width of the document. height (int): The height of the document. resolution (int): The resolution of the document (in pixels per inch) name (str): The name of the document. mode (): The document mode. initialFill : The initial fill of the document. pixelAspectRatio: The initial pixel aspect ratio of the document. Default is `1.0`, the range is `0.1-10.00`. bitsPerChannel: The number of bits per channel. colorProfileName: The name of color profile for document. Returns: .Document: Document instance. \"\"\" return Document ( self . app . add ( width , height , resolution , name , mode , initialFill , pixelAspectRatio , bitsPerChannel , colorProfileName , ) ) def __iter__ ( self ) -> Document : for doc in self . app : self . adobe . activeDocument = doc yield Document ( doc ) def __getitem__ ( self , item ) -> Document : try : return Document ( self . app [ item ]) except IndexError : raise PhotoshopPythonAPIError ( \"Currently Photoshop did not find Documents.\" ) @property def length ( self ) -> int : return len ( list ( self . app )) def getByName ( self , document_name : str ) -> Document : \"\"\"Get document by given document name.\"\"\" for doc in self . app : if doc . name == document_name : return Document ( doc ) raise PhotoshopPythonAPIError ( f 'Could not find a document named \" { document_name } \"' ) add ( width = 960 , height = 540 , resolution = 72.0 , name = None , mode = NewDocumentMode . NewRGB , initialFill = DocumentFill . White , pixelAspectRatio = 1.0 , bitsPerChannel = BitsPerChannelType . Document8Bits , colorProfileName = None ) Creates a new document object and adds it to this collections. Parameters: Name Type Description Default width int The width of the document. 960 height int The height of the document. 540 resolution int The resolution of the document (in pixels per inch) 72.0 name str The name of the document. None mode The document mode. NewRGB initialFill The initial fill of the document. White pixelAspectRatio float The initial pixel aspect ratio of the document. Default is 1.0 , the range is 0.1-10.00 . 1.0 bitsPerChannel int The number of bits per channel. Document8Bits colorProfileName str The name of color profile for document. None Returns: Type Description Document .Document: Document instance. Source code in photoshop/api/_documents.py 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 def add ( self , width : int = 960 , height : int = 540 , resolution : float = 72.0 , name : str = None , mode : int = NewDocumentMode . NewRGB , initialFill : int = DocumentFill . White , pixelAspectRatio : float = 1.0 , bitsPerChannel : int = BitsPerChannelType . Document8Bits , colorProfileName : str = None , ) -> Document : \"\"\"Creates a new document object and adds it to this collections. Args: width (int): The width of the document. height (int): The height of the document. resolution (int): The resolution of the document (in pixels per inch) name (str): The name of the document. mode (): The document mode. initialFill : The initial fill of the document. pixelAspectRatio: The initial pixel aspect ratio of the document. Default is `1.0`, the range is `0.1-10.00`. bitsPerChannel: The number of bits per channel. colorProfileName: The name of color profile for document. Returns: .Document: Document instance. \"\"\" return Document ( self . app . add ( width , height , resolution , name , mode , initialFill , pixelAspectRatio , bitsPerChannel , colorProfileName , ) ) getByName ( document_name ) Get document by given document name. Source code in photoshop/api/_documents.py 80 81 82 83 84 85 def getByName ( self , document_name : str ) -> Document : \"\"\"Get document by given document name.\"\"\" for doc in self . app : if doc . name == document_name : return Document ( doc ) raise PhotoshopPythonAPIError ( f 'Could not find a document named \" { document_name } \"' )","title":"documents"},{"location":"reference/photoshop/api/_documents/#photoshop.api._documents.Documents","text":"Bases: Photoshop The collection of open documents. Source code in photoshop/api/_documents.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 class Documents ( Photoshop ): \"\"\"The collection of open documents.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" ) def __len__ ( self ) -> int : return self . length def add ( self , width : int = 960 , height : int = 540 , resolution : float = 72.0 , name : str = None , mode : int = NewDocumentMode . NewRGB , initialFill : int = DocumentFill . White , pixelAspectRatio : float = 1.0 , bitsPerChannel : int = BitsPerChannelType . Document8Bits , colorProfileName : str = None , ) -> Document : \"\"\"Creates a new document object and adds it to this collections. Args: width (int): The width of the document. height (int): The height of the document. resolution (int): The resolution of the document (in pixels per inch) name (str): The name of the document. mode (): The document mode. initialFill : The initial fill of the document. pixelAspectRatio: The initial pixel aspect ratio of the document. Default is `1.0`, the range is `0.1-10.00`. bitsPerChannel: The number of bits per channel. colorProfileName: The name of color profile for document. Returns: .Document: Document instance. \"\"\" return Document ( self . app . add ( width , height , resolution , name , mode , initialFill , pixelAspectRatio , bitsPerChannel , colorProfileName , ) ) def __iter__ ( self ) -> Document : for doc in self . app : self . adobe . activeDocument = doc yield Document ( doc ) def __getitem__ ( self , item ) -> Document : try : return Document ( self . app [ item ]) except IndexError : raise PhotoshopPythonAPIError ( \"Currently Photoshop did not find Documents.\" ) @property def length ( self ) -> int : return len ( list ( self . app )) def getByName ( self , document_name : str ) -> Document : \"\"\"Get document by given document name.\"\"\" for doc in self . app : if doc . name == document_name : return Document ( doc ) raise PhotoshopPythonAPIError ( f 'Could not find a document named \" { document_name } \"' )","title":"Documents"},{"location":"reference/photoshop/api/_documents/#photoshop.api._documents.Documents.add","text":"Creates a new document object and adds it to this collections. Parameters: Name Type Description Default width int The width of the document. 960 height int The height of the document. 540 resolution int The resolution of the document (in pixels per inch) 72.0 name str The name of the document. None mode The document mode. NewRGB initialFill The initial fill of the document. White pixelAspectRatio float The initial pixel aspect ratio of the document. Default is 1.0 , the range is 0.1-10.00 . 1.0 bitsPerChannel int The number of bits per channel. Document8Bits colorProfileName str The name of color profile for document. None Returns: Type Description Document .Document: Document instance. Source code in photoshop/api/_documents.py 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 def add ( self , width : int = 960 , height : int = 540 , resolution : float = 72.0 , name : str = None , mode : int = NewDocumentMode . NewRGB , initialFill : int = DocumentFill . White , pixelAspectRatio : float = 1.0 , bitsPerChannel : int = BitsPerChannelType . Document8Bits , colorProfileName : str = None , ) -> Document : \"\"\"Creates a new document object and adds it to this collections. Args: width (int): The width of the document. height (int): The height of the document. resolution (int): The resolution of the document (in pixels per inch) name (str): The name of the document. mode (): The document mode. initialFill : The initial fill of the document. pixelAspectRatio: The initial pixel aspect ratio of the document. Default is `1.0`, the range is `0.1-10.00`. bitsPerChannel: The number of bits per channel. colorProfileName: The name of color profile for document. Returns: .Document: Document instance. \"\"\" return Document ( self . app . add ( width , height , resolution , name , mode , initialFill , pixelAspectRatio , bitsPerChannel , colorProfileName , ) )","title":"add()"},{"location":"reference/photoshop/api/_documents/#photoshop.api._documents.Documents.getByName","text":"Get document by given document name. Source code in photoshop/api/_documents.py 80 81 82 83 84 85 def getByName ( self , document_name : str ) -> Document : \"\"\"Get document by given document name.\"\"\" for doc in self . app : if doc . name == document_name : return Document ( doc ) raise PhotoshopPythonAPIError ( f 'Could not find a document named \" { document_name } \"' )","title":"getByName()"},{"location":"reference/photoshop/api/_layerComp/","text":"LayerComp Bases: Photoshop A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions). Source code in photoshop/api/_layerComp.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 class LayerComp ( Photoshop ): \"\"\"A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions).\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"apply\" , \"recapture\" , \"remove\" , \"resetfromComp\" , ) def __len__ ( self ): return self . length @property def appearance ( self ): return self . app . appearance @appearance . setter def appearance ( self , value ): self . app . appearance = value @property def childLayerCompState ( self ): return self . app . childLayerCompState @childLayerCompState . setter def childLayerCompState ( self , value ): self . app . childLayerCompState = value @property def comment ( self ): return self . app . comment @comment . setter def comment ( self , text ): self . app . comment = text @property def name ( self ): return self . app . name @name . setter def name ( self , text ): self . app . name = text @property def parent ( self ): return self . app . parent @property def position ( self ): return self . app . position @position . setter def position ( self , value ): self . app . position = value @property def selected ( self ): \"\"\"True if the layer comp is currently selected.\"\"\" return self . app . selected @selected . setter def selected ( self , value ): self . app . selected = value @property def typename ( self ): return self . app . typename @property def visibility ( self ): \"\"\"True to use layer visibility settings.\"\"\" return self . app . visibility @visibility . setter def visibility ( self , value ): self . app . visibility = value def apply ( self ): \"\"\"Applies the layer comp to the document.\"\"\" self . app . apply () def recapture ( self ): \"\"\"Recaptures the current layer state(s) for this layer comp.\"\"\" self . app . recapture () def remove ( self ): \"\"\"Deletes the layerComp object.\"\"\" self . app . remove () def resetfromComp ( self ): \"\"\"Resets the layer comp state to thedocument state.\"\"\" self . app . resetfromComp () selected property writable True if the layer comp is currently selected. visibility property writable True to use layer visibility settings. apply () Applies the layer comp to the document. Source code in photoshop/api/_layerComp.py 86 87 88 def apply ( self ): \"\"\"Applies the layer comp to the document.\"\"\" self . app . apply () recapture () Recaptures the current layer state(s) for this layer comp. Source code in photoshop/api/_layerComp.py 90 91 92 def recapture ( self ): \"\"\"Recaptures the current layer state(s) for this layer comp.\"\"\" self . app . recapture () remove () Deletes the layerComp object. Source code in photoshop/api/_layerComp.py 94 95 96 def remove ( self ): \"\"\"Deletes the layerComp object.\"\"\" self . app . remove () resetfromComp () Resets the layer comp state to thedocument state. Source code in photoshop/api/_layerComp.py 98 99 100 def resetfromComp ( self ): \"\"\"Resets the layer comp state to thedocument state.\"\"\" self . app . resetfromComp ()","title":"layerComp"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp","text":"Bases: Photoshop A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions). Source code in photoshop/api/_layerComp.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 class LayerComp ( Photoshop ): \"\"\"A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions).\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"apply\" , \"recapture\" , \"remove\" , \"resetfromComp\" , ) def __len__ ( self ): return self . length @property def appearance ( self ): return self . app . appearance @appearance . setter def appearance ( self , value ): self . app . appearance = value @property def childLayerCompState ( self ): return self . app . childLayerCompState @childLayerCompState . setter def childLayerCompState ( self , value ): self . app . childLayerCompState = value @property def comment ( self ): return self . app . comment @comment . setter def comment ( self , text ): self . app . comment = text @property def name ( self ): return self . app . name @name . setter def name ( self , text ): self . app . name = text @property def parent ( self ): return self . app . parent @property def position ( self ): return self . app . position @position . setter def position ( self , value ): self . app . position = value @property def selected ( self ): \"\"\"True if the layer comp is currently selected.\"\"\" return self . app . selected @selected . setter def selected ( self , value ): self . app . selected = value @property def typename ( self ): return self . app . typename @property def visibility ( self ): \"\"\"True to use layer visibility settings.\"\"\" return self . app . visibility @visibility . setter def visibility ( self , value ): self . app . visibility = value def apply ( self ): \"\"\"Applies the layer comp to the document.\"\"\" self . app . apply () def recapture ( self ): \"\"\"Recaptures the current layer state(s) for this layer comp.\"\"\" self . app . recapture () def remove ( self ): \"\"\"Deletes the layerComp object.\"\"\" self . app . remove () def resetfromComp ( self ): \"\"\"Resets the layer comp state to thedocument state.\"\"\" self . app . resetfromComp ()","title":"LayerComp"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.selected","text":"True if the layer comp is currently selected.","title":"selected"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.visibility","text":"True to use layer visibility settings.","title":"visibility"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.apply","text":"Applies the layer comp to the document. Source code in photoshop/api/_layerComp.py 86 87 88 def apply ( self ): \"\"\"Applies the layer comp to the document.\"\"\" self . app . apply ()","title":"apply()"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.recapture","text":"Recaptures the current layer state(s) for this layer comp. Source code in photoshop/api/_layerComp.py 90 91 92 def recapture ( self ): \"\"\"Recaptures the current layer state(s) for this layer comp.\"\"\" self . app . recapture ()","title":"recapture()"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.remove","text":"Deletes the layerComp object. Source code in photoshop/api/_layerComp.py 94 95 96 def remove ( self ): \"\"\"Deletes the layerComp object.\"\"\" self . app . remove ()","title":"remove()"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.resetfromComp","text":"Resets the layer comp state to thedocument state. Source code in photoshop/api/_layerComp.py 98 99 100 def resetfromComp ( self ): \"\"\"Resets the layer comp state to thedocument state.\"\"\" self . app . resetfromComp ()","title":"resetfromComp()"},{"location":"reference/photoshop/api/_layerComps/","text":"LayerComps Bases: Photoshop The layer comps collection in this document. Source code in photoshop/api/_layerComps.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 class LayerComps ( Photoshop ): \"\"\"The layer comps collection in this document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"removeAll\" , ) def __len__ ( self ): return self . length @property def length ( self ): return len ( self . _layers ) @property def _layers ( self ): return list ( self . app ) @property def parent ( self ): return self . app . parent @property def typename ( self ): return self . app . typename def add ( self , name , comment = \"No Comment.\" , appearance = True , position = True , visibility = True , childLayerCompStat = False , ): return LayerComp ( self . app . add ( name , comment , appearance , position , visibility , childLayerCompStat )) def getByName ( self , name ): for layer in self . _layers : if layer . name == name : return LayerComp ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a layer named \" { name } \"' ) def removeAll ( self ): self . app . removeAll () def __iter__ ( self ): for layer in self . _layers : yield LayerComp ( layer )","title":"layerComps"},{"location":"reference/photoshop/api/_layerComps/#photoshop.api._layerComps.LayerComps","text":"Bases: Photoshop The layer comps collection in this document. Source code in photoshop/api/_layerComps.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 class LayerComps ( Photoshop ): \"\"\"The layer comps collection in this document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"removeAll\" , ) def __len__ ( self ): return self . length @property def length ( self ): return len ( self . _layers ) @property def _layers ( self ): return list ( self . app ) @property def parent ( self ): return self . app . parent @property def typename ( self ): return self . app . typename def add ( self , name , comment = \"No Comment.\" , appearance = True , position = True , visibility = True , childLayerCompStat = False , ): return LayerComp ( self . app . add ( name , comment , appearance , position , visibility , childLayerCompStat )) def getByName ( self , name ): for layer in self . _layers : if layer . name == name : return LayerComp ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a layer named \" { name } \"' ) def removeAll ( self ): self . app . removeAll () def __iter__ ( self ): for layer in self . _layers : yield LayerComp ( layer )","title":"LayerComps"},{"location":"reference/photoshop/api/_layerSet/","text":"LayerSet Bases: Photoshop A group of layer objects, which can include art layer objects and other (nested) layer set objects. A single command or set of commands manipulates all layers in a layer set object. Source code in photoshop/api/_layerSet.py 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 class LayerSet ( Photoshop ): \"\"\"A group of layer objects, which can include art layer objects and other (nested) layer set objects. A single command or set of commands manipulates all layers in a layer set object. \"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"merge\" , \"duplicate\" , \"add\" , \"delete\" , \"link\" , \"move\" , \"resize\" , \"rotate\" , \"translate\" , \"unlink\" , ) @property def allLocked ( self ): return self . app . allLocked @allLocked . setter def allLocked ( self , value ): self . app . allLocked = value @property def artLayers ( self ): return ArtLayers ( self . app . artLayers ) @property def blendMode ( self ): return BlendMode ( self . app . blendMode ) @property def bounds ( self ): \"\"\"The bounding rectangle of the layer set.\"\"\" return self . app . bounds @property def enabledChannels ( self ): return self . app . enabledChannels @enabledChannels . setter def enabledChannels ( self , value ): self . app . enabledChannels = value @property def layers ( self ): return Layers ( self . app . layers ) @property def layerSets ( self ): # pylint: disable=import-outside-toplevel from ._layerSets import LayerSets return LayerSets ( self . app . layerSets ) @property def linkedLayers ( self ): \"\"\"The layers linked to this layerSet object.\"\"\" return self . app . linkedLayers or [] @property def name ( self ) -> str : return self . app . name @name . setter def name ( self , value ): \"\"\"The name of this layer set.\"\"\" self . app . name = value @property def opacity ( self ): \"\"\"The master opacity of the set.\"\"\" return round ( self . app . opacity ) @opacity . setter def opacity ( self , value ): self . app . opacity = value @property def parent ( self ): return self . app . parent @property def visible ( self ): return self . app . visible @visible . setter def visible ( self , value ): self . app . visible = value def duplicate ( self , relativeObject = None , insertionLocation = None ): return LayerSet ( self . app . duplicate ( relativeObject , insertionLocation )) def link ( self , with_layer ): self . app . link ( with_layer ) def add ( self ): \"\"\"Adds an element.\"\"\" self . app . add () def merge ( self ) -> ArtLayer : \"\"\"Merges the layer set.\"\"\" return ArtLayer ( self . app . merge ()) def move ( self , relativeObject , insertionLocation ): self . app . move ( relativeObject , insertionLocation ) def remove ( self ): \"\"\"Remove this layer set from the document.\"\"\" self . app . delete () def resize ( self , horizontal = None , vertical = None , anchor : AnchorPosition = None ): self . app . resize ( horizontal , vertical , anchor ) def rotate ( self , angle , anchor = None ): self . app . rotate ( angle , anchor ) def translate ( self , delta_x , delta_y ): \"\"\"Moves the position relative to its current position.\"\"\" self . app . translate ( delta_x , delta_y ) def unlink ( self ): \"\"\"Unlinks the layer set.\"\"\" self . app . unlink () def __iter__ ( self ): for layer in self . app : yield layer bounds property The bounding rectangle of the layer set. linkedLayers property The layers linked to this layerSet object. opacity property writable The master opacity of the set. add () Adds an element. Source code in photoshop/api/_layerSet.py 113 114 115 def add ( self ): \"\"\"Adds an element.\"\"\" self . app . add () merge () Merges the layer set. Source code in photoshop/api/_layerSet.py 117 118 119 def merge ( self ) -> ArtLayer : \"\"\"Merges the layer set.\"\"\" return ArtLayer ( self . app . merge ()) remove () Remove this layer set from the document. Source code in photoshop/api/_layerSet.py 124 125 126 def remove ( self ): \"\"\"Remove this layer set from the document.\"\"\" self . app . delete () translate ( delta_x , delta_y ) Moves the position relative to its current position. Source code in photoshop/api/_layerSet.py 134 135 136 def translate ( self , delta_x , delta_y ): \"\"\"Moves the position relative to its current position.\"\"\" self . app . translate ( delta_x , delta_y ) unlink () Unlinks the layer set. Source code in photoshop/api/_layerSet.py 138 139 140 def unlink ( self ): \"\"\"Unlinks the layer set.\"\"\" self . app . unlink ()","title":"layerSet"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet","text":"Bases: Photoshop A group of layer objects, which can include art layer objects and other (nested) layer set objects. A single command or set of commands manipulates all layers in a layer set object. Source code in photoshop/api/_layerSet.py 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 class LayerSet ( Photoshop ): \"\"\"A group of layer objects, which can include art layer objects and other (nested) layer set objects. A single command or set of commands manipulates all layers in a layer set object. \"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"merge\" , \"duplicate\" , \"add\" , \"delete\" , \"link\" , \"move\" , \"resize\" , \"rotate\" , \"translate\" , \"unlink\" , ) @property def allLocked ( self ): return self . app . allLocked @allLocked . setter def allLocked ( self , value ): self . app . allLocked = value @property def artLayers ( self ): return ArtLayers ( self . app . artLayers ) @property def blendMode ( self ): return BlendMode ( self . app . blendMode ) @property def bounds ( self ): \"\"\"The bounding rectangle of the layer set.\"\"\" return self . app . bounds @property def enabledChannels ( self ): return self . app . enabledChannels @enabledChannels . setter def enabledChannels ( self , value ): self . app . enabledChannels = value @property def layers ( self ): return Layers ( self . app . layers ) @property def layerSets ( self ): # pylint: disable=import-outside-toplevel from ._layerSets import LayerSets return LayerSets ( self . app . layerSets ) @property def linkedLayers ( self ): \"\"\"The layers linked to this layerSet object.\"\"\" return self . app . linkedLayers or [] @property def name ( self ) -> str : return self . app . name @name . setter def name ( self , value ): \"\"\"The name of this layer set.\"\"\" self . app . name = value @property def opacity ( self ): \"\"\"The master opacity of the set.\"\"\" return round ( self . app . opacity ) @opacity . setter def opacity ( self , value ): self . app . opacity = value @property def parent ( self ): return self . app . parent @property def visible ( self ): return self . app . visible @visible . setter def visible ( self , value ): self . app . visible = value def duplicate ( self , relativeObject = None , insertionLocation = None ): return LayerSet ( self . app . duplicate ( relativeObject , insertionLocation )) def link ( self , with_layer ): self . app . link ( with_layer ) def add ( self ): \"\"\"Adds an element.\"\"\" self . app . add () def merge ( self ) -> ArtLayer : \"\"\"Merges the layer set.\"\"\" return ArtLayer ( self . app . merge ()) def move ( self , relativeObject , insertionLocation ): self . app . move ( relativeObject , insertionLocation ) def remove ( self ): \"\"\"Remove this layer set from the document.\"\"\" self . app . delete () def resize ( self , horizontal = None , vertical = None , anchor : AnchorPosition = None ): self . app . resize ( horizontal , vertical , anchor ) def rotate ( self , angle , anchor = None ): self . app . rotate ( angle , anchor ) def translate ( self , delta_x , delta_y ): \"\"\"Moves the position relative to its current position.\"\"\" self . app . translate ( delta_x , delta_y ) def unlink ( self ): \"\"\"Unlinks the layer set.\"\"\" self . app . unlink () def __iter__ ( self ): for layer in self . app : yield layer","title":"LayerSet"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.bounds","text":"The bounding rectangle of the layer set.","title":"bounds"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.linkedLayers","text":"The layers linked to this layerSet object.","title":"linkedLayers"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.opacity","text":"The master opacity of the set.","title":"opacity"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.add","text":"Adds an element. Source code in photoshop/api/_layerSet.py 113 114 115 def add ( self ): \"\"\"Adds an element.\"\"\" self . app . add ()","title":"add()"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.merge","text":"Merges the layer set. Source code in photoshop/api/_layerSet.py 117 118 119 def merge ( self ) -> ArtLayer : \"\"\"Merges the layer set.\"\"\" return ArtLayer ( self . app . merge ())","title":"merge()"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.remove","text":"Remove this layer set from the document. Source code in photoshop/api/_layerSet.py 124 125 126 def remove ( self ): \"\"\"Remove this layer set from the document.\"\"\" self . app . delete ()","title":"remove()"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.translate","text":"Moves the position relative to its current position. Source code in photoshop/api/_layerSet.py 134 135 136 def translate ( self , delta_x , delta_y ): \"\"\"Moves the position relative to its current position.\"\"\" self . app . translate ( delta_x , delta_y )","title":"translate()"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.unlink","text":"Unlinks the layer set. Source code in photoshop/api/_layerSet.py 138 139 140 def unlink ( self ): \"\"\"Unlinks the layer set.\"\"\" self . app . unlink ()","title":"unlink()"},{"location":"reference/photoshop/api/_layerSets/","text":"LayerSets Bases: Photoshop The layer sets collection in the document. Source code in photoshop/api/_layerSets.py 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 class LayerSets ( Photoshop ): \"\"\"The layer sets collection in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"item\" , \"removeAll\" , ) def __len__ ( self ): return self . length def __iter__ ( self ): for layer_set in self . app : yield layer_set def __getitem__ ( self , key : str ): \"\"\"Access a given LayerSet using dictionary key lookup.\"\"\" try : return LayerSet ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { key } \"' ) @property def _layerSets ( self ): return list ( self . app ) @property def length ( self ) -> int : \"\"\"Number of elements in the collection.\"\"\" return len ( self . _layerSets ) def add ( self ): return LayerSet ( self . app . add ()) def item ( self , index : int ) -> LayerSet : return LayerSet ( self . app . item ( index )) def removeAll ( self ): self . app . removeAll () def getByIndex ( self , index : int ): \"\"\"Access LayerSet using list index lookup.\"\"\" return LayerSet ( self . _layerSets [ index ]) def getByName ( self , name : str ) -> LayerSet : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if name == layer . name : return LayerSet ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { name } \"' ) length : int property Number of elements in the collection. __getitem__ ( key ) Access a given LayerSet using dictionary key lookup. Source code in photoshop/api/_layerSets.py 28 29 30 31 32 33 def __getitem__ ( self , key : str ): \"\"\"Access a given LayerSet using dictionary key lookup.\"\"\" try : return LayerSet ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { key } \"' ) getByIndex ( index ) Access LayerSet using list index lookup. Source code in photoshop/api/_layerSets.py 53 54 55 def getByIndex ( self , index : int ): \"\"\"Access LayerSet using list index lookup.\"\"\" return LayerSet ( self . _layerSets [ index ]) getByName ( name ) Get the first element in the collection with the provided name. Source code in photoshop/api/_layerSets.py 57 58 59 60 61 62 def getByName ( self , name : str ) -> LayerSet : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if name == layer . name : return LayerSet ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { name } \"' )","title":"layerSets"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets","text":"Bases: Photoshop The layer sets collection in the document. Source code in photoshop/api/_layerSets.py 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 class LayerSets ( Photoshop ): \"\"\"The layer sets collection in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"item\" , \"removeAll\" , ) def __len__ ( self ): return self . length def __iter__ ( self ): for layer_set in self . app : yield layer_set def __getitem__ ( self , key : str ): \"\"\"Access a given LayerSet using dictionary key lookup.\"\"\" try : return LayerSet ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { key } \"' ) @property def _layerSets ( self ): return list ( self . app ) @property def length ( self ) -> int : \"\"\"Number of elements in the collection.\"\"\" return len ( self . _layerSets ) def add ( self ): return LayerSet ( self . app . add ()) def item ( self , index : int ) -> LayerSet : return LayerSet ( self . app . item ( index )) def removeAll ( self ): self . app . removeAll () def getByIndex ( self , index : int ): \"\"\"Access LayerSet using list index lookup.\"\"\" return LayerSet ( self . _layerSets [ index ]) def getByName ( self , name : str ) -> LayerSet : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if name == layer . name : return LayerSet ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { name } \"' )","title":"LayerSets"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets.length","text":"Number of elements in the collection.","title":"length"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets.__getitem__","text":"Access a given LayerSet using dictionary key lookup. Source code in photoshop/api/_layerSets.py 28 29 30 31 32 33 def __getitem__ ( self , key : str ): \"\"\"Access a given LayerSet using dictionary key lookup.\"\"\" try : return LayerSet ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { key } \"' )","title":"__getitem__()"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets.getByIndex","text":"Access LayerSet using list index lookup. Source code in photoshop/api/_layerSets.py 53 54 55 def getByIndex ( self , index : int ): \"\"\"Access LayerSet using list index lookup.\"\"\" return LayerSet ( self . _layerSets [ index ])","title":"getByIndex()"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets.getByName","text":"Get the first element in the collection with the provided name. Source code in photoshop/api/_layerSets.py 57 58 59 60 61 62 def getByName ( self , name : str ) -> LayerSet : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if name == layer . name : return LayerSet ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { name } \"' )","title":"getByName()"},{"location":"reference/photoshop/api/_layers/","text":"Layers Bases: Photoshop The layers collection in the document. Source code in photoshop/api/_layers.py 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 class Layers ( Photoshop ): \"\"\"The layers collection in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"item\" , ) @property def _layers ( self ): return list ( self . app ) def __len__ ( self ): return self . length def __getitem__ ( self , key ): item = self . _layers [ key ] return ArtLayer ( item ) @property def length ( self ): return len ( self . _layers ) def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove () def item ( self , index ): return ArtLayer ( self . app . item ( index )) def __iter__ ( self ): for layer in self . _layers : yield ArtLayer ( layer ) def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( \"X\" ) getByName ( name ) Get the first element in the collection with the provided name. Source code in photoshop/api/_layers.py 45 46 47 48 49 50 def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( \"X\" ) removeAll () Deletes all elements. Source code in photoshop/api/_layers.py 33 34 35 36 def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"layers"},{"location":"reference/photoshop/api/_layers/#photoshop.api._layers.Layers","text":"Bases: Photoshop The layers collection in the document. Source code in photoshop/api/_layers.py 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 class Layers ( Photoshop ): \"\"\"The layers collection in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"item\" , ) @property def _layers ( self ): return list ( self . app ) def __len__ ( self ): return self . length def __getitem__ ( self , key ): item = self . _layers [ key ] return ArtLayer ( item ) @property def length ( self ): return len ( self . _layers ) def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove () def item ( self , index ): return ArtLayer ( self . app . item ( index )) def __iter__ ( self ): for layer in self . _layers : yield ArtLayer ( layer ) def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( \"X\" )","title":"Layers"},{"location":"reference/photoshop/api/_layers/#photoshop.api._layers.Layers.getByName","text":"Get the first element in the collection with the provided name. Source code in photoshop/api/_layers.py 45 46 47 48 49 50 def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( \"X\" )","title":"getByName()"},{"location":"reference/photoshop/api/_layers/#photoshop.api._layers.Layers.removeAll","text":"Deletes all elements. Source code in photoshop/api/_layers.py 33 34 35 36 def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"removeAll()"},{"location":"reference/photoshop/api/_measurement_log/","text":"MeasurementLog Bases: Photoshop The log of measurements taken. Source code in photoshop/api/_measurement_log.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 class MeasurementLog ( Photoshop ): \"\"\"The log of measurements taken.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"exportMeasurements\" , \"deleteMeasurements\" , ) def exportMeasurements ( self , file_path : str , range_ : int = None , data_point = None ): if data_point is None : data_point = [] self . app . exportMeasurements ( file_path , range_ , data_point ) def deleteMeasurements ( self , range_ : int ): self . app . deleteMeasurements ( range_ )","title":"measurement_log"},{"location":"reference/photoshop/api/_measurement_log/#photoshop.api._measurement_log.MeasurementLog","text":"Bases: Photoshop The log of measurements taken. Source code in photoshop/api/_measurement_log.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 class MeasurementLog ( Photoshop ): \"\"\"The log of measurements taken.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"exportMeasurements\" , \"deleteMeasurements\" , ) def exportMeasurements ( self , file_path : str , range_ : int = None , data_point = None ): if data_point is None : data_point = [] self . app . exportMeasurements ( file_path , range_ , data_point ) def deleteMeasurements ( self , range_ : int ): self . app . deleteMeasurements ( range_ )","title":"MeasurementLog"},{"location":"reference/photoshop/api/_notifier/","text":"The collection of Notifier objects in the document. Access through the Application.notifiers collection property. For example: var notRef = app.notifiers.add(\"OnClickGoButton\", eventFile) Notifiers must be enabled using the Application.notifiersEnabled property Notifier Bases: Photoshop Source code in photoshop/api/_notifier.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class Notifier ( Photoshop ): def __init__ ( self , parent = None ): super () . __init__ () self . _flag_as_method ( \"remove\" , ) @property def event ( self ): \"\"\"The event identifier, a four-character code or a unique string.\"\"\" return self . app . event @property def eventClass ( self ): \"\"\"The class identifier, a four-character code or a unique string. When an event applies to multiple types of objects, use this propery to distinguish which object this notifier applies to. For example, the Make event (\"Mk \") can apply to documents (\"Dcmn\"), channels (\"Chnl\") and other objects. \"\"\" return self . app . eventClass @property def eventFile ( self ) -> Path : \"\"\"The path to the file to execute when the event occurs and activates the notifier.\"\"\" return Path ( self . app . eventFile ) def remove ( self ): \"\"\"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. \"\"\" return self . app . remove () event property The event identifier, a four-character code or a unique string. eventClass property The class identifier, a four-character code or a unique string. When an event applies to multiple types of objects, use this propery to distinguish which object this notifier applies to. For example, the Make event (\"Mk \") can apply to documents (\"Dcmn\"), channels (\"Chnl\") and other objects. eventFile : Path property The path to the file to execute when the event occurs and activates the notifier. remove () Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. Source code in photoshop/api/_notifier.py 45 46 47 48 49 50 51 52 53 54 55 56 def remove ( self ): \"\"\"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. \"\"\" return self . app . remove ()","title":"notifier"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier","text":"Bases: Photoshop Source code in photoshop/api/_notifier.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class Notifier ( Photoshop ): def __init__ ( self , parent = None ): super () . __init__ () self . _flag_as_method ( \"remove\" , ) @property def event ( self ): \"\"\"The event identifier, a four-character code or a unique string.\"\"\" return self . app . event @property def eventClass ( self ): \"\"\"The class identifier, a four-character code or a unique string. When an event applies to multiple types of objects, use this propery to distinguish which object this notifier applies to. For example, the Make event (\"Mk \") can apply to documents (\"Dcmn\"), channels (\"Chnl\") and other objects. \"\"\" return self . app . eventClass @property def eventFile ( self ) -> Path : \"\"\"The path to the file to execute when the event occurs and activates the notifier.\"\"\" return Path ( self . app . eventFile ) def remove ( self ): \"\"\"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. \"\"\" return self . app . remove ()","title":"Notifier"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier.event","text":"The event identifier, a four-character code or a unique string.","title":"event"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier.eventClass","text":"The class identifier, a four-character code or a unique string. When an event applies to multiple types of objects, use this propery to distinguish which object this notifier applies to. For example, the Make event (\"Mk \") can apply to documents (\"Dcmn\"), channels (\"Chnl\") and other objects.","title":"eventClass"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier.eventFile","text":"The path to the file to execute when the event occurs and activates the notifier.","title":"eventFile"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier.remove","text":"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. Source code in photoshop/api/_notifier.py 45 46 47 48 49 50 51 52 53 54 55 56 def remove ( self ): \"\"\"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. \"\"\" return self . app . remove ()","title":"remove()"},{"location":"reference/photoshop/api/_notifiers/","text":"The collection of Notifier objects in the document. Access through the Application.notifiers collection property. Examples: Notifiers must be enabled using the Application.notifiersEnabled property. var notRef = app . notifiers . add ( \"OnClickGoButton\" , eventFile ) Notifiers Bases: Photoshop The notifiers currently configured (in the Scripts Events Manager menu in the application). Source code in photoshop/api/_notifiers.py 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class Notifiers ( Photoshop ): \"\"\"The `notifiers` currently configured (in the Scripts Events Manager menu in the application).\"\"\" def __init__ ( self , parent : Optional [ Any ] = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"removeAll\" , ) @property def _notifiers ( self ) -> list : return [ n for n in self . app ] def __len__ ( self ): return self . length def __iter__ ( self ): for app in self . app : yield app def __getitem__ ( self , item ): return self . _notifiers [ item ] @property def length ( self ): return len ( self . _notifiers ) def add ( self , event , event_file : Optional [ Any ] = None , event_class : Optional [ Any ] = None ) -> Notifier : self . parent . notifiersEnabled = True return Notifier ( self . app . add ( event , event_file , event_class )) def removeAll ( self ): self . app . removeAll () self . parent . notifiersEnabled = False","title":"notifiers"},{"location":"reference/photoshop/api/_notifiers/#photoshop.api._notifiers.Notifiers","text":"Bases: Photoshop The notifiers currently configured (in the Scripts Events Manager menu in the application). Source code in photoshop/api/_notifiers.py 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class Notifiers ( Photoshop ): \"\"\"The `notifiers` currently configured (in the Scripts Events Manager menu in the application).\"\"\" def __init__ ( self , parent : Optional [ Any ] = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"removeAll\" , ) @property def _notifiers ( self ) -> list : return [ n for n in self . app ] def __len__ ( self ): return self . length def __iter__ ( self ): for app in self . app : yield app def __getitem__ ( self , item ): return self . _notifiers [ item ] @property def length ( self ): return len ( self . _notifiers ) def add ( self , event , event_file : Optional [ Any ] = None , event_class : Optional [ Any ] = None ) -> Notifier : self . parent . notifiersEnabled = True return Notifier ( self . app . add ( event , event_file , event_class )) def removeAll ( self ): self . app . removeAll () self . parent . notifiersEnabled = False","title":"Notifiers"},{"location":"reference/photoshop/api/_preferences/","text":"Preferences Bases: Photoshop The application preference settings. Source code in photoshop/api/_preferences.py 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 class Preferences ( Photoshop ): \"\"\"The application preference settings.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def additionalPluginFolder ( self ): \"\"\"The path to an additional plug-in folder.\"\"\" return Path ( self . app . additionalPluginFolder ) @property def appendExtension ( self ): return self . app . appendExtension @property def askBeforeSavingLayeredTIFF ( self ) -> bool : return self . app . askBeforeSavingLayeredTIFF @property def autoUpdateOpenDocuments ( self ) -> bool : \"\"\"True to automatically update open documents.\"\"\" return self . app . autoUpdateOpenDocuments @autoUpdateOpenDocuments . setter def autoUpdateOpenDocuments ( self , boolean : bool ): \"\"\"True to automatically update open documents.\"\"\" self . app . autoUpdateOpenDocuments = boolean @property def beepWhenDone ( self ) -> bool : \"\"\"True to beep when a process.\"\"\" return self . app . beepWhenDone @beepWhenDone . setter def beepWhenDone ( self , boolean ): self . app . beepWhenDone = boolean @property def colorChannelsInColor ( self ): \"\"\"True to display component channels in the Channels palette in color.\"\"\" return self . app . colorChannelsInColor @colorChannelsInColor . setter def colorChannelsInColor ( self , value ): self . app . colorChannelsInColor = value @property def colorPicker ( self ): \"\"\"The preferred color selection tool.\"\"\" return self . app . colorPicker @colorPicker . setter def colorPicker ( self , value ): self . app . colorPicker = value @property def columnGutter ( self ): return self . app . columnGutter @columnGutter . setter def columnGutter ( self , value ): self . app . columnGutter = value @property def columnWidth ( self ): return self . app . columnWidth @columnWidth . setter def columnWidth ( self , value ): self . app . columnWidth = value @property def createFirstSnapshot ( self ): \"\"\"Automatically make the first snapshot when a new document is created.\"\"\" return self . app . createFirstSnapshot @createFirstSnapshot . setter def createFirstSnapshot ( self , boolean ): self . app . createFirstSnapshot = boolean @property def dynamicColorSliders ( self ): return self . app . dynamicColorSliders @dynamicColorSliders . setter def dynamicColorSliders ( self , boolean ): self . app . dynamicColorSliders = boolean @property def editLogItems ( self ) -> bool : \"\"\"The preferred level of detail in the history log.\"\"\" return self . app . editLogItems @editLogItems . setter def editLogItems ( self , boolean : bool ): \"\"\"The preferred level of detail in the history log. Valid only when useHistoryLog = True \"\"\" self . app . editLogItems = boolean @property def exportClipboard ( self ): \"\"\"Retain Photoshop contents on the clipboard after exit the app.\"\"\" return self . app . exportClipboard @exportClipboard . setter def exportClipboard ( self , boolean : bool ): self . app . exportClipboard = boolean @property def fontPreviewSize ( self ): return self . app . fontPreviewSize @fontPreviewSize . setter def fontPreviewSize ( self , value ): self . app . fontPreviewSize = value @property def fullSizePreview ( self ): return self . app . fullSizePreview @fullSizePreview . setter def fullSizePreview ( self , value ): self . app . fullSizePreview = value @property def gamutWarningOpacity ( self ): return self . app . gamutWarningOpacity @property def rulerUnits ( self ): return self . app . rulerUnits @rulerUnits . setter def rulerUnits ( self , value ): self . app . rulerUnits = value additionalPluginFolder property The path to an additional plug-in folder. autoUpdateOpenDocuments : bool property writable True to automatically update open documents. beepWhenDone : bool property writable True to beep when a process. colorChannelsInColor property writable True to display component channels in the Channels palette in color. colorPicker property writable The preferred color selection tool. createFirstSnapshot property writable Automatically make the first snapshot when a new document is created. editLogItems : bool property writable The preferred level of detail in the history log. exportClipboard property writable Retain Photoshop contents on the clipboard after exit the app.","title":"preferences"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences","text":"Bases: Photoshop The application preference settings. Source code in photoshop/api/_preferences.py 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 class Preferences ( Photoshop ): \"\"\"The application preference settings.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def additionalPluginFolder ( self ): \"\"\"The path to an additional plug-in folder.\"\"\" return Path ( self . app . additionalPluginFolder ) @property def appendExtension ( self ): return self . app . appendExtension @property def askBeforeSavingLayeredTIFF ( self ) -> bool : return self . app . askBeforeSavingLayeredTIFF @property def autoUpdateOpenDocuments ( self ) -> bool : \"\"\"True to automatically update open documents.\"\"\" return self . app . autoUpdateOpenDocuments @autoUpdateOpenDocuments . setter def autoUpdateOpenDocuments ( self , boolean : bool ): \"\"\"True to automatically update open documents.\"\"\" self . app . autoUpdateOpenDocuments = boolean @property def beepWhenDone ( self ) -> bool : \"\"\"True to beep when a process.\"\"\" return self . app . beepWhenDone @beepWhenDone . setter def beepWhenDone ( self , boolean ): self . app . beepWhenDone = boolean @property def colorChannelsInColor ( self ): \"\"\"True to display component channels in the Channels palette in color.\"\"\" return self . app . colorChannelsInColor @colorChannelsInColor . setter def colorChannelsInColor ( self , value ): self . app . colorChannelsInColor = value @property def colorPicker ( self ): \"\"\"The preferred color selection tool.\"\"\" return self . app . colorPicker @colorPicker . setter def colorPicker ( self , value ): self . app . colorPicker = value @property def columnGutter ( self ): return self . app . columnGutter @columnGutter . setter def columnGutter ( self , value ): self . app . columnGutter = value @property def columnWidth ( self ): return self . app . columnWidth @columnWidth . setter def columnWidth ( self , value ): self . app . columnWidth = value @property def createFirstSnapshot ( self ): \"\"\"Automatically make the first snapshot when a new document is created.\"\"\" return self . app . createFirstSnapshot @createFirstSnapshot . setter def createFirstSnapshot ( self , boolean ): self . app . createFirstSnapshot = boolean @property def dynamicColorSliders ( self ): return self . app . dynamicColorSliders @dynamicColorSliders . setter def dynamicColorSliders ( self , boolean ): self . app . dynamicColorSliders = boolean @property def editLogItems ( self ) -> bool : \"\"\"The preferred level of detail in the history log.\"\"\" return self . app . editLogItems @editLogItems . setter def editLogItems ( self , boolean : bool ): \"\"\"The preferred level of detail in the history log. Valid only when useHistoryLog = True \"\"\" self . app . editLogItems = boolean @property def exportClipboard ( self ): \"\"\"Retain Photoshop contents on the clipboard after exit the app.\"\"\" return self . app . exportClipboard @exportClipboard . setter def exportClipboard ( self , boolean : bool ): self . app . exportClipboard = boolean @property def fontPreviewSize ( self ): return self . app . fontPreviewSize @fontPreviewSize . setter def fontPreviewSize ( self , value ): self . app . fontPreviewSize = value @property def fullSizePreview ( self ): return self . app . fullSizePreview @fullSizePreview . setter def fullSizePreview ( self , value ): self . app . fullSizePreview = value @property def gamutWarningOpacity ( self ): return self . app . gamutWarningOpacity @property def rulerUnits ( self ): return self . app . rulerUnits @rulerUnits . setter def rulerUnits ( self , value ): self . app . rulerUnits = value","title":"Preferences"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.additionalPluginFolder","text":"The path to an additional plug-in folder.","title":"additionalPluginFolder"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.autoUpdateOpenDocuments","text":"True to automatically update open documents.","title":"autoUpdateOpenDocuments"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.beepWhenDone","text":"True to beep when a process.","title":"beepWhenDone"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.colorChannelsInColor","text":"True to display component channels in the Channels palette in color.","title":"colorChannelsInColor"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.colorPicker","text":"The preferred color selection tool.","title":"colorPicker"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.createFirstSnapshot","text":"Automatically make the first snapshot when a new document is created.","title":"createFirstSnapshot"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.editLogItems","text":"The preferred level of detail in the history log.","title":"editLogItems"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.exportClipboard","text":"Retain Photoshop contents on the clipboard after exit the app.","title":"exportClipboard"},{"location":"reference/photoshop/api/_selection/","text":"The selected area of the document or layer. Selection Bases: Photoshop The selected area of the document. Source code in photoshop/api/_selection.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 class Selection ( Photoshop ): \"\"\"The selected area of the document.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"clear\" , \"contract\" , \"copy\" , \"cut\" , \"deselect\" , \"expand\" , \"feather\" , \"fill\" , \"grow\" , \"invert\" , \"load\" , \"makeWorkPath\" , \"resize\" , \"resizeBoundary\" , \"rotate\" , \"rotateBoundary\" , \"select\" , \"selectBorder\" , \"similar\" , \"smooth\" , \"store\" , \"stroke\" , \"translate\" , \"translateBoundary\" , ) @property def bounds ( self ): return self . app . bounds def parent ( self ): return self . app . parent @property def solid ( self ): return self . app . solid @property def typename ( self ): return self . app . typename def clear ( self ): \"\"\"Clears the selection and does not copy it to the clipboard.\"\"\" self . app . clear () def contract ( self , contract_by ): \"\"\"Contracts the selection.\"\"\" self . app . contract ( contract_by ) def copy ( self ): \"\"\"Copies the selection to the clipboard.\"\"\" self . app . copy () def cut ( self ): \"\"\"Cuts the current selection to the clipboard.\"\"\" self . app . cut () def select ( self , * args , ** kwargs ): return self . app . select ( * args , ** kwargs ) def deselect ( self ): \"\"\"Deselects the current selection.\"\"\" return self . app . deselect () def expand ( self , by : int ): \"\"\"Expands the selection. Args: by: The amount to expand the selection. \"\"\" self . app . expand ( by ) def feather ( self , by : int ): \"\"\"Feathers the edges of the selection. Args: by: The amount to feather the edge. \"\"\" return self . app . feather ( by ) def fill ( self , fill_type : SolidColor , mode : ColorBlendMode = None , opacity = None , preserve_transparency = None , ): \"\"\"Fills the selection.\"\"\" return self . app . fill ( fill_type , mode , opacity , preserve_transparency ) def grow ( self , tolerance , anti_alias ): \"\"\"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Args: tolerance (int): The tolerance range. Range: 0 to 255. anti_alias (bool): If true, anti-aliasing is used. \"\"\" return self . app . grow ( tolerance , anti_alias ) def invert ( self ): \"\"\"Inverts the selection.\"\"\" self . app . invert () def load ( self , from_channel , combination , inverting ): \"\"\"Loads the selection from the specified channel.\"\"\" return self . app . load ( from_channel , combination , inverting ) def makeWorkPath ( self , tolerance ): \"\"\"Makes this selection item the workpath for this document.\"\"\" self . app . makeWorkPath ( tolerance ) def resize ( self , horizontal , vertical , anchor ): \"\"\"Resizes the selected area to the specified dimensions and anchor position.\"\"\" self . app . resize ( horizontal , vertical , anchor ) def resizeBoundary ( self , horizontal , vertical , anchor ): \"\"\"Scales the boundary of the selection.\"\"\" self . app . resizeBoundary ( horizontal , vertical , anchor ) def rotate ( self , angle , anchor ): \"\"\"Rotates the object.\"\"\" self . app . rotate ( angle , anchor ) def rotateBoundary ( self , angle , anchor ): \"\"\"Rotates the boundary of the selection.\"\"\" self . app . rotateBoundary ( angle , anchor ) def stroke ( self , strokeColor , width , location , mode , opacity , preserveTransparency ): \"\"\"Strokes the selection. Args: strokeColor (SolidColor): The color to stroke the selection with. width (int): The stroke width. location (int): The stroke location. mode (int): The color blend mode. opacity (int): The opacity of the stroke color as a percentage. Range: 1 to 100. preserveTransparency (bool): If true, preserves transparency. \"\"\" return self . app . stroke ( strokeColor , width , location , mode , opacity , preserveTransparency ) def selectBorder ( self , width ): \"\"\"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Args: width (int): The width of the border selection. \"\"\" return self . app . selectBorder ( width ) def similar ( self , tolerance , antiAlias ): return self . app . similar ( tolerance , antiAlias ) def smooth ( self , radius ): \"\"\"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).\"\"\" return self . app . smooth ( radius ) def store ( self , into , combination = SelectionType . ReplaceSelection ): \"\"\"Saves the selection as a channel.\"\"\" return self . app . store ( into , combination ) def translate ( self , deltaX , deltaY ): \"\"\"Moves the object relative to its current position.\"\"\" return self . app . translate ( deltaX , deltaY ) def translateBoundary ( self , deltaX , deltaY ): \"\"\"Moves the boundary of selection relative to its current position.\"\"\" return self . app . translateBoundary ( deltaX , deltaY ) clear () Clears the selection and does not copy it to the clipboard. Source code in photoshop/api/_selection.py 58 59 60 def clear ( self ): \"\"\"Clears the selection and does not copy it to the clipboard.\"\"\" self . app . clear () contract ( contract_by ) Contracts the selection. Source code in photoshop/api/_selection.py 62 63 64 def contract ( self , contract_by ): \"\"\"Contracts the selection.\"\"\" self . app . contract ( contract_by ) copy () Copies the selection to the clipboard. Source code in photoshop/api/_selection.py 66 67 68 def copy ( self ): \"\"\"Copies the selection to the clipboard.\"\"\" self . app . copy () cut () Cuts the current selection to the clipboard. Source code in photoshop/api/_selection.py 70 71 72 def cut ( self ): \"\"\"Cuts the current selection to the clipboard.\"\"\" self . app . cut () deselect () Deselects the current selection. Source code in photoshop/api/_selection.py 77 78 79 def deselect ( self ): \"\"\"Deselects the current selection.\"\"\" return self . app . deselect () expand ( by ) Expands the selection. Parameters: Name Type Description Default by int The amount to expand the selection. required Source code in photoshop/api/_selection.py 81 82 83 84 85 86 87 88 def expand ( self , by : int ): \"\"\"Expands the selection. Args: by: The amount to expand the selection. \"\"\" self . app . expand ( by ) feather ( by ) Feathers the edges of the selection. Parameters: Name Type Description Default by int The amount to feather the edge. required Source code in photoshop/api/_selection.py 90 91 92 93 94 95 96 97 def feather ( self , by : int ): \"\"\"Feathers the edges of the selection. Args: by: The amount to feather the edge. \"\"\" return self . app . feather ( by ) fill ( fill_type , mode = None , opacity = None , preserve_transparency = None ) Fills the selection. Source code in photoshop/api/_selection.py 99 100 101 102 103 104 105 106 107 def fill ( self , fill_type : SolidColor , mode : ColorBlendMode = None , opacity = None , preserve_transparency = None , ): \"\"\"Fills the selection.\"\"\" return self . app . fill ( fill_type , mode , opacity , preserve_transparency ) grow ( tolerance , anti_alias ) Grows the selection to include all adjacent pixels falling within The specified tolerance range. Parameters: Name Type Description Default tolerance int The tolerance range. Range: 0 to 255. required anti_alias bool If true, anti-aliasing is used. required Source code in photoshop/api/_selection.py 109 110 111 112 113 114 115 116 117 118 119 120 def grow ( self , tolerance , anti_alias ): \"\"\"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Args: tolerance (int): The tolerance range. Range: 0 to 255. anti_alias (bool): If true, anti-aliasing is used. \"\"\" return self . app . grow ( tolerance , anti_alias ) invert () Inverts the selection. Source code in photoshop/api/_selection.py 122 123 124 def invert ( self ): \"\"\"Inverts the selection.\"\"\" self . app . invert () load ( from_channel , combination , inverting ) Loads the selection from the specified channel. Source code in photoshop/api/_selection.py 126 127 128 def load ( self , from_channel , combination , inverting ): \"\"\"Loads the selection from the specified channel.\"\"\" return self . app . load ( from_channel , combination , inverting ) makeWorkPath ( tolerance ) Makes this selection item the workpath for this document. Source code in photoshop/api/_selection.py 130 131 132 def makeWorkPath ( self , tolerance ): \"\"\"Makes this selection item the workpath for this document.\"\"\" self . app . makeWorkPath ( tolerance ) resize ( horizontal , vertical , anchor ) Resizes the selected area to the specified dimensions and anchor position. Source code in photoshop/api/_selection.py 134 135 136 137 def resize ( self , horizontal , vertical , anchor ): \"\"\"Resizes the selected area to the specified dimensions and anchor position.\"\"\" self . app . resize ( horizontal , vertical , anchor ) resizeBoundary ( horizontal , vertical , anchor ) Scales the boundary of the selection. Source code in photoshop/api/_selection.py 139 140 141 def resizeBoundary ( self , horizontal , vertical , anchor ): \"\"\"Scales the boundary of the selection.\"\"\" self . app . resizeBoundary ( horizontal , vertical , anchor ) rotate ( angle , anchor ) Rotates the object. Source code in photoshop/api/_selection.py 143 144 145 def rotate ( self , angle , anchor ): \"\"\"Rotates the object.\"\"\" self . app . rotate ( angle , anchor ) rotateBoundary ( angle , anchor ) Rotates the boundary of the selection. Source code in photoshop/api/_selection.py 147 148 149 def rotateBoundary ( self , angle , anchor ): \"\"\"Rotates the boundary of the selection.\"\"\" self . app . rotateBoundary ( angle , anchor ) selectBorder ( width ) Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Parameters: Name Type Description Default width int The width of the border selection. required Source code in photoshop/api/_selection.py 166 167 168 169 170 171 172 173 174 def selectBorder ( self , width ): \"\"\"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Args: width (int): The width of the border selection. \"\"\" return self . app . selectBorder ( width ) smooth ( radius ) Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels). Source code in photoshop/api/_selection.py 179 180 181 182 def smooth ( self , radius ): \"\"\"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).\"\"\" return self . app . smooth ( radius ) store ( into , combination = SelectionType . ReplaceSelection ) Saves the selection as a channel. Source code in photoshop/api/_selection.py 184 185 186 def store ( self , into , combination = SelectionType . ReplaceSelection ): \"\"\"Saves the selection as a channel.\"\"\" return self . app . store ( into , combination ) stroke ( strokeColor , width , location , mode , opacity , preserveTransparency ) Strokes the selection. Parameters: Name Type Description Default strokeColor SolidColor The color to stroke the selection with. required width int The stroke width. required location int The stroke location. required mode int The color blend mode. required opacity int The opacity of the stroke color as a percentage. Range: 1 to 100. required preserveTransparency bool If true, preserves transparency. required Source code in photoshop/api/_selection.py 151 152 153 154 155 156 157 158 159 160 161 162 163 164 def stroke ( self , strokeColor , width , location , mode , opacity , preserveTransparency ): \"\"\"Strokes the selection. Args: strokeColor (SolidColor): The color to stroke the selection with. width (int): The stroke width. location (int): The stroke location. mode (int): The color blend mode. opacity (int): The opacity of the stroke color as a percentage. Range: 1 to 100. preserveTransparency (bool): If true, preserves transparency. \"\"\" return self . app . stroke ( strokeColor , width , location , mode , opacity , preserveTransparency ) translate ( deltaX , deltaY ) Moves the object relative to its current position. Source code in photoshop/api/_selection.py 188 189 190 def translate ( self , deltaX , deltaY ): \"\"\"Moves the object relative to its current position.\"\"\" return self . app . translate ( deltaX , deltaY ) translateBoundary ( deltaX , deltaY ) Moves the boundary of selection relative to its current position. Source code in photoshop/api/_selection.py 192 193 194 def translateBoundary ( self , deltaX , deltaY ): \"\"\"Moves the boundary of selection relative to its current position.\"\"\" return self . app . translateBoundary ( deltaX , deltaY )","title":"selection"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection","text":"Bases: Photoshop The selected area of the document. Source code in photoshop/api/_selection.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 class Selection ( Photoshop ): \"\"\"The selected area of the document.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"clear\" , \"contract\" , \"copy\" , \"cut\" , \"deselect\" , \"expand\" , \"feather\" , \"fill\" , \"grow\" , \"invert\" , \"load\" , \"makeWorkPath\" , \"resize\" , \"resizeBoundary\" , \"rotate\" , \"rotateBoundary\" , \"select\" , \"selectBorder\" , \"similar\" , \"smooth\" , \"store\" , \"stroke\" , \"translate\" , \"translateBoundary\" , ) @property def bounds ( self ): return self . app . bounds def parent ( self ): return self . app . parent @property def solid ( self ): return self . app . solid @property def typename ( self ): return self . app . typename def clear ( self ): \"\"\"Clears the selection and does not copy it to the clipboard.\"\"\" self . app . clear () def contract ( self , contract_by ): \"\"\"Contracts the selection.\"\"\" self . app . contract ( contract_by ) def copy ( self ): \"\"\"Copies the selection to the clipboard.\"\"\" self . app . copy () def cut ( self ): \"\"\"Cuts the current selection to the clipboard.\"\"\" self . app . cut () def select ( self , * args , ** kwargs ): return self . app . select ( * args , ** kwargs ) def deselect ( self ): \"\"\"Deselects the current selection.\"\"\" return self . app . deselect () def expand ( self , by : int ): \"\"\"Expands the selection. Args: by: The amount to expand the selection. \"\"\" self . app . expand ( by ) def feather ( self , by : int ): \"\"\"Feathers the edges of the selection. Args: by: The amount to feather the edge. \"\"\" return self . app . feather ( by ) def fill ( self , fill_type : SolidColor , mode : ColorBlendMode = None , opacity = None , preserve_transparency = None , ): \"\"\"Fills the selection.\"\"\" return self . app . fill ( fill_type , mode , opacity , preserve_transparency ) def grow ( self , tolerance , anti_alias ): \"\"\"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Args: tolerance (int): The tolerance range. Range: 0 to 255. anti_alias (bool): If true, anti-aliasing is used. \"\"\" return self . app . grow ( tolerance , anti_alias ) def invert ( self ): \"\"\"Inverts the selection.\"\"\" self . app . invert () def load ( self , from_channel , combination , inverting ): \"\"\"Loads the selection from the specified channel.\"\"\" return self . app . load ( from_channel , combination , inverting ) def makeWorkPath ( self , tolerance ): \"\"\"Makes this selection item the workpath for this document.\"\"\" self . app . makeWorkPath ( tolerance ) def resize ( self , horizontal , vertical , anchor ): \"\"\"Resizes the selected area to the specified dimensions and anchor position.\"\"\" self . app . resize ( horizontal , vertical , anchor ) def resizeBoundary ( self , horizontal , vertical , anchor ): \"\"\"Scales the boundary of the selection.\"\"\" self . app . resizeBoundary ( horizontal , vertical , anchor ) def rotate ( self , angle , anchor ): \"\"\"Rotates the object.\"\"\" self . app . rotate ( angle , anchor ) def rotateBoundary ( self , angle , anchor ): \"\"\"Rotates the boundary of the selection.\"\"\" self . app . rotateBoundary ( angle , anchor ) def stroke ( self , strokeColor , width , location , mode , opacity , preserveTransparency ): \"\"\"Strokes the selection. Args: strokeColor (SolidColor): The color to stroke the selection with. width (int): The stroke width. location (int): The stroke location. mode (int): The color blend mode. opacity (int): The opacity of the stroke color as a percentage. Range: 1 to 100. preserveTransparency (bool): If true, preserves transparency. \"\"\" return self . app . stroke ( strokeColor , width , location , mode , opacity , preserveTransparency ) def selectBorder ( self , width ): \"\"\"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Args: width (int): The width of the border selection. \"\"\" return self . app . selectBorder ( width ) def similar ( self , tolerance , antiAlias ): return self . app . similar ( tolerance , antiAlias ) def smooth ( self , radius ): \"\"\"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).\"\"\" return self . app . smooth ( radius ) def store ( self , into , combination = SelectionType . ReplaceSelection ): \"\"\"Saves the selection as a channel.\"\"\" return self . app . store ( into , combination ) def translate ( self , deltaX , deltaY ): \"\"\"Moves the object relative to its current position.\"\"\" return self . app . translate ( deltaX , deltaY ) def translateBoundary ( self , deltaX , deltaY ): \"\"\"Moves the boundary of selection relative to its current position.\"\"\" return self . app . translateBoundary ( deltaX , deltaY )","title":"Selection"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.clear","text":"Clears the selection and does not copy it to the clipboard. Source code in photoshop/api/_selection.py 58 59 60 def clear ( self ): \"\"\"Clears the selection and does not copy it to the clipboard.\"\"\" self . app . clear ()","title":"clear()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.contract","text":"Contracts the selection. Source code in photoshop/api/_selection.py 62 63 64 def contract ( self , contract_by ): \"\"\"Contracts the selection.\"\"\" self . app . contract ( contract_by )","title":"contract()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.copy","text":"Copies the selection to the clipboard. Source code in photoshop/api/_selection.py 66 67 68 def copy ( self ): \"\"\"Copies the selection to the clipboard.\"\"\" self . app . copy ()","title":"copy()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.cut","text":"Cuts the current selection to the clipboard. Source code in photoshop/api/_selection.py 70 71 72 def cut ( self ): \"\"\"Cuts the current selection to the clipboard.\"\"\" self . app . cut ()","title":"cut()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.deselect","text":"Deselects the current selection. Source code in photoshop/api/_selection.py 77 78 79 def deselect ( self ): \"\"\"Deselects the current selection.\"\"\" return self . app . deselect ()","title":"deselect()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.expand","text":"Expands the selection. Parameters: Name Type Description Default by int The amount to expand the selection. required Source code in photoshop/api/_selection.py 81 82 83 84 85 86 87 88 def expand ( self , by : int ): \"\"\"Expands the selection. Args: by: The amount to expand the selection. \"\"\" self . app . expand ( by )","title":"expand()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.feather","text":"Feathers the edges of the selection. Parameters: Name Type Description Default by int The amount to feather the edge. required Source code in photoshop/api/_selection.py 90 91 92 93 94 95 96 97 def feather ( self , by : int ): \"\"\"Feathers the edges of the selection. Args: by: The amount to feather the edge. \"\"\" return self . app . feather ( by )","title":"feather()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.fill","text":"Fills the selection. Source code in photoshop/api/_selection.py 99 100 101 102 103 104 105 106 107 def fill ( self , fill_type : SolidColor , mode : ColorBlendMode = None , opacity = None , preserve_transparency = None , ): \"\"\"Fills the selection.\"\"\" return self . app . fill ( fill_type , mode , opacity , preserve_transparency )","title":"fill()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.grow","text":"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Parameters: Name Type Description Default tolerance int The tolerance range. Range: 0 to 255. required anti_alias bool If true, anti-aliasing is used. required Source code in photoshop/api/_selection.py 109 110 111 112 113 114 115 116 117 118 119 120 def grow ( self , tolerance , anti_alias ): \"\"\"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Args: tolerance (int): The tolerance range. Range: 0 to 255. anti_alias (bool): If true, anti-aliasing is used. \"\"\" return self . app . grow ( tolerance , anti_alias )","title":"grow()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.invert","text":"Inverts the selection. Source code in photoshop/api/_selection.py 122 123 124 def invert ( self ): \"\"\"Inverts the selection.\"\"\" self . app . invert ()","title":"invert()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.load","text":"Loads the selection from the specified channel. Source code in photoshop/api/_selection.py 126 127 128 def load ( self , from_channel , combination , inverting ): \"\"\"Loads the selection from the specified channel.\"\"\" return self . app . load ( from_channel , combination , inverting )","title":"load()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.makeWorkPath","text":"Makes this selection item the workpath for this document. Source code in photoshop/api/_selection.py 130 131 132 def makeWorkPath ( self , tolerance ): \"\"\"Makes this selection item the workpath for this document.\"\"\" self . app . makeWorkPath ( tolerance )","title":"makeWorkPath()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.resize","text":"Resizes the selected area to the specified dimensions and anchor position. Source code in photoshop/api/_selection.py 134 135 136 137 def resize ( self , horizontal , vertical , anchor ): \"\"\"Resizes the selected area to the specified dimensions and anchor position.\"\"\" self . app . resize ( horizontal , vertical , anchor )","title":"resize()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.resizeBoundary","text":"Scales the boundary of the selection. Source code in photoshop/api/_selection.py 139 140 141 def resizeBoundary ( self , horizontal , vertical , anchor ): \"\"\"Scales the boundary of the selection.\"\"\" self . app . resizeBoundary ( horizontal , vertical , anchor )","title":"resizeBoundary()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.rotate","text":"Rotates the object. Source code in photoshop/api/_selection.py 143 144 145 def rotate ( self , angle , anchor ): \"\"\"Rotates the object.\"\"\" self . app . rotate ( angle , anchor )","title":"rotate()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.rotateBoundary","text":"Rotates the boundary of the selection. Source code in photoshop/api/_selection.py 147 148 149 def rotateBoundary ( self , angle , anchor ): \"\"\"Rotates the boundary of the selection.\"\"\" self . app . rotateBoundary ( angle , anchor )","title":"rotateBoundary()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.selectBorder","text":"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Parameters: Name Type Description Default width int The width of the border selection. required Source code in photoshop/api/_selection.py 166 167 168 169 170 171 172 173 174 def selectBorder ( self , width ): \"\"\"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Args: width (int): The width of the border selection. \"\"\" return self . app . selectBorder ( width )","title":"selectBorder()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.smooth","text":"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels). Source code in photoshop/api/_selection.py 179 180 181 182 def smooth ( self , radius ): \"\"\"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).\"\"\" return self . app . smooth ( radius )","title":"smooth()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.store","text":"Saves the selection as a channel. Source code in photoshop/api/_selection.py 184 185 186 def store ( self , into , combination = SelectionType . ReplaceSelection ): \"\"\"Saves the selection as a channel.\"\"\" return self . app . store ( into , combination )","title":"store()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.stroke","text":"Strokes the selection. Parameters: Name Type Description Default strokeColor SolidColor The color to stroke the selection with. required width int The stroke width. required location int The stroke location. required mode int The color blend mode. required opacity int The opacity of the stroke color as a percentage. Range: 1 to 100. required preserveTransparency bool If true, preserves transparency. required Source code in photoshop/api/_selection.py 151 152 153 154 155 156 157 158 159 160 161 162 163 164 def stroke ( self , strokeColor , width , location , mode , opacity , preserveTransparency ): \"\"\"Strokes the selection. Args: strokeColor (SolidColor): The color to stroke the selection with. width (int): The stroke width. location (int): The stroke location. mode (int): The color blend mode. opacity (int): The opacity of the stroke color as a percentage. Range: 1 to 100. preserveTransparency (bool): If true, preserves transparency. \"\"\" return self . app . stroke ( strokeColor , width , location , mode , opacity , preserveTransparency )","title":"stroke()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.translate","text":"Moves the object relative to its current position. Source code in photoshop/api/_selection.py 188 189 190 def translate ( self , deltaX , deltaY ): \"\"\"Moves the object relative to its current position.\"\"\" return self . app . translate ( deltaX , deltaY )","title":"translate()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.translateBoundary","text":"Moves the boundary of selection relative to its current position. Source code in photoshop/api/_selection.py 192 193 194 def translateBoundary ( self , deltaX , deltaY ): \"\"\"Moves the boundary of selection relative to its current position.\"\"\" return self . app . translateBoundary ( deltaX , deltaY )","title":"translateBoundary()"},{"location":"reference/photoshop/api/_text_fonts/","text":"TextFonts Bases: Photoshop An installed font. Source code in photoshop/api/_text_fonts.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 class TextFonts ( Photoshop ): \"\"\"An installed font.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) \"\"\" MAGIC METHODS \"\"\" def __len__ ( self ): return self . length def __iter__ ( self ): for font in self . app : yield TextFont ( font ) def __contains__ ( self , name : str ): \"\"\"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Args: name: Name or postScriptName of the font to look for. Returns: bool: True if font is found, otherwise False. \"\"\" # Look for postScriptName if self . get ( name ): return True # Look for name (slow) for font in self : try : if font . name == name : return True except COMError : continue return False def __getitem__ ( self , key : str ): \"\"\"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Args: key: The postScriptName of the font. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a font with postScriptName \" { key } \"' ) \"\"\" METHODS \"\"\" def get ( self , key : str , default : Any = None ) -> Union [ TextFont , Any ]: \"\"\" Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Args: key: The postScriptName of the font. default: Value to return if font isn't found. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ( KeyError , ArgumentError ): return default def getByName ( self , name : str ) -> TextFont : \"\"\"Gets the font by the font name. Args: name: The name of the font. Returns: font instance. \"\"\" for font in self . app : if font . name == name : return TextFont ( font ) raise PhotoshopPythonAPIError ( 'Could not find a TextFont named \" {name} \"' ) \"\"\" PROPERTIES \"\"\" @property def _fonts ( self ): return [ a for a in self . app ] @property def length ( self ): \"\"\"The number pf elements in the collection.\"\"\" return len ( self . _fonts ) length property The number pf elements in the collection. __contains__ ( name ) Check if a font is installed. Lookup by font postScriptName (fastest) or name. Parameters: Name Type Description Default name str Name or postScriptName of the font to look for. required Returns: Name Type Description bool True if font is found, otherwise False. Source code in photoshop/api/_text_fonts.py 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 def __contains__ ( self , name : str ): \"\"\"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Args: name: Name or postScriptName of the font to look for. Returns: bool: True if font is found, otherwise False. \"\"\" # Look for postScriptName if self . get ( name ): return True # Look for name (slow) for font in self : try : if font . name == name : return True except COMError : continue return False __getitem__ ( key ) Access a given TextFont using dictionary key lookup, must provide the postScriptName. Parameters: Name Type Description Default key str The postScriptName of the font. required Returns: Type Description TextFont instance. Source code in photoshop/api/_text_fonts.py 53 54 55 56 57 58 59 60 61 62 63 64 65 66 def __getitem__ ( self , key : str ): \"\"\"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Args: key: The postScriptName of the font. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a font with postScriptName \" { key } \"' ) get ( key , default = None ) Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Parameters: Name Type Description Default key str The postScriptName of the font. required default Any Value to return if font isn't found. None Returns: Type Description Union [ TextFont , Any ] TextFont instance. Source code in photoshop/api/_text_fonts.py 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 def get ( self , key : str , default : Any = None ) -> Union [ TextFont , Any ]: \"\"\" Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Args: key: The postScriptName of the font. default: Value to return if font isn't found. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ( KeyError , ArgumentError ): return default getByName ( name ) Gets the font by the font name. Parameters: Name Type Description Default name str The name of the font. required Returns: Type Description TextFont font instance. Source code in photoshop/api/_text_fonts.py 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 def getByName ( self , name : str ) -> TextFont : \"\"\"Gets the font by the font name. Args: name: The name of the font. Returns: font instance. \"\"\" for font in self . app : if font . name == name : return TextFont ( font ) raise PhotoshopPythonAPIError ( 'Could not find a TextFont named \" {name} \"' )","title":"text_fonts"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts","text":"Bases: Photoshop An installed font. Source code in photoshop/api/_text_fonts.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 class TextFonts ( Photoshop ): \"\"\"An installed font.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) \"\"\" MAGIC METHODS \"\"\" def __len__ ( self ): return self . length def __iter__ ( self ): for font in self . app : yield TextFont ( font ) def __contains__ ( self , name : str ): \"\"\"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Args: name: Name or postScriptName of the font to look for. Returns: bool: True if font is found, otherwise False. \"\"\" # Look for postScriptName if self . get ( name ): return True # Look for name (slow) for font in self : try : if font . name == name : return True except COMError : continue return False def __getitem__ ( self , key : str ): \"\"\"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Args: key: The postScriptName of the font. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a font with postScriptName \" { key } \"' ) \"\"\" METHODS \"\"\" def get ( self , key : str , default : Any = None ) -> Union [ TextFont , Any ]: \"\"\" Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Args: key: The postScriptName of the font. default: Value to return if font isn't found. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ( KeyError , ArgumentError ): return default def getByName ( self , name : str ) -> TextFont : \"\"\"Gets the font by the font name. Args: name: The name of the font. Returns: font instance. \"\"\" for font in self . app : if font . name == name : return TextFont ( font ) raise PhotoshopPythonAPIError ( 'Could not find a TextFont named \" {name} \"' ) \"\"\" PROPERTIES \"\"\" @property def _fonts ( self ): return [ a for a in self . app ] @property def length ( self ): \"\"\"The number pf elements in the collection.\"\"\" return len ( self . _fonts )","title":"TextFonts"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.length","text":"The number pf elements in the collection.","title":"length"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.__contains__","text":"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Parameters: Name Type Description Default name str Name or postScriptName of the font to look for. required Returns: Name Type Description bool True if font is found, otherwise False. Source code in photoshop/api/_text_fonts.py 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 def __contains__ ( self , name : str ): \"\"\"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Args: name: Name or postScriptName of the font to look for. Returns: bool: True if font is found, otherwise False. \"\"\" # Look for postScriptName if self . get ( name ): return True # Look for name (slow) for font in self : try : if font . name == name : return True except COMError : continue return False","title":"__contains__()"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.__getitem__","text":"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Parameters: Name Type Description Default key str The postScriptName of the font. required Returns: Type Description TextFont instance. Source code in photoshop/api/_text_fonts.py 53 54 55 56 57 58 59 60 61 62 63 64 65 66 def __getitem__ ( self , key : str ): \"\"\"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Args: key: The postScriptName of the font. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a font with postScriptName \" { key } \"' )","title":"__getitem__()"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.get","text":"Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Parameters: Name Type Description Default key str The postScriptName of the font. required default Any Value to return if font isn't found. None Returns: Type Description Union [ TextFont , Any ] TextFont instance. Source code in photoshop/api/_text_fonts.py 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 def get ( self , key : str , default : Any = None ) -> Union [ TextFont , Any ]: \"\"\" Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Args: key: The postScriptName of the font. default: Value to return if font isn't found. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ( KeyError , ArgumentError ): return default","title":"get()"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.getByName","text":"Gets the font by the font name. Parameters: Name Type Description Default name str The name of the font. required Returns: Type Description TextFont font instance. Source code in photoshop/api/_text_fonts.py 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 def getByName ( self , name : str ) -> TextFont : \"\"\"Gets the font by the font name. Args: name: The name of the font. Returns: font instance. \"\"\" for font in self . app : if font . name == name : return TextFont ( font ) raise PhotoshopPythonAPIError ( 'Could not find a TextFont named \" {name} \"' )","title":"getByName()"},{"location":"reference/photoshop/api/action_descriptor/","text":"A record of key-text_font pairs for actions. such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. ActionDescriptor Bases: Photoshop A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_descriptor.py 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 class ActionDescriptor ( Photoshop ): \"\"\"A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionDescriptor\" def __init__ ( self ): super () . __init__ () self . _flag_as_method ( \"clear\" , \"erase\" , \"fromStream\" , \"getBoolean\" , \"getClass\" , \"getData\" , \"getDouble\" , \"getEnumerationType\" , \"getEnumerationValue\" , \"getInteger\" , \"getKey\" , \"getLargeInteger\" , \"getList\" , \"getObjectType\" , \"getObjectValue\" , \"getPath\" , \"getReference\" , \"getString\" , \"getType\" , \"getUnitDoubleType\" , \"getUnitDoubleValue\" , \"hasKey\" , \"isEqual\" , \"putBoolean\" , \"putClass\" , \"putData\" , \"putDouble\" , \"putEnumerated\" , \"putInteger\" , \"putLargeInteger\" , \"putList\" , \"putObject\" , \"putPath\" , \"putReference\" , \"putString\" , \"putUnitDouble\" , \"toSteadm\" , ) @property def count ( self ): \"\"\"The number of keys contained in the descriptor.\"\"\" return self . app . count def clear ( self ): \"\"\"Clears the descriptor.\"\"\" self . app . clear () def erase ( self , key : int ): \"\"\"Erases a key form the descriptor.\"\"\" self . app . erase ( key ) def fromStream ( self , value : str ): \"\"\"Create a descriptor from a stream of bytes. for reading from disk. \"\"\" self . app . fromStream ( value ) def getBoolean ( self , key : int ) -> int : \"\"\"Gets the text_font of a key of type boolean. Args: key (str): key of type boolean. Returns: bool: The text_font of a key of type boolean. \"\"\" return self . app . getBoolean ( key ) def getClass ( self , key ): \"\"\"Gets the text_font of a key of type class. Args: key (str): The key of type class. Returns: int: The text_font of a key of type class. \"\"\" return self . app . getClass ( key ) def getData ( self , key : int ) -> int : \"\"\"Gets raw byte data as a string value.\"\"\" return self . app . getData ( key ) def getDouble ( self , key : int ) -> float : \"\"\"Gets the value of a key of type double.\"\"\" return self . app . getDouble ( key ) def getEnumerationType ( self , index : int ) -> int : \"\"\"Gets the enumeration type of a key.\"\"\" return self . app . getEnumerationType ( index ) def getEnumerationValue ( self , index : int ) -> int : \"\"\"Gets the enumeration value of a key.\"\"\" return self . app . getEnumerationValue ( index ) def getInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type integer.\"\"\" return self . app . getInteger ( index ) def getKey ( self , index : int ) -> int : \"\"\"Gets the ID of the key provided by index.\"\"\" return self . app . getKey ( index ) def getLargeInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type large integer.\"\"\" return self . app . getLargeInteger ( index ) def getList ( self , index : int ) -> ActionList : \"\"\"Gets the value of a key of type list.\"\"\" return ActionList ( self . app . getList ( index )) def getObjectType ( self , key : int ) -> int : \"\"\"Gets the class ID of an object in a key of type object.\"\"\" return self . app . getObjectType ( key ) def getObjectValue ( self , key : int ) -> int : \"\"\"Get the class ID of an object in a key of type object.\"\"\" return self . app . getObjectValue ( key ) def getPath ( self , key : int ) -> Path : \"\"\"Gets the value of a key of type.\"\"\" return Path ( self . app . getPath ( key )) def getReference ( self , key : int ) -> ActionReference : \"\"\"Gets the value of a key of type.\"\"\" return ActionReference ( self . app . getReference ( key )) def getString ( self , key : int ) -> str : \"\"\"Gets the value of a key of type.\"\"\" return self . app . getString ( key ) def getType ( self , key : int ) -> DescValueType : \"\"\"Gets the type of a key.\"\"\" return DescValueType ( self . app . getType ( key )) def getUnitDoubleType ( self , key : int ) -> int : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleType ( key ) def getUnitDoubleValue ( self , key : int ) -> float : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleValue ( key ) def hasKey ( self , key : int ) -> bool : \"\"\"Checks whether the descriptor contains the provided key.\"\"\" return self . app . hasKey ( key ) def isEqual ( self , otherDesc ) -> bool : \"\"\"Determines whether the descriptor is the same as another descriptor. Args: otherDesc (.action_descriptor.ActionDescriptor): \"\"\" return self . app . isEqual ( otherDesc ) def putBoolean ( self , key : int , value : bool ): \"\"\"Sets the value for a key whose type is boolean.\"\"\" self . app . putBoolean ( key , value ) def putClass ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is class.\"\"\" self . app . putClass ( key , value ) def putData ( self , key : int , value : str ): \"\"\"Puts raw byte data as a string value.\"\"\" self . app . putData ( key , value ) def putDouble ( self , key : int , value : float ): \"\"\"Sets the value for a key whose type is double.\"\"\" self . app . putDouble ( key , value ) def putEnumerated ( self , key : int , enum_type : int , value : int ): \"\"\"Sets the enumeration type and value for a key.\"\"\" self . app . putEnumerated ( key , enum_type , value ) def putInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is integer.\"\"\" self . app . putInteger ( key , value ) def putLargeInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is large integer.\"\"\" self . app . putLargeInteger ( key , value ) def putList ( self , key : int , value : ActionList ): \"\"\"Sets the value for a key whose type is an ActionList object.\"\"\" self . app . putList ( key , value ) def putObject ( self , key : int , class_id : int , value ): \"\"\"Sets the value for a key whose type is an object.\"\"\" self . app . putObject ( key , class_id , value ) def putPath ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is path.\"\"\" self . app . putPath ( key , value ) def putReference ( self , key : int , value : ActionReference ): \"\"\"Sets the value for a key whose type is an object reference.\"\"\" self . app . putReference ( key , value ) def putString ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is string.\"\"\" self . app . putString ( key , value ) def putUnitDouble ( self , key : int , unit_id : int , value : float ): \"\"\"Sets the value for a key whose type is a unit value formatted as double.\"\"\" self . app . putUnitDouble ( key , unit_id , value ) def toStream ( self ) -> str : \"\"\"Gets the entire descriptor as as stream of bytes, for writing to disk.\"\"\" return self . app . toSteadm () count property The number of keys contained in the descriptor. clear () Clears the descriptor. Source code in photoshop/api/action_descriptor.py 77 78 79 def clear ( self ): \"\"\"Clears the descriptor.\"\"\" self . app . clear () erase ( key ) Erases a key form the descriptor. Source code in photoshop/api/action_descriptor.py 81 82 83 def erase ( self , key : int ): \"\"\"Erases a key form the descriptor.\"\"\" self . app . erase ( key ) fromStream ( value ) Create a descriptor from a stream of bytes. for reading from disk. Source code in photoshop/api/action_descriptor.py 85 86 87 88 89 90 91 def fromStream ( self , value : str ): \"\"\"Create a descriptor from a stream of bytes. for reading from disk. \"\"\" self . app . fromStream ( value ) getBoolean ( key ) Gets the text_font of a key of type boolean. Parameters: Name Type Description Default key str key of type boolean. required Returns: Name Type Description bool int The text_font of a key of type boolean. Source code in photoshop/api/action_descriptor.py 93 94 95 96 97 98 99 100 101 102 103 def getBoolean ( self , key : int ) -> int : \"\"\"Gets the text_font of a key of type boolean. Args: key (str): key of type boolean. Returns: bool: The text_font of a key of type boolean. \"\"\" return self . app . getBoolean ( key ) getClass ( key ) Gets the text_font of a key of type class. Parameters: Name Type Description Default key str The key of type class. required Returns: Name Type Description int The text_font of a key of type class. Source code in photoshop/api/action_descriptor.py 105 106 107 108 109 110 111 112 113 114 115 def getClass ( self , key ): \"\"\"Gets the text_font of a key of type class. Args: key (str): The key of type class. Returns: int: The text_font of a key of type class. \"\"\" return self . app . getClass ( key ) getData ( key ) Gets raw byte data as a string value. Source code in photoshop/api/action_descriptor.py 117 118 119 def getData ( self , key : int ) -> int : \"\"\"Gets raw byte data as a string value.\"\"\" return self . app . getData ( key ) getDouble ( key ) Gets the value of a key of type double. Source code in photoshop/api/action_descriptor.py 121 122 123 def getDouble ( self , key : int ) -> float : \"\"\"Gets the value of a key of type double.\"\"\" return self . app . getDouble ( key ) getEnumerationType ( index ) Gets the enumeration type of a key. Source code in photoshop/api/action_descriptor.py 125 126 127 def getEnumerationType ( self , index : int ) -> int : \"\"\"Gets the enumeration type of a key.\"\"\" return self . app . getEnumerationType ( index ) getEnumerationValue ( index ) Gets the enumeration value of a key. Source code in photoshop/api/action_descriptor.py 129 130 131 def getEnumerationValue ( self , index : int ) -> int : \"\"\"Gets the enumeration value of a key.\"\"\" return self . app . getEnumerationValue ( index ) getInteger ( index ) Gets the value of a key of type integer. Source code in photoshop/api/action_descriptor.py 133 134 135 def getInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type integer.\"\"\" return self . app . getInteger ( index ) getKey ( index ) Gets the ID of the key provided by index. Source code in photoshop/api/action_descriptor.py 137 138 139 def getKey ( self , index : int ) -> int : \"\"\"Gets the ID of the key provided by index.\"\"\" return self . app . getKey ( index ) getLargeInteger ( index ) Gets the value of a key of type large integer. Source code in photoshop/api/action_descriptor.py 141 142 143 def getLargeInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type large integer.\"\"\" return self . app . getLargeInteger ( index ) getList ( index ) Gets the value of a key of type list. Source code in photoshop/api/action_descriptor.py 145 146 147 def getList ( self , index : int ) -> ActionList : \"\"\"Gets the value of a key of type list.\"\"\" return ActionList ( self . app . getList ( index )) getObjectType ( key ) Gets the class ID of an object in a key of type object. Source code in photoshop/api/action_descriptor.py 149 150 151 def getObjectType ( self , key : int ) -> int : \"\"\"Gets the class ID of an object in a key of type object.\"\"\" return self . app . getObjectType ( key ) getObjectValue ( key ) Get the class ID of an object in a key of type object. Source code in photoshop/api/action_descriptor.py 153 154 155 def getObjectValue ( self , key : int ) -> int : \"\"\"Get the class ID of an object in a key of type object.\"\"\" return self . app . getObjectValue ( key ) getPath ( key ) Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 157 158 159 def getPath ( self , key : int ) -> Path : \"\"\"Gets the value of a key of type.\"\"\" return Path ( self . app . getPath ( key )) getReference ( key ) Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 161 162 163 def getReference ( self , key : int ) -> ActionReference : \"\"\"Gets the value of a key of type.\"\"\" return ActionReference ( self . app . getReference ( key )) getString ( key ) Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 165 166 167 def getString ( self , key : int ) -> str : \"\"\"Gets the value of a key of type.\"\"\" return self . app . getString ( key ) getType ( key ) Gets the type of a key. Source code in photoshop/api/action_descriptor.py 169 170 171 def getType ( self , key : int ) -> DescValueType : \"\"\"Gets the type of a key.\"\"\" return DescValueType ( self . app . getType ( key )) getUnitDoubleType ( key ) Gets the unit type of a key of type UnitDouble. Source code in photoshop/api/action_descriptor.py 173 174 175 def getUnitDoubleType ( self , key : int ) -> int : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleType ( key ) getUnitDoubleValue ( key ) Gets the unit type of a key of type UnitDouble. Source code in photoshop/api/action_descriptor.py 177 178 179 def getUnitDoubleValue ( self , key : int ) -> float : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleValue ( key ) hasKey ( key ) Checks whether the descriptor contains the provided key. Source code in photoshop/api/action_descriptor.py 181 182 183 def hasKey ( self , key : int ) -> bool : \"\"\"Checks whether the descriptor contains the provided key.\"\"\" return self . app . hasKey ( key ) isEqual ( otherDesc ) Determines whether the descriptor is the same as another descriptor. Parameters: Name Type Description Default otherDesc .action_descriptor.ActionDescriptor required Source code in photoshop/api/action_descriptor.py 185 186 187 188 189 190 191 192 def isEqual ( self , otherDesc ) -> bool : \"\"\"Determines whether the descriptor is the same as another descriptor. Args: otherDesc (.action_descriptor.ActionDescriptor): \"\"\" return self . app . isEqual ( otherDesc ) putBoolean ( key , value ) Sets the value for a key whose type is boolean. Source code in photoshop/api/action_descriptor.py 194 195 196 def putBoolean ( self , key : int , value : bool ): \"\"\"Sets the value for a key whose type is boolean.\"\"\" self . app . putBoolean ( key , value ) putClass ( key , value ) Sets the value for a key whose type is class. Source code in photoshop/api/action_descriptor.py 198 199 200 def putClass ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is class.\"\"\" self . app . putClass ( key , value ) putData ( key , value ) Puts raw byte data as a string value. Source code in photoshop/api/action_descriptor.py 202 203 204 def putData ( self , key : int , value : str ): \"\"\"Puts raw byte data as a string value.\"\"\" self . app . putData ( key , value ) putDouble ( key , value ) Sets the value for a key whose type is double. Source code in photoshop/api/action_descriptor.py 206 207 208 def putDouble ( self , key : int , value : float ): \"\"\"Sets the value for a key whose type is double.\"\"\" self . app . putDouble ( key , value ) putEnumerated ( key , enum_type , value ) Sets the enumeration type and value for a key. Source code in photoshop/api/action_descriptor.py 210 211 212 def putEnumerated ( self , key : int , enum_type : int , value : int ): \"\"\"Sets the enumeration type and value for a key.\"\"\" self . app . putEnumerated ( key , enum_type , value ) putInteger ( key , value ) Sets the value for a key whose type is integer. Source code in photoshop/api/action_descriptor.py 214 215 216 def putInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is integer.\"\"\" self . app . putInteger ( key , value ) putLargeInteger ( key , value ) Sets the value for a key whose type is large integer. Source code in photoshop/api/action_descriptor.py 218 219 220 def putLargeInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is large integer.\"\"\" self . app . putLargeInteger ( key , value ) putList ( key , value ) Sets the value for a key whose type is an ActionList object. Source code in photoshop/api/action_descriptor.py 222 223 224 def putList ( self , key : int , value : ActionList ): \"\"\"Sets the value for a key whose type is an ActionList object.\"\"\" self . app . putList ( key , value ) putObject ( key , class_id , value ) Sets the value for a key whose type is an object. Source code in photoshop/api/action_descriptor.py 226 227 228 def putObject ( self , key : int , class_id : int , value ): \"\"\"Sets the value for a key whose type is an object.\"\"\" self . app . putObject ( key , class_id , value ) putPath ( key , value ) Sets the value for a key whose type is path. Source code in photoshop/api/action_descriptor.py 230 231 232 def putPath ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is path.\"\"\" self . app . putPath ( key , value ) putReference ( key , value ) Sets the value for a key whose type is an object reference. Source code in photoshop/api/action_descriptor.py 234 235 236 def putReference ( self , key : int , value : ActionReference ): \"\"\"Sets the value for a key whose type is an object reference.\"\"\" self . app . putReference ( key , value ) putString ( key , value ) Sets the value for a key whose type is string. Source code in photoshop/api/action_descriptor.py 238 239 240 def putString ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is string.\"\"\" self . app . putString ( key , value ) putUnitDouble ( key , unit_id , value ) Sets the value for a key whose type is a unit value formatted as double. Source code in photoshop/api/action_descriptor.py 242 243 244 245 def putUnitDouble ( self , key : int , unit_id : int , value : float ): \"\"\"Sets the value for a key whose type is a unit value formatted as double.\"\"\" self . app . putUnitDouble ( key , unit_id , value ) toStream () Gets the entire descriptor as as stream of bytes, for writing to disk. Source code in photoshop/api/action_descriptor.py 247 248 249 250 def toStream ( self ) -> str : \"\"\"Gets the entire descriptor as as stream of bytes, for writing to disk.\"\"\" return self . app . toSteadm ()","title":"action_descriptor"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor","text":"Bases: Photoshop A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_descriptor.py 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 class ActionDescriptor ( Photoshop ): \"\"\"A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionDescriptor\" def __init__ ( self ): super () . __init__ () self . _flag_as_method ( \"clear\" , \"erase\" , \"fromStream\" , \"getBoolean\" , \"getClass\" , \"getData\" , \"getDouble\" , \"getEnumerationType\" , \"getEnumerationValue\" , \"getInteger\" , \"getKey\" , \"getLargeInteger\" , \"getList\" , \"getObjectType\" , \"getObjectValue\" , \"getPath\" , \"getReference\" , \"getString\" , \"getType\" , \"getUnitDoubleType\" , \"getUnitDoubleValue\" , \"hasKey\" , \"isEqual\" , \"putBoolean\" , \"putClass\" , \"putData\" , \"putDouble\" , \"putEnumerated\" , \"putInteger\" , \"putLargeInteger\" , \"putList\" , \"putObject\" , \"putPath\" , \"putReference\" , \"putString\" , \"putUnitDouble\" , \"toSteadm\" , ) @property def count ( self ): \"\"\"The number of keys contained in the descriptor.\"\"\" return self . app . count def clear ( self ): \"\"\"Clears the descriptor.\"\"\" self . app . clear () def erase ( self , key : int ): \"\"\"Erases a key form the descriptor.\"\"\" self . app . erase ( key ) def fromStream ( self , value : str ): \"\"\"Create a descriptor from a stream of bytes. for reading from disk. \"\"\" self . app . fromStream ( value ) def getBoolean ( self , key : int ) -> int : \"\"\"Gets the text_font of a key of type boolean. Args: key (str): key of type boolean. Returns: bool: The text_font of a key of type boolean. \"\"\" return self . app . getBoolean ( key ) def getClass ( self , key ): \"\"\"Gets the text_font of a key of type class. Args: key (str): The key of type class. Returns: int: The text_font of a key of type class. \"\"\" return self . app . getClass ( key ) def getData ( self , key : int ) -> int : \"\"\"Gets raw byte data as a string value.\"\"\" return self . app . getData ( key ) def getDouble ( self , key : int ) -> float : \"\"\"Gets the value of a key of type double.\"\"\" return self . app . getDouble ( key ) def getEnumerationType ( self , index : int ) -> int : \"\"\"Gets the enumeration type of a key.\"\"\" return self . app . getEnumerationType ( index ) def getEnumerationValue ( self , index : int ) -> int : \"\"\"Gets the enumeration value of a key.\"\"\" return self . app . getEnumerationValue ( index ) def getInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type integer.\"\"\" return self . app . getInteger ( index ) def getKey ( self , index : int ) -> int : \"\"\"Gets the ID of the key provided by index.\"\"\" return self . app . getKey ( index ) def getLargeInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type large integer.\"\"\" return self . app . getLargeInteger ( index ) def getList ( self , index : int ) -> ActionList : \"\"\"Gets the value of a key of type list.\"\"\" return ActionList ( self . app . getList ( index )) def getObjectType ( self , key : int ) -> int : \"\"\"Gets the class ID of an object in a key of type object.\"\"\" return self . app . getObjectType ( key ) def getObjectValue ( self , key : int ) -> int : \"\"\"Get the class ID of an object in a key of type object.\"\"\" return self . app . getObjectValue ( key ) def getPath ( self , key : int ) -> Path : \"\"\"Gets the value of a key of type.\"\"\" return Path ( self . app . getPath ( key )) def getReference ( self , key : int ) -> ActionReference : \"\"\"Gets the value of a key of type.\"\"\" return ActionReference ( self . app . getReference ( key )) def getString ( self , key : int ) -> str : \"\"\"Gets the value of a key of type.\"\"\" return self . app . getString ( key ) def getType ( self , key : int ) -> DescValueType : \"\"\"Gets the type of a key.\"\"\" return DescValueType ( self . app . getType ( key )) def getUnitDoubleType ( self , key : int ) -> int : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleType ( key ) def getUnitDoubleValue ( self , key : int ) -> float : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleValue ( key ) def hasKey ( self , key : int ) -> bool : \"\"\"Checks whether the descriptor contains the provided key.\"\"\" return self . app . hasKey ( key ) def isEqual ( self , otherDesc ) -> bool : \"\"\"Determines whether the descriptor is the same as another descriptor. Args: otherDesc (.action_descriptor.ActionDescriptor): \"\"\" return self . app . isEqual ( otherDesc ) def putBoolean ( self , key : int , value : bool ): \"\"\"Sets the value for a key whose type is boolean.\"\"\" self . app . putBoolean ( key , value ) def putClass ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is class.\"\"\" self . app . putClass ( key , value ) def putData ( self , key : int , value : str ): \"\"\"Puts raw byte data as a string value.\"\"\" self . app . putData ( key , value ) def putDouble ( self , key : int , value : float ): \"\"\"Sets the value for a key whose type is double.\"\"\" self . app . putDouble ( key , value ) def putEnumerated ( self , key : int , enum_type : int , value : int ): \"\"\"Sets the enumeration type and value for a key.\"\"\" self . app . putEnumerated ( key , enum_type , value ) def putInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is integer.\"\"\" self . app . putInteger ( key , value ) def putLargeInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is large integer.\"\"\" self . app . putLargeInteger ( key , value ) def putList ( self , key : int , value : ActionList ): \"\"\"Sets the value for a key whose type is an ActionList object.\"\"\" self . app . putList ( key , value ) def putObject ( self , key : int , class_id : int , value ): \"\"\"Sets the value for a key whose type is an object.\"\"\" self . app . putObject ( key , class_id , value ) def putPath ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is path.\"\"\" self . app . putPath ( key , value ) def putReference ( self , key : int , value : ActionReference ): \"\"\"Sets the value for a key whose type is an object reference.\"\"\" self . app . putReference ( key , value ) def putString ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is string.\"\"\" self . app . putString ( key , value ) def putUnitDouble ( self , key : int , unit_id : int , value : float ): \"\"\"Sets the value for a key whose type is a unit value formatted as double.\"\"\" self . app . putUnitDouble ( key , unit_id , value ) def toStream ( self ) -> str : \"\"\"Gets the entire descriptor as as stream of bytes, for writing to disk.\"\"\" return self . app . toSteadm ()","title":"ActionDescriptor"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.count","text":"The number of keys contained in the descriptor.","title":"count"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.clear","text":"Clears the descriptor. Source code in photoshop/api/action_descriptor.py 77 78 79 def clear ( self ): \"\"\"Clears the descriptor.\"\"\" self . app . clear ()","title":"clear()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.erase","text":"Erases a key form the descriptor. Source code in photoshop/api/action_descriptor.py 81 82 83 def erase ( self , key : int ): \"\"\"Erases a key form the descriptor.\"\"\" self . app . erase ( key )","title":"erase()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.fromStream","text":"Create a descriptor from a stream of bytes. for reading from disk. Source code in photoshop/api/action_descriptor.py 85 86 87 88 89 90 91 def fromStream ( self , value : str ): \"\"\"Create a descriptor from a stream of bytes. for reading from disk. \"\"\" self . app . fromStream ( value )","title":"fromStream()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getBoolean","text":"Gets the text_font of a key of type boolean. Parameters: Name Type Description Default key str key of type boolean. required Returns: Name Type Description bool int The text_font of a key of type boolean. Source code in photoshop/api/action_descriptor.py 93 94 95 96 97 98 99 100 101 102 103 def getBoolean ( self , key : int ) -> int : \"\"\"Gets the text_font of a key of type boolean. Args: key (str): key of type boolean. Returns: bool: The text_font of a key of type boolean. \"\"\" return self . app . getBoolean ( key )","title":"getBoolean()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getClass","text":"Gets the text_font of a key of type class. Parameters: Name Type Description Default key str The key of type class. required Returns: Name Type Description int The text_font of a key of type class. Source code in photoshop/api/action_descriptor.py 105 106 107 108 109 110 111 112 113 114 115 def getClass ( self , key ): \"\"\"Gets the text_font of a key of type class. Args: key (str): The key of type class. Returns: int: The text_font of a key of type class. \"\"\" return self . app . getClass ( key )","title":"getClass()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getData","text":"Gets raw byte data as a string value. Source code in photoshop/api/action_descriptor.py 117 118 119 def getData ( self , key : int ) -> int : \"\"\"Gets raw byte data as a string value.\"\"\" return self . app . getData ( key )","title":"getData()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getDouble","text":"Gets the value of a key of type double. Source code in photoshop/api/action_descriptor.py 121 122 123 def getDouble ( self , key : int ) -> float : \"\"\"Gets the value of a key of type double.\"\"\" return self . app . getDouble ( key )","title":"getDouble()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getEnumerationType","text":"Gets the enumeration type of a key. Source code in photoshop/api/action_descriptor.py 125 126 127 def getEnumerationType ( self , index : int ) -> int : \"\"\"Gets the enumeration type of a key.\"\"\" return self . app . getEnumerationType ( index )","title":"getEnumerationType()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getEnumerationValue","text":"Gets the enumeration value of a key. Source code in photoshop/api/action_descriptor.py 129 130 131 def getEnumerationValue ( self , index : int ) -> int : \"\"\"Gets the enumeration value of a key.\"\"\" return self . app . getEnumerationValue ( index )","title":"getEnumerationValue()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getInteger","text":"Gets the value of a key of type integer. Source code in photoshop/api/action_descriptor.py 133 134 135 def getInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type integer.\"\"\" return self . app . getInteger ( index )","title":"getInteger()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getKey","text":"Gets the ID of the key provided by index. Source code in photoshop/api/action_descriptor.py 137 138 139 def getKey ( self , index : int ) -> int : \"\"\"Gets the ID of the key provided by index.\"\"\" return self . app . getKey ( index )","title":"getKey()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getLargeInteger","text":"Gets the value of a key of type large integer. Source code in photoshop/api/action_descriptor.py 141 142 143 def getLargeInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type large integer.\"\"\" return self . app . getLargeInteger ( index )","title":"getLargeInteger()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getList","text":"Gets the value of a key of type list. Source code in photoshop/api/action_descriptor.py 145 146 147 def getList ( self , index : int ) -> ActionList : \"\"\"Gets the value of a key of type list.\"\"\" return ActionList ( self . app . getList ( index ))","title":"getList()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getObjectType","text":"Gets the class ID of an object in a key of type object. Source code in photoshop/api/action_descriptor.py 149 150 151 def getObjectType ( self , key : int ) -> int : \"\"\"Gets the class ID of an object in a key of type object.\"\"\" return self . app . getObjectType ( key )","title":"getObjectType()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getObjectValue","text":"Get the class ID of an object in a key of type object. Source code in photoshop/api/action_descriptor.py 153 154 155 def getObjectValue ( self , key : int ) -> int : \"\"\"Get the class ID of an object in a key of type object.\"\"\" return self . app . getObjectValue ( key )","title":"getObjectValue()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getPath","text":"Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 157 158 159 def getPath ( self , key : int ) -> Path : \"\"\"Gets the value of a key of type.\"\"\" return Path ( self . app . getPath ( key ))","title":"getPath()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getReference","text":"Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 161 162 163 def getReference ( self , key : int ) -> ActionReference : \"\"\"Gets the value of a key of type.\"\"\" return ActionReference ( self . app . getReference ( key ))","title":"getReference()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getString","text":"Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 165 166 167 def getString ( self , key : int ) -> str : \"\"\"Gets the value of a key of type.\"\"\" return self . app . getString ( key )","title":"getString()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getType","text":"Gets the type of a key. Source code in photoshop/api/action_descriptor.py 169 170 171 def getType ( self , key : int ) -> DescValueType : \"\"\"Gets the type of a key.\"\"\" return DescValueType ( self . app . getType ( key ))","title":"getType()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getUnitDoubleType","text":"Gets the unit type of a key of type UnitDouble. Source code in photoshop/api/action_descriptor.py 173 174 175 def getUnitDoubleType ( self , key : int ) -> int : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleType ( key )","title":"getUnitDoubleType()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getUnitDoubleValue","text":"Gets the unit type of a key of type UnitDouble. Source code in photoshop/api/action_descriptor.py 177 178 179 def getUnitDoubleValue ( self , key : int ) -> float : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleValue ( key )","title":"getUnitDoubleValue()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.hasKey","text":"Checks whether the descriptor contains the provided key. Source code in photoshop/api/action_descriptor.py 181 182 183 def hasKey ( self , key : int ) -> bool : \"\"\"Checks whether the descriptor contains the provided key.\"\"\" return self . app . hasKey ( key )","title":"hasKey()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.isEqual","text":"Determines whether the descriptor is the same as another descriptor. Parameters: Name Type Description Default otherDesc .action_descriptor.ActionDescriptor required Source code in photoshop/api/action_descriptor.py 185 186 187 188 189 190 191 192 def isEqual ( self , otherDesc ) -> bool : \"\"\"Determines whether the descriptor is the same as another descriptor. Args: otherDesc (.action_descriptor.ActionDescriptor): \"\"\" return self . app . isEqual ( otherDesc )","title":"isEqual()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putBoolean","text":"Sets the value for a key whose type is boolean. Source code in photoshop/api/action_descriptor.py 194 195 196 def putBoolean ( self , key : int , value : bool ): \"\"\"Sets the value for a key whose type is boolean.\"\"\" self . app . putBoolean ( key , value )","title":"putBoolean()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putClass","text":"Sets the value for a key whose type is class. Source code in photoshop/api/action_descriptor.py 198 199 200 def putClass ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is class.\"\"\" self . app . putClass ( key , value )","title":"putClass()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putData","text":"Puts raw byte data as a string value. Source code in photoshop/api/action_descriptor.py 202 203 204 def putData ( self , key : int , value : str ): \"\"\"Puts raw byte data as a string value.\"\"\" self . app . putData ( key , value )","title":"putData()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putDouble","text":"Sets the value for a key whose type is double. Source code in photoshop/api/action_descriptor.py 206 207 208 def putDouble ( self , key : int , value : float ): \"\"\"Sets the value for a key whose type is double.\"\"\" self . app . putDouble ( key , value )","title":"putDouble()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putEnumerated","text":"Sets the enumeration type and value for a key. Source code in photoshop/api/action_descriptor.py 210 211 212 def putEnumerated ( self , key : int , enum_type : int , value : int ): \"\"\"Sets the enumeration type and value for a key.\"\"\" self . app . putEnumerated ( key , enum_type , value )","title":"putEnumerated()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putInteger","text":"Sets the value for a key whose type is integer. Source code in photoshop/api/action_descriptor.py 214 215 216 def putInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is integer.\"\"\" self . app . putInteger ( key , value )","title":"putInteger()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putLargeInteger","text":"Sets the value for a key whose type is large integer. Source code in photoshop/api/action_descriptor.py 218 219 220 def putLargeInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is large integer.\"\"\" self . app . putLargeInteger ( key , value )","title":"putLargeInteger()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putList","text":"Sets the value for a key whose type is an ActionList object. Source code in photoshop/api/action_descriptor.py 222 223 224 def putList ( self , key : int , value : ActionList ): \"\"\"Sets the value for a key whose type is an ActionList object.\"\"\" self . app . putList ( key , value )","title":"putList()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putObject","text":"Sets the value for a key whose type is an object. Source code in photoshop/api/action_descriptor.py 226 227 228 def putObject ( self , key : int , class_id : int , value ): \"\"\"Sets the value for a key whose type is an object.\"\"\" self . app . putObject ( key , class_id , value )","title":"putObject()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putPath","text":"Sets the value for a key whose type is path. Source code in photoshop/api/action_descriptor.py 230 231 232 def putPath ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is path.\"\"\" self . app . putPath ( key , value )","title":"putPath()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putReference","text":"Sets the value for a key whose type is an object reference. Source code in photoshop/api/action_descriptor.py 234 235 236 def putReference ( self , key : int , value : ActionReference ): \"\"\"Sets the value for a key whose type is an object reference.\"\"\" self . app . putReference ( key , value )","title":"putReference()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putString","text":"Sets the value for a key whose type is string. Source code in photoshop/api/action_descriptor.py 238 239 240 def putString ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is string.\"\"\" self . app . putString ( key , value )","title":"putString()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putUnitDouble","text":"Sets the value for a key whose type is a unit value formatted as double. Source code in photoshop/api/action_descriptor.py 242 243 244 245 def putUnitDouble ( self , key : int , unit_id : int , value : float ): \"\"\"Sets the value for a key whose type is a unit value formatted as double.\"\"\" self . app . putUnitDouble ( key , unit_id , value )","title":"putUnitDouble()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.toStream","text":"Gets the entire descriptor as as stream of bytes, for writing to disk. Source code in photoshop/api/action_descriptor.py 247 248 249 250 def toStream ( self ) -> str : \"\"\"Gets the entire descriptor as as stream of bytes, for writing to disk.\"\"\" return self . app . toSteadm ()","title":"toStream()"},{"location":"reference/photoshop/api/action_list/","text":"This object provides an array-style mechanism for storing data. It can be used for low-level access info Photoshop. ActionList Bases: Photoshop The list of commands that comprise an Action. (such as an Action created using the Actions palette in the Adobe Photoshop application). The action list object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_list.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 class ActionList ( Photoshop ): \"\"\"The list of commands that comprise an Action. (such as an Action created using the Actions palette in the Adobe Photoshop application). The action list object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionList\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"getBoolean\" , \"getClass\" , \"getData\" , \"getDouble\" , \"getEnumerationType\" , \"getEnumerationValue\" , \"getInteger\" , \"getLargeInteger\" , \"getList\" , \"getObjectType\" , ) @property def count ( self ): return self . app . count def getBoolean ( self , index ): return self . app . getBoolean ( index ) def getClass ( self , index ): return self . app . getClass ( index ) def getData ( self , index ): return self . app . getData ( index ) def getDouble ( self , index ): return self . app . getDouble ( index ) def getEnumerationType ( self , index ): return self . app . getEnumerationType ( index ) def getEnumerationValue ( self , index ): return self . app . getEnumerationValue ( index ) def getInteger ( self , index ): return self . app . getInteger ( index ) def getLargeInteger ( self , index ): return self . app . getLargeInteger ( index ) def getList ( self , index ): return self . app . getList ( index ) def getObjectType ( self , index ): return self . app . getObjectType ( index )","title":"action_list"},{"location":"reference/photoshop/api/action_list/#photoshop.api.action_list.ActionList","text":"Bases: Photoshop The list of commands that comprise an Action. (such as an Action created using the Actions palette in the Adobe Photoshop application). The action list object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_list.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 class ActionList ( Photoshop ): \"\"\"The list of commands that comprise an Action. (such as an Action created using the Actions palette in the Adobe Photoshop application). The action list object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionList\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"getBoolean\" , \"getClass\" , \"getData\" , \"getDouble\" , \"getEnumerationType\" , \"getEnumerationValue\" , \"getInteger\" , \"getLargeInteger\" , \"getList\" , \"getObjectType\" , ) @property def count ( self ): return self . app . count def getBoolean ( self , index ): return self . app . getBoolean ( index ) def getClass ( self , index ): return self . app . getClass ( index ) def getData ( self , index ): return self . app . getData ( index ) def getDouble ( self , index ): return self . app . getDouble ( index ) def getEnumerationType ( self , index ): return self . app . getEnumerationType ( index ) def getEnumerationValue ( self , index ): return self . app . getEnumerationValue ( index ) def getInteger ( self , index ): return self . app . getInteger ( index ) def getLargeInteger ( self , index ): return self . app . getLargeInteger ( index ) def getList ( self , index ): return self . app . getList ( index ) def getObjectType ( self , index ): return self . app . getObjectType ( index )","title":"ActionList"},{"location":"reference/photoshop/api/action_reference/","text":"This object provides information about what the action is refering to. For example, when referring to the name of something you might use keyName. The reference would also need to know what name you are referring to. In this case you could use classDocument for the name of the document or classLayer for the name of the layer. It can be used for low-level access into Contains data associated with an ActionDescriptor. ActionReference Bases: Photoshop Contains data describing a referenced Action. The action reference object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_reference.py 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 class ActionReference ( Photoshop ): \"\"\"Contains data describing a referenced Action. The action reference object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionReference\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"getContainer\" , \"getDesiredClass\" , \"getEnumeratedType\" , \"getEnumeratedValue\" , \"getForm\" , \"getIdentifier\" , \"getIndex\" , \"putName\" , \"putClass\" , \"putEnumerated\" , \"putIdentifier\" , \"putIndex\" , \"putOffset\" , \"putProperty\" , ) def getContainer ( self ): return self . app . getContainer () def getDesiredClass ( self ): return self . app . getDesiredClass () def getEnumeratedType ( self ) -> int : return self . app . getEnumeratedType () def getEnumeratedValue ( self ) -> int : return self . app . getEnumeratedValue () def getForm ( self ) -> ReferenceFormType : \"\"\"Gets the form of this action reference.\"\"\" return ReferenceFormType ( self . app . getForm ()) def getIdentifier ( self ) -> int : \"\"\"Gets the identifier value for a reference whose form is identifier.\"\"\" return self . app . getIdentifier () def getIndex ( self ) -> int : \"\"\"Gets the index value for a reference in a list or array,\"\"\" return self . app . getIndex () def putName ( self , key , value ): return self . app . putName ( key , value ) def putClass ( self , value ): return self . app . putClass ( value ) def putEnumerated ( self , desired_class , enum_type , value ): \"\"\"Puts an enumeration type and ID into a reference along with the desired class for the reference.\"\"\" return self . app . putEnumerated ( desired_class , enum_type , value ) def putIdentifier ( self , desired_class , value ): return self . app . putIdentifier ( desired_class , value ) def putIndex ( self , desired_class , value ): return self . app . putIndex ( desired_class , value ) def putOffset ( self , desired_class , value ): return self . app . putOffset ( desired_class , value ) def putProperty ( self , desired_class , value ): return self . app . putProperty ( desired_class , value ) getForm () Gets the form of this action reference. Source code in photoshop/api/action_reference.py 57 58 59 def getForm ( self ) -> ReferenceFormType : \"\"\"Gets the form of this action reference.\"\"\" return ReferenceFormType ( self . app . getForm ()) getIdentifier () Gets the identifier value for a reference whose form is identifier. Source code in photoshop/api/action_reference.py 61 62 63 64 def getIdentifier ( self ) -> int : \"\"\"Gets the identifier value for a reference whose form is identifier.\"\"\" return self . app . getIdentifier () getIndex () Gets the index value for a reference in a list or array, Source code in photoshop/api/action_reference.py 66 67 68 def getIndex ( self ) -> int : \"\"\"Gets the index value for a reference in a list or array,\"\"\" return self . app . getIndex () putEnumerated ( desired_class , enum_type , value ) Puts an enumeration type and ID into a reference along with the desired class for the reference. Source code in photoshop/api/action_reference.py 76 77 78 79 def putEnumerated ( self , desired_class , enum_type , value ): \"\"\"Puts an enumeration type and ID into a reference along with the desired class for the reference.\"\"\" return self . app . putEnumerated ( desired_class , enum_type , value )","title":"action_reference"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference","text":"Bases: Photoshop Contains data describing a referenced Action. The action reference object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_reference.py 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 class ActionReference ( Photoshop ): \"\"\"Contains data describing a referenced Action. The action reference object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionReference\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"getContainer\" , \"getDesiredClass\" , \"getEnumeratedType\" , \"getEnumeratedValue\" , \"getForm\" , \"getIdentifier\" , \"getIndex\" , \"putName\" , \"putClass\" , \"putEnumerated\" , \"putIdentifier\" , \"putIndex\" , \"putOffset\" , \"putProperty\" , ) def getContainer ( self ): return self . app . getContainer () def getDesiredClass ( self ): return self . app . getDesiredClass () def getEnumeratedType ( self ) -> int : return self . app . getEnumeratedType () def getEnumeratedValue ( self ) -> int : return self . app . getEnumeratedValue () def getForm ( self ) -> ReferenceFormType : \"\"\"Gets the form of this action reference.\"\"\" return ReferenceFormType ( self . app . getForm ()) def getIdentifier ( self ) -> int : \"\"\"Gets the identifier value for a reference whose form is identifier.\"\"\" return self . app . getIdentifier () def getIndex ( self ) -> int : \"\"\"Gets the index value for a reference in a list or array,\"\"\" return self . app . getIndex () def putName ( self , key , value ): return self . app . putName ( key , value ) def putClass ( self , value ): return self . app . putClass ( value ) def putEnumerated ( self , desired_class , enum_type , value ): \"\"\"Puts an enumeration type and ID into a reference along with the desired class for the reference.\"\"\" return self . app . putEnumerated ( desired_class , enum_type , value ) def putIdentifier ( self , desired_class , value ): return self . app . putIdentifier ( desired_class , value ) def putIndex ( self , desired_class , value ): return self . app . putIndex ( desired_class , value ) def putOffset ( self , desired_class , value ): return self . app . putOffset ( desired_class , value ) def putProperty ( self , desired_class , value ): return self . app . putProperty ( desired_class , value )","title":"ActionReference"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference.getForm","text":"Gets the form of this action reference. Source code in photoshop/api/action_reference.py 57 58 59 def getForm ( self ) -> ReferenceFormType : \"\"\"Gets the form of this action reference.\"\"\" return ReferenceFormType ( self . app . getForm ())","title":"getForm()"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference.getIdentifier","text":"Gets the identifier value for a reference whose form is identifier. Source code in photoshop/api/action_reference.py 61 62 63 64 def getIdentifier ( self ) -> int : \"\"\"Gets the identifier value for a reference whose form is identifier.\"\"\" return self . app . getIdentifier ()","title":"getIdentifier()"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference.getIndex","text":"Gets the index value for a reference in a list or array, Source code in photoshop/api/action_reference.py 66 67 68 def getIndex ( self ) -> int : \"\"\"Gets the index value for a reference in a list or array,\"\"\" return self . app . getIndex ()","title":"getIndex()"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference.putEnumerated","text":"Puts an enumeration type and ID into a reference along with the desired class for the reference. Source code in photoshop/api/action_reference.py 76 77 78 79 def putEnumerated ( self , desired_class , enum_type , value ): \"\"\"Puts an enumeration type and ID into a reference along with the desired class for the reference.\"\"\" return self . app . putEnumerated ( desired_class , enum_type , value )","title":"putEnumerated()"},{"location":"reference/photoshop/api/application/","text":"The Adobe Photoshop CC application object. Which is the root of the object model and provides access to all other objects. This object provides application-wide information, such as application defaults and available fonts. It provides many important methods, such as those for opening files and loading documents. app = Application() app.documents.add(800, 600, 72, \"docRef\") Application Bases: Photoshop The Adobe Photoshop application object, which contains all other Adobe Photoshop objects. This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. Source code in photoshop/api/application.py 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 class Application ( Photoshop ): \"\"\"The Adobe Photoshop application object, which contains all other Adobe Photoshop objects. This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. \"\"\" def __init__ ( self , version : Optional [ str ] = None ): super () . __init__ ( ps_version = version ) self . _flag_as_method ( \"batch\" , \"charIDToTypeID\" , \"doAction\" , \"doJavaScript\" , \"eraseCustomOptions\" , \"executeAction\" , \"executeActionGet\" , \"featureEnabled\" , \"getCustomOptions\" , \"isQuicktimeAvailable\" , \"load\" , \"open\" , \"openDialog\" , \"purge\" , \"putCustomOptions\" , \"refresh\" , \"stringIDToTypeID\" , \"toolSupportsBrushes\" , \"toolSupportsPresets\" , \"typeIDToCharID\" , \"typeIDToStringID\" , ) @property def activeLayer ( self ) -> ArtLayer : return ArtLayer ( self . app . ArtLayer ) @property def layerSets ( self ) -> LayerSets : return LayerSets ( self . app . LayerSets ) @property def activeDocument ( self ): \"\"\"The front-most documents. Setting this property is equivalent to clicking an open document in the Adobe Photoshop CC application to bring it to the front of the screen. \"\"\" return Document ( self . app . activeDocument ) @activeDocument . setter def activeDocument ( self , document : Document ): self . app . activeDocument = document @property def backgroundColor ( self ) -> SolidColor : \"\"\"The default background color and color style for documents.\"\"\" return SolidColor ( self . app . backgroundColor ) @backgroundColor . setter def backgroundColor ( self , color : SolidColor ): \"\"\"Sets the default background color and color style for documents. Args: color: The SolidColor instance. \"\"\" self . app . backgroundColor = color @property def build ( self ) -> str : \"\"\"str: The information about the application.\"\"\" return self . app . build @property def colorSettings ( self ) -> str : \"\"\"str: The name of the currently selected color settings profile (selected with Edit > Color Settings). \"\"\" return self . app . colorSettings @colorSettings . setter def colorSettings ( self , settings : str ): \"\"\"Sets the currently selected color settings profile. Args: settings: The name of a color settings profile to select. \"\"\" try : self . doJavaScript ( f 'app.colorSettings=\" { settings } \"' ) except COMError as e : raise PhotoshopPythonAPIError ( f \"Invalid color profile provided: ' { settings } '\" ) from e @property def currentTool ( self ) -> str : \"\"\"str: The name of the current tool selected.\"\"\" return self . app . currentTool @currentTool . setter def currentTool ( self , tool_name : str ): \"\"\"Sets the currently selected tool. Args: tool_name: The name of a tool to select.. \"\"\" self . app . currentTool = tool_name @property def displayDialogs ( self ) -> DialogModes : \"\"\"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs.\"\"\" return DialogModes ( self . app . displayDialogs ) @displayDialogs . setter def displayDialogs ( self , dialog_mode : DialogModes ): \"\"\"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs. \"\"\" self . app . displayDialogs = dialog_mode @property def documents ( self ) -> Documents : \"\"\"._documents.Documents: The Documents instance.\"\"\" return Documents ( self . app . documents ) @property def fonts ( self ) -> TextFonts : return TextFonts ( self . app . fonts ) @property def foregroundColor ( self ) -> SolidColor : \"\"\"Get default foreground color. Used to paint, fill, and stroke selections. Returns: The SolidColor instance. \"\"\" return SolidColor ( parent = self . app . foregroundColor ) @foregroundColor . setter def foregroundColor ( self , color : SolidColor ): \"\"\"Set the `foregroundColor`. Args: color: The SolidColor instance. \"\"\" self . app . foregroundColor = color @property def freeMemory ( self ) -> float : \"\"\"The amount of unused memory available to .\"\"\" return self . app . freeMemory @property def locale ( self ) -> str : \"\"\"The language locale of the application.\"\"\" return self . app . locale @property def macintoshFileTypes ( self ) -> List [ str ]: \"\"\"A list of the image file types Photoshop can open.\"\"\" return self . app . macintoshFileTypes @property def measurementLog ( self ) -> MeasurementLog : \"\"\"The log of measurements taken.\"\"\" return MeasurementLog ( self . app . measurementLog ) @property def name ( self ) -> str : return self . app . name @property def notifiers ( self ) -> Notifiers : \"\"\"The notifiers currently configured (in the Scripts Events Manager menu in the application).\"\"\" return Notifiers ( self . app . notifiers ) @property def notifiersEnabled ( self ) -> bool : \"\"\"bool: If true, notifiers are enabled.\"\"\" return self . app . notifiersEnabled @notifiersEnabled . setter def notifiersEnabled ( self , value : bool ): self . app . notifiersEnabled = value @property def parent ( self ): \"\"\"The object\u2019s container.\"\"\" return self . app . parent @property def path ( self ) -> Path : \"\"\"str: The full path to the location of the Photoshop application.\"\"\" return Path ( self . app . path ) @property def playbackDisplayDialogs ( self ): return self . doJavaScript ( \"app.playbackDisplayDialogs\" ) @property def playbackParameters ( self ): \"\"\"Stores and retrieves parameters used as part of a recorded action.\"\"\" return self . app . playbackParameters @playbackParameters . setter def playbackParameters ( self , value ): self . app . playbackParameters = value @property def preferences ( self ) -> Preferences : return Preferences ( self . app . preferences ) @property def preferencesFolder ( self ) -> Path : return Path ( self . app . preferencesFolder ) @property def recentFiles ( self ): return self . app . recentFiles @property def scriptingBuildDate ( self ): return self . app . scriptingBuildDate @property def scriptingVersion ( self ): return self . app . scriptingVersion @property def systemInformation ( self ): return self . app . systemInformation @property def version ( self ): return self . app . version @property def windowsFileTypes ( self ): return self . app . windowsFileTypes # Methods. def batch ( self , files , actionName , actionSet , options ): \"\"\"Runs the batch automation routine. Similar to the **File** > **Automate** > **Batch** command. \"\"\" self . app . batch ( files , actionName , actionSet , options ) def beep ( self ): \"\"\"Causes a \"beep\" sound.\"\"\" return self . eval_javascript ( \"app.beep()\" ) def bringToFront ( self ): return self . eval_javascript ( \"app.bringToFront()\" ) def changeProgressText ( self , text ): \"\"\"Changes the text that appears in the progress window.\"\"\" self . eval_javascript ( f \"app.changeProgressText(' { text } ')\" ) def charIDToTypeID ( self , char_id ): return self . app . charIDToTypeID ( char_id ) @staticmethod def compareWithNumbers ( first , second ): return first > second def doAction ( self , action , action_from = \"Default Actions\" ): \"\"\"Plays the specified action from the Actions palette.\"\"\" self . app . doAction ( action , action_from ) return True def doForcedProgress ( self , title , javascript ): script = \"app.doForcedProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgress ( self , title , javascript ): \"\"\"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Args: title (str): String to show in the progress window. javascript (str): JavaScriptString to execute. \"\"\" script = \"app.doProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressSegmentTask ( self , segmentLength , done , total , javascript ): script = \"app.doProgressSegmentTask( {} , {} , {} , ' {} ');\" . format ( segmentLength , done , total , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressSubTask ( self , index , limit , javascript ): script = \"app.doProgressSubTask( {} , {} , ' {} ');\" . format ( index , limit , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressTask ( self , index , javascript ): \"\"\"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. \"\"\" script = f \"app.doProgressTask( { index } , ' { javascript } ');\" self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def eraseCustomOptions ( self , key ): \"\"\"Removes the specified user objects from the Photoshop registry.\"\"\" self . app . eraseCustomOptions ( key ) def executeAction ( self , event_id , descriptor , display_dialogs = 2 ): return self . app . executeAction ( event_id , descriptor , display_dialogs ) def executeActionGet ( self , reference ): return self . app . executeActionGet ( reference ) def featureEnabled ( self , name ): \"\"\"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial \"\"\" return self . app . featureEnabled ( name ) def getCustomOptions ( self , key ): \"\"\"Retrieves user objects in the Photoshop registry for the ID with value key.\"\"\" return self . app . getCustomOptions ( key ) def open ( self , document_file_path , document_type : str = None , as_smart_object : bool = False , ) -> Document : document = self . app . open ( document_file_path , document_type , as_smart_object ) if not as_smart_object : return Document ( document ) return document def load ( self , document_file_path : Union [ str , os . PathLike ]) -> Document : \"\"\"Loads a supported Photoshop document.\"\"\" self . app . load ( str ( document_file_path )) return self . activeDocument def doJavaScript ( self , javascript , Arguments = None , ExecutionMode = None ): return self . app . doJavaScript ( javascript , Arguments , ExecutionMode ) def isQuicktimeAvailable ( self ) -> bool : return self . app . isQuicktimeAvailable def openDialog ( self ): return self . app . openDialog () def purge ( self , target : PurgeTarget ): \"\"\"Purges one or more caches. Args: target: 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches \"\"\" self . app . purge ( target ) def putCustomOptions ( self , key , custom_object , persistent ): self . app . putCustomOptions ( key , custom_object , persistent ) def refresh ( self ): \"\"\"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. \"\"\" self . app . refresh () def refreshFonts ( self ): \"\"\"Force the font list to get refreshed.\"\"\" return self . eval_javascript ( \"app.refreshFonts();\" ) def runMenuItem ( self , menu_id ): \"\"\"Run a menu item given the menu ID.\"\"\" return self . eval_javascript ( f \"app.runMenuItem( { menu_id } )\" , ) def showColorPicker ( self ): \"\"\"Returns false if dialog is cancelled, true otherwise.\"\"\" return self . eval_javascript ( \"app.showColorPicker();\" ) def stringIDToTypeID ( self , string_id ): return self . app . stringIDToTypeID ( string_id ) def togglePalettes ( self ): \"\"\"Toggle palette visibility.\"\"\" return self . doJavaScript ( \"app.togglePalettes()\" ) def toolSupportsBrushes ( self , tool ): return self . app . toolSupportsBrushes ( tool ) def toolSupportsBrushPresets ( self , tool ): return self . app . toolSupportsPresets ( tool ) @staticmethod def system ( command ): os . system ( command ) def typeIDToStringID ( self , type_id : int ) -> str : return self . app . typeIDToStringID ( type_id ) def typeIDToCharID ( self , type_id : int ) -> str : return self . app . typeIDToCharID ( type_id ) def updateProgress ( self , done , total ): self . eval_javascript ( f \"app.updateProgress( { done } , { total } )\" ) activeDocument property writable The front-most documents. Setting this property is equivalent to clicking an open document in the Adobe Photoshop CC application to bring it to the front of the screen. backgroundColor : SolidColor property writable The default background color and color style for documents. build : str property colorSettings : str property writable (selected with Edit > Color Settings). currentTool : str property writable displayDialogs : DialogModes property writable The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs. documents : Documents property ._documents.Documents: The Documents instance. foregroundColor : SolidColor property writable Get default foreground color. Used to paint, fill, and stroke selections. Returns: Type Description SolidColor The SolidColor instance. freeMemory : float property The amount of unused memory available to . locale : str property The language locale of the application. macintoshFileTypes : List [ str ] property A list of the image file types Photoshop can open. measurementLog : MeasurementLog property The log of measurements taken. notifiers : Notifiers property The notifiers currently configured (in the Scripts Events Manager menu in the application). notifiersEnabled : bool property writable parent property The object\u2019s container. path : Path property playbackParameters property writable Stores and retrieves parameters used as part of a recorded action. batch ( files , actionName , actionSet , options ) Runs the batch automation routine. Similar to the File > Automate > Batch command. Source code in photoshop/api/application.py 292 293 294 295 296 297 298 def batch ( self , files , actionName , actionSet , options ): \"\"\"Runs the batch automation routine. Similar to the **File** > **Automate** > **Batch** command. \"\"\" self . app . batch ( files , actionName , actionSet , options ) beep () Causes a \"beep\" sound. Source code in photoshop/api/application.py 300 301 302 def beep ( self ): \"\"\"Causes a \"beep\" sound.\"\"\" return self . eval_javascript ( \"app.beep()\" ) changeProgressText ( text ) Changes the text that appears in the progress window. Source code in photoshop/api/application.py 307 308 309 def changeProgressText ( self , text ): \"\"\"Changes the text that appears in the progress window.\"\"\" self . eval_javascript ( f \"app.changeProgressText(' { text } ')\" ) doAction ( action , action_from = 'Default Actions' ) Plays the specified action from the Actions palette. Source code in photoshop/api/application.py 318 319 320 321 def doAction ( self , action , action_from = \"Default Actions\" ): \"\"\"Plays the specified action from the Actions palette.\"\"\" self . app . doAction ( action , action_from ) return True doProgress ( title , javascript ) Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Parameters: Name Type Description Default title str String to show in the progress window. required javascript str JavaScriptString to execute. required Source code in photoshop/api/application.py 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 def doProgress ( self , title , javascript ): \"\"\"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Args: title (str): String to show in the progress window. javascript (str): JavaScriptString to execute. \"\"\" script = \"app.doProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) doProgressTask ( index , javascript ) Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. Source code in photoshop/api/application.py 370 371 372 373 374 375 376 377 378 def doProgressTask ( self , index , javascript ): \"\"\"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. \"\"\" script = f \"app.doProgressTask( { index } , ' { javascript } ');\" self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) eraseCustomOptions ( key ) Removes the specified user objects from the Photoshop registry. Source code in photoshop/api/application.py 380 381 382 def eraseCustomOptions ( self , key ): \"\"\"Removes the specified user objects from the Photoshop registry.\"\"\" self . app . eraseCustomOptions ( key ) featureEnabled ( name ) Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial Source code in photoshop/api/application.py 390 391 392 393 394 395 396 397 398 399 400 401 402 def featureEnabled ( self , name ): \"\"\"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial \"\"\" return self . app . featureEnabled ( name ) getCustomOptions ( key ) Retrieves user objects in the Photoshop registry for the ID with value key. Source code in photoshop/api/application.py 404 405 406 407 def getCustomOptions ( self , key ): \"\"\"Retrieves user objects in the Photoshop registry for the ID with value key.\"\"\" return self . app . getCustomOptions ( key ) load ( document_file_path ) Loads a supported Photoshop document. Source code in photoshop/api/application.py 420 421 422 423 def load ( self , document_file_path : Union [ str , os . PathLike ]) -> Document : \"\"\"Loads a supported Photoshop document.\"\"\" self . app . load ( str ( document_file_path )) return self . activeDocument purge ( target ) Purges one or more caches. Parameters: Name Type Description Default target PurgeTarget 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches required Source code in photoshop/api/application.py 434 435 436 437 438 439 440 441 442 443 444 445 def purge ( self , target : PurgeTarget ): \"\"\"Purges one or more caches. Args: target: 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches \"\"\" self . app . purge ( target ) refresh () Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. Source code in photoshop/api/application.py 450 451 452 453 454 455 456 457 458 459 def refresh ( self ): \"\"\"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. \"\"\" self . app . refresh () refreshFonts () Force the font list to get refreshed. Source code in photoshop/api/application.py 461 462 463 def refreshFonts ( self ): \"\"\"Force the font list to get refreshed.\"\"\" return self . eval_javascript ( \"app.refreshFonts();\" ) runMenuItem ( menu_id ) Run a menu item given the menu ID. Source code in photoshop/api/application.py 465 466 467 468 469 def runMenuItem ( self , menu_id ): \"\"\"Run a menu item given the menu ID.\"\"\" return self . eval_javascript ( f \"app.runMenuItem( { menu_id } )\" , ) showColorPicker () Returns false if dialog is cancelled, true otherwise. Source code in photoshop/api/application.py 471 472 473 def showColorPicker ( self ): \"\"\"Returns false if dialog is cancelled, true otherwise.\"\"\" return self . eval_javascript ( \"app.showColorPicker();\" ) togglePalettes () Toggle palette visibility. Source code in photoshop/api/application.py 478 479 480 def togglePalettes ( self ): \"\"\"Toggle palette visibility.\"\"\" return self . doJavaScript ( \"app.togglePalettes()\" )","title":"application"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application","text":"Bases: Photoshop The Adobe Photoshop application object, which contains all other Adobe Photoshop objects. This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. Source code in photoshop/api/application.py 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 class Application ( Photoshop ): \"\"\"The Adobe Photoshop application object, which contains all other Adobe Photoshop objects. This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. \"\"\" def __init__ ( self , version : Optional [ str ] = None ): super () . __init__ ( ps_version = version ) self . _flag_as_method ( \"batch\" , \"charIDToTypeID\" , \"doAction\" , \"doJavaScript\" , \"eraseCustomOptions\" , \"executeAction\" , \"executeActionGet\" , \"featureEnabled\" , \"getCustomOptions\" , \"isQuicktimeAvailable\" , \"load\" , \"open\" , \"openDialog\" , \"purge\" , \"putCustomOptions\" , \"refresh\" , \"stringIDToTypeID\" , \"toolSupportsBrushes\" , \"toolSupportsPresets\" , \"typeIDToCharID\" , \"typeIDToStringID\" , ) @property def activeLayer ( self ) -> ArtLayer : return ArtLayer ( self . app . ArtLayer ) @property def layerSets ( self ) -> LayerSets : return LayerSets ( self . app . LayerSets ) @property def activeDocument ( self ): \"\"\"The front-most documents. Setting this property is equivalent to clicking an open document in the Adobe Photoshop CC application to bring it to the front of the screen. \"\"\" return Document ( self . app . activeDocument ) @activeDocument . setter def activeDocument ( self , document : Document ): self . app . activeDocument = document @property def backgroundColor ( self ) -> SolidColor : \"\"\"The default background color and color style for documents.\"\"\" return SolidColor ( self . app . backgroundColor ) @backgroundColor . setter def backgroundColor ( self , color : SolidColor ): \"\"\"Sets the default background color and color style for documents. Args: color: The SolidColor instance. \"\"\" self . app . backgroundColor = color @property def build ( self ) -> str : \"\"\"str: The information about the application.\"\"\" return self . app . build @property def colorSettings ( self ) -> str : \"\"\"str: The name of the currently selected color settings profile (selected with Edit > Color Settings). \"\"\" return self . app . colorSettings @colorSettings . setter def colorSettings ( self , settings : str ): \"\"\"Sets the currently selected color settings profile. Args: settings: The name of a color settings profile to select. \"\"\" try : self . doJavaScript ( f 'app.colorSettings=\" { settings } \"' ) except COMError as e : raise PhotoshopPythonAPIError ( f \"Invalid color profile provided: ' { settings } '\" ) from e @property def currentTool ( self ) -> str : \"\"\"str: The name of the current tool selected.\"\"\" return self . app . currentTool @currentTool . setter def currentTool ( self , tool_name : str ): \"\"\"Sets the currently selected tool. Args: tool_name: The name of a tool to select.. \"\"\" self . app . currentTool = tool_name @property def displayDialogs ( self ) -> DialogModes : \"\"\"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs.\"\"\" return DialogModes ( self . app . displayDialogs ) @displayDialogs . setter def displayDialogs ( self , dialog_mode : DialogModes ): \"\"\"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs. \"\"\" self . app . displayDialogs = dialog_mode @property def documents ( self ) -> Documents : \"\"\"._documents.Documents: The Documents instance.\"\"\" return Documents ( self . app . documents ) @property def fonts ( self ) -> TextFonts : return TextFonts ( self . app . fonts ) @property def foregroundColor ( self ) -> SolidColor : \"\"\"Get default foreground color. Used to paint, fill, and stroke selections. Returns: The SolidColor instance. \"\"\" return SolidColor ( parent = self . app . foregroundColor ) @foregroundColor . setter def foregroundColor ( self , color : SolidColor ): \"\"\"Set the `foregroundColor`. Args: color: The SolidColor instance. \"\"\" self . app . foregroundColor = color @property def freeMemory ( self ) -> float : \"\"\"The amount of unused memory available to .\"\"\" return self . app . freeMemory @property def locale ( self ) -> str : \"\"\"The language locale of the application.\"\"\" return self . app . locale @property def macintoshFileTypes ( self ) -> List [ str ]: \"\"\"A list of the image file types Photoshop can open.\"\"\" return self . app . macintoshFileTypes @property def measurementLog ( self ) -> MeasurementLog : \"\"\"The log of measurements taken.\"\"\" return MeasurementLog ( self . app . measurementLog ) @property def name ( self ) -> str : return self . app . name @property def notifiers ( self ) -> Notifiers : \"\"\"The notifiers currently configured (in the Scripts Events Manager menu in the application).\"\"\" return Notifiers ( self . app . notifiers ) @property def notifiersEnabled ( self ) -> bool : \"\"\"bool: If true, notifiers are enabled.\"\"\" return self . app . notifiersEnabled @notifiersEnabled . setter def notifiersEnabled ( self , value : bool ): self . app . notifiersEnabled = value @property def parent ( self ): \"\"\"The object\u2019s container.\"\"\" return self . app . parent @property def path ( self ) -> Path : \"\"\"str: The full path to the location of the Photoshop application.\"\"\" return Path ( self . app . path ) @property def playbackDisplayDialogs ( self ): return self . doJavaScript ( \"app.playbackDisplayDialogs\" ) @property def playbackParameters ( self ): \"\"\"Stores and retrieves parameters used as part of a recorded action.\"\"\" return self . app . playbackParameters @playbackParameters . setter def playbackParameters ( self , value ): self . app . playbackParameters = value @property def preferences ( self ) -> Preferences : return Preferences ( self . app . preferences ) @property def preferencesFolder ( self ) -> Path : return Path ( self . app . preferencesFolder ) @property def recentFiles ( self ): return self . app . recentFiles @property def scriptingBuildDate ( self ): return self . app . scriptingBuildDate @property def scriptingVersion ( self ): return self . app . scriptingVersion @property def systemInformation ( self ): return self . app . systemInformation @property def version ( self ): return self . app . version @property def windowsFileTypes ( self ): return self . app . windowsFileTypes # Methods. def batch ( self , files , actionName , actionSet , options ): \"\"\"Runs the batch automation routine. Similar to the **File** > **Automate** > **Batch** command. \"\"\" self . app . batch ( files , actionName , actionSet , options ) def beep ( self ): \"\"\"Causes a \"beep\" sound.\"\"\" return self . eval_javascript ( \"app.beep()\" ) def bringToFront ( self ): return self . eval_javascript ( \"app.bringToFront()\" ) def changeProgressText ( self , text ): \"\"\"Changes the text that appears in the progress window.\"\"\" self . eval_javascript ( f \"app.changeProgressText(' { text } ')\" ) def charIDToTypeID ( self , char_id ): return self . app . charIDToTypeID ( char_id ) @staticmethod def compareWithNumbers ( first , second ): return first > second def doAction ( self , action , action_from = \"Default Actions\" ): \"\"\"Plays the specified action from the Actions palette.\"\"\" self . app . doAction ( action , action_from ) return True def doForcedProgress ( self , title , javascript ): script = \"app.doForcedProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgress ( self , title , javascript ): \"\"\"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Args: title (str): String to show in the progress window. javascript (str): JavaScriptString to execute. \"\"\" script = \"app.doProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressSegmentTask ( self , segmentLength , done , total , javascript ): script = \"app.doProgressSegmentTask( {} , {} , {} , ' {} ');\" . format ( segmentLength , done , total , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressSubTask ( self , index , limit , javascript ): script = \"app.doProgressSubTask( {} , {} , ' {} ');\" . format ( index , limit , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressTask ( self , index , javascript ): \"\"\"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. \"\"\" script = f \"app.doProgressTask( { index } , ' { javascript } ');\" self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def eraseCustomOptions ( self , key ): \"\"\"Removes the specified user objects from the Photoshop registry.\"\"\" self . app . eraseCustomOptions ( key ) def executeAction ( self , event_id , descriptor , display_dialogs = 2 ): return self . app . executeAction ( event_id , descriptor , display_dialogs ) def executeActionGet ( self , reference ): return self . app . executeActionGet ( reference ) def featureEnabled ( self , name ): \"\"\"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial \"\"\" return self . app . featureEnabled ( name ) def getCustomOptions ( self , key ): \"\"\"Retrieves user objects in the Photoshop registry for the ID with value key.\"\"\" return self . app . getCustomOptions ( key ) def open ( self , document_file_path , document_type : str = None , as_smart_object : bool = False , ) -> Document : document = self . app . open ( document_file_path , document_type , as_smart_object ) if not as_smart_object : return Document ( document ) return document def load ( self , document_file_path : Union [ str , os . PathLike ]) -> Document : \"\"\"Loads a supported Photoshop document.\"\"\" self . app . load ( str ( document_file_path )) return self . activeDocument def doJavaScript ( self , javascript , Arguments = None , ExecutionMode = None ): return self . app . doJavaScript ( javascript , Arguments , ExecutionMode ) def isQuicktimeAvailable ( self ) -> bool : return self . app . isQuicktimeAvailable def openDialog ( self ): return self . app . openDialog () def purge ( self , target : PurgeTarget ): \"\"\"Purges one or more caches. Args: target: 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches \"\"\" self . app . purge ( target ) def putCustomOptions ( self , key , custom_object , persistent ): self . app . putCustomOptions ( key , custom_object , persistent ) def refresh ( self ): \"\"\"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. \"\"\" self . app . refresh () def refreshFonts ( self ): \"\"\"Force the font list to get refreshed.\"\"\" return self . eval_javascript ( \"app.refreshFonts();\" ) def runMenuItem ( self , menu_id ): \"\"\"Run a menu item given the menu ID.\"\"\" return self . eval_javascript ( f \"app.runMenuItem( { menu_id } )\" , ) def showColorPicker ( self ): \"\"\"Returns false if dialog is cancelled, true otherwise.\"\"\" return self . eval_javascript ( \"app.showColorPicker();\" ) def stringIDToTypeID ( self , string_id ): return self . app . stringIDToTypeID ( string_id ) def togglePalettes ( self ): \"\"\"Toggle palette visibility.\"\"\" return self . doJavaScript ( \"app.togglePalettes()\" ) def toolSupportsBrushes ( self , tool ): return self . app . toolSupportsBrushes ( tool ) def toolSupportsBrushPresets ( self , tool ): return self . app . toolSupportsPresets ( tool ) @staticmethod def system ( command ): os . system ( command ) def typeIDToStringID ( self , type_id : int ) -> str : return self . app . typeIDToStringID ( type_id ) def typeIDToCharID ( self , type_id : int ) -> str : return self . app . typeIDToCharID ( type_id ) def updateProgress ( self , done , total ): self . eval_javascript ( f \"app.updateProgress( { done } , { total } )\" )","title":"Application"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.activeDocument","text":"The front-most documents. Setting this property is equivalent to clicking an open document in the Adobe Photoshop CC application to bring it to the front of the screen.","title":"activeDocument"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.backgroundColor","text":"The default background color and color style for documents.","title":"backgroundColor"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.build","text":"","title":"build"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.colorSettings","text":"(selected with Edit > Color Settings).","title":"colorSettings"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.currentTool","text":"","title":"currentTool"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.displayDialogs","text":"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs.","title":"displayDialogs"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.documents","text":"._documents.Documents: The Documents instance.","title":"documents"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.foregroundColor","text":"Get default foreground color. Used to paint, fill, and stroke selections. Returns: Type Description SolidColor The SolidColor instance.","title":"foregroundColor"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.freeMemory","text":"The amount of unused memory available to .","title":"freeMemory"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.locale","text":"The language locale of the application.","title":"locale"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.macintoshFileTypes","text":"A list of the image file types Photoshop can open.","title":"macintoshFileTypes"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.measurementLog","text":"The log of measurements taken.","title":"measurementLog"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.notifiers","text":"The notifiers currently configured (in the Scripts Events Manager menu in the application).","title":"notifiers"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.notifiersEnabled","text":"","title":"notifiersEnabled"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.parent","text":"The object\u2019s container.","title":"parent"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.path","text":"","title":"path"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.playbackParameters","text":"Stores and retrieves parameters used as part of a recorded action.","title":"playbackParameters"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.batch","text":"Runs the batch automation routine. Similar to the File > Automate > Batch command. Source code in photoshop/api/application.py 292 293 294 295 296 297 298 def batch ( self , files , actionName , actionSet , options ): \"\"\"Runs the batch automation routine. Similar to the **File** > **Automate** > **Batch** command. \"\"\" self . app . batch ( files , actionName , actionSet , options )","title":"batch()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.beep","text":"Causes a \"beep\" sound. Source code in photoshop/api/application.py 300 301 302 def beep ( self ): \"\"\"Causes a \"beep\" sound.\"\"\" return self . eval_javascript ( \"app.beep()\" )","title":"beep()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.changeProgressText","text":"Changes the text that appears in the progress window. Source code in photoshop/api/application.py 307 308 309 def changeProgressText ( self , text ): \"\"\"Changes the text that appears in the progress window.\"\"\" self . eval_javascript ( f \"app.changeProgressText(' { text } ')\" )","title":"changeProgressText()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.doAction","text":"Plays the specified action from the Actions palette. Source code in photoshop/api/application.py 318 319 320 321 def doAction ( self , action , action_from = \"Default Actions\" ): \"\"\"Plays the specified action from the Actions palette.\"\"\" self . app . doAction ( action , action_from ) return True","title":"doAction()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.doProgress","text":"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Parameters: Name Type Description Default title str String to show in the progress window. required javascript str JavaScriptString to execute. required Source code in photoshop/api/application.py 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 def doProgress ( self , title , javascript ): \"\"\"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Args: title (str): String to show in the progress window. javascript (str): JavaScriptString to execute. \"\"\" script = \"app.doProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 )","title":"doProgress()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.doProgressTask","text":"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. Source code in photoshop/api/application.py 370 371 372 373 374 375 376 377 378 def doProgressTask ( self , index , javascript ): \"\"\"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. \"\"\" script = f \"app.doProgressTask( { index } , ' { javascript } ');\" self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 )","title":"doProgressTask()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.eraseCustomOptions","text":"Removes the specified user objects from the Photoshop registry. Source code in photoshop/api/application.py 380 381 382 def eraseCustomOptions ( self , key ): \"\"\"Removes the specified user objects from the Photoshop registry.\"\"\" self . app . eraseCustomOptions ( key )","title":"eraseCustomOptions()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.featureEnabled","text":"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial Source code in photoshop/api/application.py 390 391 392 393 394 395 396 397 398 399 400 401 402 def featureEnabled ( self , name ): \"\"\"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial \"\"\" return self . app . featureEnabled ( name )","title":"featureEnabled()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.getCustomOptions","text":"Retrieves user objects in the Photoshop registry for the ID with value key. Source code in photoshop/api/application.py 404 405 406 407 def getCustomOptions ( self , key ): \"\"\"Retrieves user objects in the Photoshop registry for the ID with value key.\"\"\" return self . app . getCustomOptions ( key )","title":"getCustomOptions()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.load","text":"Loads a supported Photoshop document. Source code in photoshop/api/application.py 420 421 422 423 def load ( self , document_file_path : Union [ str , os . PathLike ]) -> Document : \"\"\"Loads a supported Photoshop document.\"\"\" self . app . load ( str ( document_file_path )) return self . activeDocument","title":"load()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.purge","text":"Purges one or more caches. Parameters: Name Type Description Default target PurgeTarget 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches required Source code in photoshop/api/application.py 434 435 436 437 438 439 440 441 442 443 444 445 def purge ( self , target : PurgeTarget ): \"\"\"Purges one or more caches. Args: target: 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches \"\"\" self . app . purge ( target )","title":"purge()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.refresh","text":"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. Source code in photoshop/api/application.py 450 451 452 453 454 455 456 457 458 459 def refresh ( self ): \"\"\"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. \"\"\" self . app . refresh ()","title":"refresh()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.refreshFonts","text":"Force the font list to get refreshed. Source code in photoshop/api/application.py 461 462 463 def refreshFonts ( self ): \"\"\"Force the font list to get refreshed.\"\"\" return self . eval_javascript ( \"app.refreshFonts();\" )","title":"refreshFonts()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.runMenuItem","text":"Run a menu item given the menu ID. Source code in photoshop/api/application.py 465 466 467 468 469 def runMenuItem ( self , menu_id ): \"\"\"Run a menu item given the menu ID.\"\"\" return self . eval_javascript ( f \"app.runMenuItem( { menu_id } )\" , )","title":"runMenuItem()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.showColorPicker","text":"Returns false if dialog is cancelled, true otherwise. Source code in photoshop/api/application.py 471 472 473 def showColorPicker ( self ): \"\"\"Returns false if dialog is cancelled, true otherwise.\"\"\" return self . eval_javascript ( \"app.showColorPicker();\" )","title":"showColorPicker()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.togglePalettes","text":"Toggle palette visibility. Source code in photoshop/api/application.py 478 479 480 def togglePalettes ( self ): \"\"\"Toggle palette visibility.\"\"\" return self . doJavaScript ( \"app.togglePalettes()\" )","title":"togglePalettes()"},{"location":"reference/photoshop/api/batch_options/","text":"BatchOptions Bases: Photoshop Source code in photoshop/api/batch_options.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 class BatchOptions ( Photoshop ): object_name = \"BatchOptions\" def __init__ ( self ): super () . __init__ () @property def destination ( self ): \"\"\"The type of destination for the processed files.\"\"\" return self . app . destination @destination . setter def destination ( self , value ): self . app . destination = value @property def destinationFolder ( self ): \"\"\"The folder location for the processed files. Valid only when \u2018destination\u2019 = folder.\"\"\" return self . app . destinationFolder @destinationFolder . setter def destinationFolder ( self , path ): self . app . destinationFolder = path @property def errorFile ( self ): \"\"\"The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank.\"\"\" return self . app . errorFile @errorFile . setter def errorFile ( self , file_path ): self . app . errorFile = file_path @property def fileNaming ( self ) -> list : \"\"\"A list of file naming options. Maximum: 6.\"\"\" return self . app . fileNaming @fileNaming . setter def fileNaming ( self , file_naming : list ): self . app . fileNaming = file_naming @property def macintoshCompatible ( self ) -> bool : \"\"\"If true, the final file names are Macintosh compatible.\"\"\" return self . app . macintoshCompatible @macintoshCompatible . setter def macintoshCompatible ( self , value : bool ): self . app . macintoshCompatible = value @property def overrideOpen ( self ) -> bool : \"\"\"If true, overrides action open commands.\"\"\" return self . app . overrideOpen @overrideOpen . setter def overrideOpen ( self , value : bool ): self . app . overrideOpen = value @property def overrideSave ( self ) -> bool : \"\"\"If true, overrides save as action steps with the specified destination.\"\"\" return self . app . overrideSave @overrideSave . setter def overrideSave ( self , value : bool ): self . app . overrideSave = value @property def startingSerial ( self ) -> int : \"\"\"The starting serial number to use in naming files.\"\"\" return self . app . startingSerial @startingSerial . setter def startingSerial ( self , value : int ): self . app . startingSerial = value @property def suppressOpen ( self ) -> bool : \"\"\"If true, suppresses file open options dialogs.\"\"\" return self . app . suppressOpen @suppressOpen . setter def suppressOpen ( self , value : bool ): self . app . suppressOpen = value @property def suppressProfile ( self ) -> bool : \"\"\"If true, suppresses color profile warnings.\"\"\" return self . app . suppressProfile @suppressProfile . setter def suppressProfile ( self , value : bool ): self . app . suppressProfile = value @property def unixCompatible ( self ) -> bool : \"\"\"If true, the final file names are Unix compatible.\"\"\" return self . app . unixCompatible @unixCompatible . setter def unixCompatible ( self , value : bool ): self . app . unixCompatible = value @property def windowsCompatible ( self ) -> bool : \"\"\"If true, the final file names are Windows compatible.\"\"\" return self . app . windowsCompatible @windowsCompatible . setter def windowsCompatible ( self , value : bool ): self . app . windowsCompatible = value destination property writable The type of destination for the processed files. destinationFolder property writable The folder location for the processed files. Valid only when \u2018destination\u2019 = folder. errorFile property writable The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank. fileNaming : list property writable A list of file naming options. Maximum: 6. macintoshCompatible : bool property writable If true, the final file names are Macintosh compatible. overrideOpen : bool property writable If true, overrides action open commands. overrideSave : bool property writable If true, overrides save as action steps with the specified destination. startingSerial : int property writable The starting serial number to use in naming files. suppressOpen : bool property writable If true, suppresses file open options dialogs. suppressProfile : bool property writable If true, suppresses color profile warnings. unixCompatible : bool property writable If true, the final file names are Unix compatible. windowsCompatible : bool property writable If true, the final file names are Windows compatible.","title":"batch_options"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions","text":"Bases: Photoshop Source code in photoshop/api/batch_options.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 class BatchOptions ( Photoshop ): object_name = \"BatchOptions\" def __init__ ( self ): super () . __init__ () @property def destination ( self ): \"\"\"The type of destination for the processed files.\"\"\" return self . app . destination @destination . setter def destination ( self , value ): self . app . destination = value @property def destinationFolder ( self ): \"\"\"The folder location for the processed files. Valid only when \u2018destination\u2019 = folder.\"\"\" return self . app . destinationFolder @destinationFolder . setter def destinationFolder ( self , path ): self . app . destinationFolder = path @property def errorFile ( self ): \"\"\"The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank.\"\"\" return self . app . errorFile @errorFile . setter def errorFile ( self , file_path ): self . app . errorFile = file_path @property def fileNaming ( self ) -> list : \"\"\"A list of file naming options. Maximum: 6.\"\"\" return self . app . fileNaming @fileNaming . setter def fileNaming ( self , file_naming : list ): self . app . fileNaming = file_naming @property def macintoshCompatible ( self ) -> bool : \"\"\"If true, the final file names are Macintosh compatible.\"\"\" return self . app . macintoshCompatible @macintoshCompatible . setter def macintoshCompatible ( self , value : bool ): self . app . macintoshCompatible = value @property def overrideOpen ( self ) -> bool : \"\"\"If true, overrides action open commands.\"\"\" return self . app . overrideOpen @overrideOpen . setter def overrideOpen ( self , value : bool ): self . app . overrideOpen = value @property def overrideSave ( self ) -> bool : \"\"\"If true, overrides save as action steps with the specified destination.\"\"\" return self . app . overrideSave @overrideSave . setter def overrideSave ( self , value : bool ): self . app . overrideSave = value @property def startingSerial ( self ) -> int : \"\"\"The starting serial number to use in naming files.\"\"\" return self . app . startingSerial @startingSerial . setter def startingSerial ( self , value : int ): self . app . startingSerial = value @property def suppressOpen ( self ) -> bool : \"\"\"If true, suppresses file open options dialogs.\"\"\" return self . app . suppressOpen @suppressOpen . setter def suppressOpen ( self , value : bool ): self . app . suppressOpen = value @property def suppressProfile ( self ) -> bool : \"\"\"If true, suppresses color profile warnings.\"\"\" return self . app . suppressProfile @suppressProfile . setter def suppressProfile ( self , value : bool ): self . app . suppressProfile = value @property def unixCompatible ( self ) -> bool : \"\"\"If true, the final file names are Unix compatible.\"\"\" return self . app . unixCompatible @unixCompatible . setter def unixCompatible ( self , value : bool ): self . app . unixCompatible = value @property def windowsCompatible ( self ) -> bool : \"\"\"If true, the final file names are Windows compatible.\"\"\" return self . app . windowsCompatible @windowsCompatible . setter def windowsCompatible ( self , value : bool ): self . app . windowsCompatible = value","title":"BatchOptions"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.destination","text":"The type of destination for the processed files.","title":"destination"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.destinationFolder","text":"The folder location for the processed files. Valid only when \u2018destination\u2019 = folder.","title":"destinationFolder"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.errorFile","text":"The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank.","title":"errorFile"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.fileNaming","text":"A list of file naming options. Maximum: 6.","title":"fileNaming"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.macintoshCompatible","text":"If true, the final file names are Macintosh compatible.","title":"macintoshCompatible"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.overrideOpen","text":"If true, overrides action open commands.","title":"overrideOpen"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.overrideSave","text":"If true, overrides save as action steps with the specified destination.","title":"overrideSave"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.startingSerial","text":"The starting serial number to use in naming files.","title":"startingSerial"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.suppressOpen","text":"If true, suppresses file open options dialogs.","title":"suppressOpen"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.suppressProfile","text":"If true, suppresses color profile warnings.","title":"suppressProfile"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.unixCompatible","text":"If true, the final file names are Unix compatible.","title":"unixCompatible"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.windowsCompatible","text":"If true, the final file names are Windows compatible.","title":"windowsCompatible"},{"location":"reference/photoshop/api/constants/","text":"","title":"constants"},{"location":"reference/photoshop/api/enumerations/","text":"constants type of enum for Photoshop.","title":"enumerations"},{"location":"reference/photoshop/api/errors/","text":"","title":"errors"},{"location":"reference/photoshop/api/event_id/","text":"EventID Bases: str , Enum All event ids. Source code in photoshop/api/event_id.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 class EventID ( str , Enum ): \"\"\"All event ids.\"\"\" # Here is a list of JSON CallBack events in Photoshop. # https://community.adobe.com/t5/get-started/photoshop-json-callback-events-list-up-to-cc2015-ver-16/td-p/4792115?page=1 TDTransform = \"TdT \" Average = \"Avrg\" ApplyStyle = \"ASty\" Assert = \"Asrt\" AccentedEdges = \"AccE\" Add = \"Add\" AddNoise = \"AdNs\" AddTo = \"AddT\" Align = \"Algn\" All = \"All \" AngledStrokes = \"AngS\" ApplyImage = \"AppI\" BasRelief = \"BsRl\" Batch = \"Btch\" BatchFromDroplet = \"BtcF\" Blur = \"Blr \" BlurMore = \"BlrM\" Border = \"Brdr\" Brightness = \"BrgC\" CanvasSize = \"CnvS\" ChalkCharcoal = \"ChlC\" ChannelMixer = \"ChnM\" Charcoal = \"Chrc\" Chrome = \"Chrm\" Clear = \"Cler\" Close = \"Cls \" Clouds = \"Clds\" ColorBalance = \"ClrB\" ColorHalftone = \"ClrH\" ColorRange = \"ClrR\" ColoredPencil = \"ClrP\" ContactSheet = \"0B71D221-F8CE-11d2-B21B-0008C75B322C\" ConteCrayon = \"CntC\" Contract = \"Cntc\" ConvertMode = \"CnvM\" Copy = \"copy\" CopyEffects = \"CpFX\" CopyMerged = \"CpyM\" CopyToLayer = \"CpTL\" Craquelure = \"Crql\" CreateDroplet = \"CrtD\" Crop = \"Crop\" Crosshatch = \"Crsh\" Crystallize = \"Crst\" Curves = \"Crvs\" Custom = \"Cstm\" Cut = \"cut \" CutToLayer = \"CtTL\" Cutout = \"Ct \" DarkStrokes = \"DrkS\" DeInterlace = \"Dntr\" DefinePattern = \"DfnP\" Defringe = \"Dfrg\" Delete = \"Dlt \" Desaturate = \"Dstt\" Deselect = \"Dslc\" Despeckle = \"Dspc\" DifferenceClouds = \"DrfC\" Diffuse = \"Dfs \" DiffuseGlow = \"DfsG\" DisableLayerFX = \"dlfx\" Displace = \"Dspl\" Distribute = \"Dstr\" Draw = \"Draw\" DryBrush = \"DryB\" Duplicate = \"Dplc\" DustAndScratches = \"DstS\" Emboss = \"Embs\" Equalize = \"Eqlz\" Exchange = \"Exch\" Expand = \"Expn\" Export = \"Expr\" Jumpto = \"Jpto\" ExportTransparentImage = \"02879e00-cb66-11d1-bc43-0060b0a13dc4\" Extrude = \"Extr\" Facet = \"Fct \" Fade = \"Fade\" Feather = \"Fthr\" Fibers = \"Fbrs\" Fill = \"Fl \" FilmGrain = \"FlmG\" Filter = \"Fltr\" FindEdges = \"FndE\" FitImage = \"3caa3434-cb67-11d1-bc43-0060b0a13dc4\" FlattenImage = \"FltI\" Flip = \"Flip\" Fragment = \"Frgm\" Fresco = \"Frsc\" GaussianBlur = \"GsnB\" Get = \"getd\" Glass = \"Gls \" GlowingEdges = \"GlwE\" Gradient = \"Grdn\" GradientMap = \"GrMp\" Grain = \"Grn \" GraphicPen = \"GraP\" Group = \"GrpL\" Grow = \"Grow\" HalftoneScreen = \"HlfS\" Hide = \"Hd \" HighPass = \"HghP\" HSBHSL = \"HsbP\" HueSaturation = \"HStr\" ImageSize = \"ImgS\" Import = \"Impr\" InkOutlines = \"InkO\" Intersect = \"Intr\" IntersectWith = \"IntW\" Inverse = \"Invs\" Invert = \"Invr\" LensFlare = \"LnsF\" Levels = \"Lvls\" LightingEffects = \"LghE\" Link = \"Lnk \" Make = \"Mk \" Maximum = \"Mxm \" Median = \"Mdn \" MergeLayers = \"Mrg2\" MergeLayersOld = \"MrgL\" MergeSpotChannel = \"MSpt\" MergeVisible = \"MrgV\" Mezzotint = \"Mztn\" Minimum = \"Mnm \" ModeChange = \"8cba8cd6-cb66-11d1-bc43-0060b0a13dc4\" Mosaic = \"Msc \" Mosaic_PLUGIN = \"MscT\" MotionBlur = \"MtnB\" Move = \"move\" NTSCColors = \"NTSC\" NeonGlow = \"NGlw\" Next = \"Nxt \" NotePaper = \"NtPr\" Notify = \"Ntfy\" Null = \"typeNull\" OceanRipple = \"OcnR\" Offset = \"Ofst\" Open = \"Opn \" Paint = \"Pnt \" PaintDaubs = \"PntD\" PaletteKnife = \"PltK\" Paste = \"past\" PasteEffects = \"PaFX\" PasteInto = \"PstI\" PasteOutside = \"PstO\" Patchwork = \"Ptch\" Photocopy = \"Phtc\" PicturePackage = \"4C1ABF40-DD82-11d2-B20F-0008C75B322C\" Pinch = \"Pnch\" Place = \"Plc \" Plaster = \"Plst\" PlasticWrap = \"PlsW\" Play = \"Ply \" Pointillize = \"Pntl\" Polar = \"Plr \" PosterEdges = \"PstE\" Posterize = \"Pstr\" Previous = \"Prvs\" Print = \"Prnt\" ProfileToProfile = \"PrfT\" Purge = \"Prge\" Quit = \"quit\" RadialBlur = \"RdlB\" Rasterize = \"Rstr\" RasterizeTypeSheet = \"RstT\" RemoveBlackMatte = \"RmvB\" RemoveLayerMask = \"RmvL\" RemoveWhiteMatte = \"RmvW\" Rename = \"Rnm \" ReplaceColor = \"RplC\" Reset = \"Rset\" ResizeImage = \"1333cf0c-cb67-11d1-bc43-0060b0a13dc4\" Reticulation = \"Rtcl\" Revert = \"Rvrt\" Ripple = \"Rple\" Rotate = \"Rtte\" RoughPastels = \"RghP\" Save = \"save\" Select = \"slct\" SelectiveColor = \"SlcC\" Set = \"setd\" SharpenEdges = \"ShrE\" Sharpen = \"Shrp\" SharpenMore = \"ShrM\" Shear = \"Shr \" Show = \"Shw \" Similar = \"Smlr\" SmartBlur = \"SmrB\" Smooth = \"Smth\" SmudgeStick = \"SmdS\" Solarize = \"Slrz\" Spatter = \"Spt \" Spherize = \"Sphr\" SplitChannels = \"SplC\" Sponge = \"Spng\" SprayedStrokes = \"SprS\" StainedGlass = \"StnG\" Stamp = \"Stmp\" Stop = \"Stop\" Stroke = \"Strk\" Subtract = \"Sbtr\" SubtractFrom = \"SbtF\" Sumie = \"Smie\" TakeMergedSnapshot = \"TkMr\" TakeSnapshot = \"TkSn\" TextureFill = \"TxtF\" Texturizer = \"Txtz\" Threshold = \"Thrs\" Tiles = \"Tls \" TornEdges = \"TrnE\" TraceContour = \"TrcC\" Transform = \"Trnf\" Trap = \"Trap\" Twirl = \"Twrl\" Underpainting = \"Undr\" Undo = \"undo\" Ungroup = \"Ungr\" Unlink = \"Unlk\" UnsharpMask = \"UnsM\" Variations = \"Vrtn\" Wait = \"Wait\" WaterPaper = \"WtrP\" Watercolor = \"Wtrc\" Wave = \"Wave\" Wind = \"Wnd \" ZigZag = \"ZgZg\" BackLight = \"BacL\" FillFlash = \"FilE\" ColorCast = \"ColE\" OpenUntitled = \"OpnU\" PresetKind = \"presetKindType\" SmartSharpen = \"smartSharpen\" PresetKindType = \"presetKindType\" PresetKindCustom = \"presetKindCustom\" NoiseReduction = \"noiseReduction\" BlurType = \"blurType\" ContentLayer = \"contentLayer\" SaveStage = \"saveStage\" SaveStageType = \"saveStageType\" SaveSucceeded = \"saveSucceeded\" RasterizeLayer = \"rasterizeLayer\" ForceNotify = \"forceNotify\" PlacedLayerEditContents = \"placedLayerEditContents\"","title":"event_id"},{"location":"reference/photoshop/api/event_id/#photoshop.api.event_id.EventID","text":"Bases: str , Enum All event ids. Source code in photoshop/api/event_id.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 class EventID ( str , Enum ): \"\"\"All event ids.\"\"\" # Here is a list of JSON CallBack events in Photoshop. # https://community.adobe.com/t5/get-started/photoshop-json-callback-events-list-up-to-cc2015-ver-16/td-p/4792115?page=1 TDTransform = \"TdT \" Average = \"Avrg\" ApplyStyle = \"ASty\" Assert = \"Asrt\" AccentedEdges = \"AccE\" Add = \"Add\" AddNoise = \"AdNs\" AddTo = \"AddT\" Align = \"Algn\" All = \"All \" AngledStrokes = \"AngS\" ApplyImage = \"AppI\" BasRelief = \"BsRl\" Batch = \"Btch\" BatchFromDroplet = \"BtcF\" Blur = \"Blr \" BlurMore = \"BlrM\" Border = \"Brdr\" Brightness = \"BrgC\" CanvasSize = \"CnvS\" ChalkCharcoal = \"ChlC\" ChannelMixer = \"ChnM\" Charcoal = \"Chrc\" Chrome = \"Chrm\" Clear = \"Cler\" Close = \"Cls \" Clouds = \"Clds\" ColorBalance = \"ClrB\" ColorHalftone = \"ClrH\" ColorRange = \"ClrR\" ColoredPencil = \"ClrP\" ContactSheet = \"0B71D221-F8CE-11d2-B21B-0008C75B322C\" ConteCrayon = \"CntC\" Contract = \"Cntc\" ConvertMode = \"CnvM\" Copy = \"copy\" CopyEffects = \"CpFX\" CopyMerged = \"CpyM\" CopyToLayer = \"CpTL\" Craquelure = \"Crql\" CreateDroplet = \"CrtD\" Crop = \"Crop\" Crosshatch = \"Crsh\" Crystallize = \"Crst\" Curves = \"Crvs\" Custom = \"Cstm\" Cut = \"cut \" CutToLayer = \"CtTL\" Cutout = \"Ct \" DarkStrokes = \"DrkS\" DeInterlace = \"Dntr\" DefinePattern = \"DfnP\" Defringe = \"Dfrg\" Delete = \"Dlt \" Desaturate = \"Dstt\" Deselect = \"Dslc\" Despeckle = \"Dspc\" DifferenceClouds = \"DrfC\" Diffuse = \"Dfs \" DiffuseGlow = \"DfsG\" DisableLayerFX = \"dlfx\" Displace = \"Dspl\" Distribute = \"Dstr\" Draw = \"Draw\" DryBrush = \"DryB\" Duplicate = \"Dplc\" DustAndScratches = \"DstS\" Emboss = \"Embs\" Equalize = \"Eqlz\" Exchange = \"Exch\" Expand = \"Expn\" Export = \"Expr\" Jumpto = \"Jpto\" ExportTransparentImage = \"02879e00-cb66-11d1-bc43-0060b0a13dc4\" Extrude = \"Extr\" Facet = \"Fct \" Fade = \"Fade\" Feather = \"Fthr\" Fibers = \"Fbrs\" Fill = \"Fl \" FilmGrain = \"FlmG\" Filter = \"Fltr\" FindEdges = \"FndE\" FitImage = \"3caa3434-cb67-11d1-bc43-0060b0a13dc4\" FlattenImage = \"FltI\" Flip = \"Flip\" Fragment = \"Frgm\" Fresco = \"Frsc\" GaussianBlur = \"GsnB\" Get = \"getd\" Glass = \"Gls \" GlowingEdges = \"GlwE\" Gradient = \"Grdn\" GradientMap = \"GrMp\" Grain = \"Grn \" GraphicPen = \"GraP\" Group = \"GrpL\" Grow = \"Grow\" HalftoneScreen = \"HlfS\" Hide = \"Hd \" HighPass = \"HghP\" HSBHSL = \"HsbP\" HueSaturation = \"HStr\" ImageSize = \"ImgS\" Import = \"Impr\" InkOutlines = \"InkO\" Intersect = \"Intr\" IntersectWith = \"IntW\" Inverse = \"Invs\" Invert = \"Invr\" LensFlare = \"LnsF\" Levels = \"Lvls\" LightingEffects = \"LghE\" Link = \"Lnk \" Make = \"Mk \" Maximum = \"Mxm \" Median = \"Mdn \" MergeLayers = \"Mrg2\" MergeLayersOld = \"MrgL\" MergeSpotChannel = \"MSpt\" MergeVisible = \"MrgV\" Mezzotint = \"Mztn\" Minimum = \"Mnm \" ModeChange = \"8cba8cd6-cb66-11d1-bc43-0060b0a13dc4\" Mosaic = \"Msc \" Mosaic_PLUGIN = \"MscT\" MotionBlur = \"MtnB\" Move = \"move\" NTSCColors = \"NTSC\" NeonGlow = \"NGlw\" Next = \"Nxt \" NotePaper = \"NtPr\" Notify = \"Ntfy\" Null = \"typeNull\" OceanRipple = \"OcnR\" Offset = \"Ofst\" Open = \"Opn \" Paint = \"Pnt \" PaintDaubs = \"PntD\" PaletteKnife = \"PltK\" Paste = \"past\" PasteEffects = \"PaFX\" PasteInto = \"PstI\" PasteOutside = \"PstO\" Patchwork = \"Ptch\" Photocopy = \"Phtc\" PicturePackage = \"4C1ABF40-DD82-11d2-B20F-0008C75B322C\" Pinch = \"Pnch\" Place = \"Plc \" Plaster = \"Plst\" PlasticWrap = \"PlsW\" Play = \"Ply \" Pointillize = \"Pntl\" Polar = \"Plr \" PosterEdges = \"PstE\" Posterize = \"Pstr\" Previous = \"Prvs\" Print = \"Prnt\" ProfileToProfile = \"PrfT\" Purge = \"Prge\" Quit = \"quit\" RadialBlur = \"RdlB\" Rasterize = \"Rstr\" RasterizeTypeSheet = \"RstT\" RemoveBlackMatte = \"RmvB\" RemoveLayerMask = \"RmvL\" RemoveWhiteMatte = \"RmvW\" Rename = \"Rnm \" ReplaceColor = \"RplC\" Reset = \"Rset\" ResizeImage = \"1333cf0c-cb67-11d1-bc43-0060b0a13dc4\" Reticulation = \"Rtcl\" Revert = \"Rvrt\" Ripple = \"Rple\" Rotate = \"Rtte\" RoughPastels = \"RghP\" Save = \"save\" Select = \"slct\" SelectiveColor = \"SlcC\" Set = \"setd\" SharpenEdges = \"ShrE\" Sharpen = \"Shrp\" SharpenMore = \"ShrM\" Shear = \"Shr \" Show = \"Shw \" Similar = \"Smlr\" SmartBlur = \"SmrB\" Smooth = \"Smth\" SmudgeStick = \"SmdS\" Solarize = \"Slrz\" Spatter = \"Spt \" Spherize = \"Sphr\" SplitChannels = \"SplC\" Sponge = \"Spng\" SprayedStrokes = \"SprS\" StainedGlass = \"StnG\" Stamp = \"Stmp\" Stop = \"Stop\" Stroke = \"Strk\" Subtract = \"Sbtr\" SubtractFrom = \"SbtF\" Sumie = \"Smie\" TakeMergedSnapshot = \"TkMr\" TakeSnapshot = \"TkSn\" TextureFill = \"TxtF\" Texturizer = \"Txtz\" Threshold = \"Thrs\" Tiles = \"Tls \" TornEdges = \"TrnE\" TraceContour = \"TrcC\" Transform = \"Trnf\" Trap = \"Trap\" Twirl = \"Twrl\" Underpainting = \"Undr\" Undo = \"undo\" Ungroup = \"Ungr\" Unlink = \"Unlk\" UnsharpMask = \"UnsM\" Variations = \"Vrtn\" Wait = \"Wait\" WaterPaper = \"WtrP\" Watercolor = \"Wtrc\" Wave = \"Wave\" Wind = \"Wnd \" ZigZag = \"ZgZg\" BackLight = \"BacL\" FillFlash = \"FilE\" ColorCast = \"ColE\" OpenUntitled = \"OpnU\" PresetKind = \"presetKindType\" SmartSharpen = \"smartSharpen\" PresetKindType = \"presetKindType\" PresetKindCustom = \"presetKindCustom\" NoiseReduction = \"noiseReduction\" BlurType = \"blurType\" ContentLayer = \"contentLayer\" SaveStage = \"saveStage\" SaveStageType = \"saveStageType\" SaveSucceeded = \"saveSucceeded\" RasterizeLayer = \"rasterizeLayer\" ForceNotify = \"forceNotify\" PlacedLayerEditContents = \"placedLayerEditContents\"","title":"EventID"},{"location":"reference/photoshop/api/solid_color/","text":"A color definition used in the document. Maps a color to equivalents in all available color models. Used in Application.backgroundColor and foregroundColor properties, in Channel.color , in ColorSampler.color , and in TextItem.color Passed to PathItem.fillPath() , Selection.fill() , and Selection.stroke() . SolidColor Bases: Photoshop A color definition used in the document. Source code in photoshop/api/solid_color.py 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 class SolidColor ( Photoshop ): \"\"\"A color definition used in the document.\"\"\" object_name = \"SolidColor\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"isEqual\" , ) @property def cmyk ( self ) -> CMYKColor : \"\"\"The CMYK color mode. Returns: .colors.cmyk.CMYKColor: \"\"\" return CMYKColor ( self . app . cmyk ) @cmyk . setter def cmyk ( self , value : CMYKColor ): self . app . cmyk = value @property def gray ( self ) -> GrayColor : return GrayColor ( self . app . gray ) @property def hsb ( self ) -> HSBColor : return HSBColor ( self . app . hsb ) @hsb . setter def hsb ( self , value : HSBColor ): self . app . hsb = value @property def lab ( self ) -> LabColor : return LabColor ( self . app . lab ) @lab . setter def lab ( self , value : LabColor ): self . app . lab = value @property def model ( self ) -> ColorModel : \"\"\"The color model.\"\"\" return ColorModel ( self . app . model ) @model . setter def model ( self , value : ColorModel ): \"\"\"The color model.\"\"\" self . app . model = value @property def nearestWebColor ( self ) -> RGBColor : \"\"\"The nearest web color to the current color.\"\"\" return RGBColor ( self . app . NearestWebColor ) @property def rgb ( self ) -> RGBColor : \"\"\"The RGB color mode.\"\"\" return RGBColor ( self . app . rgb ) @rgb . setter def rgb ( self , value : RGBColor ): self . app . rgb = value def isEqual ( self , color : RGBColor ): \"\"\"`SolidColor` object is visually equal to the specified color.\"\"\" return self . app . isEqual ( color ) cmyk : CMYKColor property writable The CMYK color mode. Returns: Type Description CMYKColor .colors.cmyk.CMYKColor: model : ColorModel property writable The color model. nearestWebColor : RGBColor property The nearest web color to the current color. rgb : RGBColor property writable The RGB color mode. isEqual ( color ) SolidColor object is visually equal to the specified color. Source code in photoshop/api/solid_color.py 90 91 92 def isEqual ( self , color : RGBColor ): \"\"\"`SolidColor` object is visually equal to the specified color.\"\"\" return self . app . isEqual ( color )","title":"solid_color"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor","text":"Bases: Photoshop A color definition used in the document. Source code in photoshop/api/solid_color.py 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 class SolidColor ( Photoshop ): \"\"\"A color definition used in the document.\"\"\" object_name = \"SolidColor\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"isEqual\" , ) @property def cmyk ( self ) -> CMYKColor : \"\"\"The CMYK color mode. Returns: .colors.cmyk.CMYKColor: \"\"\" return CMYKColor ( self . app . cmyk ) @cmyk . setter def cmyk ( self , value : CMYKColor ): self . app . cmyk = value @property def gray ( self ) -> GrayColor : return GrayColor ( self . app . gray ) @property def hsb ( self ) -> HSBColor : return HSBColor ( self . app . hsb ) @hsb . setter def hsb ( self , value : HSBColor ): self . app . hsb = value @property def lab ( self ) -> LabColor : return LabColor ( self . app . lab ) @lab . setter def lab ( self , value : LabColor ): self . app . lab = value @property def model ( self ) -> ColorModel : \"\"\"The color model.\"\"\" return ColorModel ( self . app . model ) @model . setter def model ( self , value : ColorModel ): \"\"\"The color model.\"\"\" self . app . model = value @property def nearestWebColor ( self ) -> RGBColor : \"\"\"The nearest web color to the current color.\"\"\" return RGBColor ( self . app . NearestWebColor ) @property def rgb ( self ) -> RGBColor : \"\"\"The RGB color mode.\"\"\" return RGBColor ( self . app . rgb ) @rgb . setter def rgb ( self , value : RGBColor ): self . app . rgb = value def isEqual ( self , color : RGBColor ): \"\"\"`SolidColor` object is visually equal to the specified color.\"\"\" return self . app . isEqual ( color )","title":"SolidColor"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.cmyk","text":"The CMYK color mode. Returns: Type Description CMYKColor .colors.cmyk.CMYKColor:","title":"cmyk"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.model","text":"The color model.","title":"model"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.nearestWebColor","text":"The nearest web color to the current color.","title":"nearestWebColor"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.rgb","text":"The RGB color mode.","title":"rgb"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.isEqual","text":"SolidColor object is visually equal to the specified color. Source code in photoshop/api/solid_color.py 90 91 92 def isEqual ( self , color : RGBColor ): \"\"\"`SolidColor` object is visually equal to the specified color.\"\"\" return self . app . isEqual ( color )","title":"isEqual()"},{"location":"reference/photoshop/api/text_font/","text":"TextFont Bases: Photoshop An installed font. Source code in photoshop/api/text_font.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 class TextFont ( Photoshop ): \"\"\"An installed font.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) @property def family ( self ) -> str : \"\"\"The font family\"\"\" return self . app . family @property def name ( self ): \"\"\"The name of the font.\"\"\" return self . app . name @property def postScriptName ( self ): \"\"\"The PostScript name of the font.\"\"\" return self . app . postScriptName @property def style ( self ): \"\"\"The font style.\"\"\" return self . app . style family : str property The font family name property The name of the font. postScriptName property The PostScript name of the font. style property The font style.","title":"text_font"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont","text":"Bases: Photoshop An installed font. Source code in photoshop/api/text_font.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 class TextFont ( Photoshop ): \"\"\"An installed font.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) @property def family ( self ) -> str : \"\"\"The font family\"\"\" return self . app . family @property def name ( self ): \"\"\"The name of the font.\"\"\" return self . app . name @property def postScriptName ( self ): \"\"\"The PostScript name of the font.\"\"\" return self . app . postScriptName @property def style ( self ): \"\"\"The font style.\"\"\" return self . app . style","title":"TextFont"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont.family","text":"The font family","title":"family"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont.name","text":"The name of the font.","title":"name"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont.postScriptName","text":"The PostScript name of the font.","title":"postScriptName"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont.style","text":"The font style.","title":"style"},{"location":"reference/photoshop/api/text_item/","text":"TextItem Bases: Photoshop The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. Source code in photoshop/api/text_item.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 class TextItem ( Photoshop ): \"\"\"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer.\"\"\" object_name = \"Application\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"convertToShape\" , \"createPath\" , ) @property def alternateLigatures ( self ): return self . app . alternateLigatures @alternateLigatures . setter def alternateLigatures ( self , value ): self . app . alternateLigatures = value @property def antiAliasMethod ( self ) -> AntiAlias : \"\"\"The method of anti aliasing to use.\"\"\" return AntiAlias ( self . app . antiAliasMethod ) @antiAliasMethod . setter def antiAliasMethod ( self , value ): self . app . antiAliasMethod = value @property def autoKerning ( self ) -> AutoKernType : \"\"\"The auto kerning option to use.\"\"\" return AutoKernType ( self . app . autoKerning ) @autoKerning . setter def autoKerning ( self , value ): self . app . autoKerning = value @property def autoLeadingAmount ( self ): return self . app . autoLeadingAmount @autoLeadingAmount . setter def autoLeadingAmount ( self , value ): \"\"\"The percentage to use for auto (default) leading (in points). Valid only when useAutoLeading = True. \"\"\" self . app . useAutoLeading = True self . app . autoLeadingAmount = value @property def baselineShift ( self ): \"\"\"The unit value to use in the baseline offset of text.\"\"\" return self . app . baselineShift @baselineShift . setter def baselineShift ( self , value ): self . app . baselineShift = value @property def capitalization ( self ): \"\"\"Gets text case.\"\"\" return self . app . capitalization @capitalization . setter def capitalization ( self , value ): \"\"\"Sets text case.\"\"\" self . app . capitalization = value @property def color ( self ) -> SolidColor : \"\"\"The text color.\"\"\" return SolidColor ( self . app . color ) @color . setter def color ( self , color_value ): \"\"\"The color of textItem.\"\"\" self . app . color = color_value @property def contents ( self ) -> str : \"\"\"The actual text in the layer.\"\"\" return self . app . contents @contents . setter def contents ( self , text : str ): \"\"\"Set the actual text in the layer. Args: text: The actual text. \"\"\" self . app . contents = text @property def desiredGlyphScaling ( self ): \"\"\"The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled.\"\"\" return self . app . desiredGlyphScaling @desiredGlyphScaling . setter def desiredGlyphScaling ( self , value ): self . app . desiredGlyphScaling = value @property def desiredLetterScaling ( self ): \"\"\"The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required. \"\"\" return self . app . desiredLetterScaling @desiredLetterScaling . setter def desiredLetterScaling ( self , value ): self . app . desiredGlyphScaling = value @property def desiredWordScaling ( self ): \"\"\" The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required \"\"\" return self . app . desiredWordScaling @desiredWordScaling . setter def desiredWordScaling ( self , value ): self . app . desiredWordScaling = value @property def direction ( self ): \"\"\"The text orientation.\"\"\" return Direction ( self . app . direction ) @direction . setter def direction ( self , value ): self . app . direction = value @property def fauxBold ( self ): \"\"\"True to use faux bold (default: false). Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette. \"\"\" return self . app . fauxBold @fauxBold . setter def fauxBold ( self , value ): self . app . fauxBold = value @property def fauxItalic ( self ): \"\"\"True to use faux italic (default: false). Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette. \"\"\" return self . app . fauxItalic @fauxItalic . setter def fauxItalic ( self , value ): self . app . fauxItalic = value @property def firstLineIndent ( self ): \"\"\"The amount (unit value) to indent the first line of paragraphs.\"\"\" return self . app . firstLineIndent @firstLineIndent . setter def firstLineIndent ( self , value ): self . app . firstLineIndent = value @property def font ( self ): \"\"\".text_font.TextFont: Current font.\"\"\" return TextFont ( self . app . font ) @font . setter def font ( self , text_font ): self . app . font = text_font @property def hangingPunctuation ( self ): \"\"\"True to use Roman hanging punctuation.\"\"\" return self . app . hangingPunctuation @hangingPunctuation . setter def hangingPunctuation ( self , value ): self . app . hangingPunctuation = value @property def height ( self ): \"\"\"int:The height of the bounding box for paragraph text.\"\"\" return self . app . height @height . setter def height ( self , value ): self . app . height = value @property def horizontalScale ( self ): \"\"\"Character scaling (horizontal) in proportion to verticalScale (a percentage value). \"\"\" return self . app . horizontalScale @horizontalScale . setter def horizontalScale ( self , value ): self . app . horizontalScale = value @property def hyphenateAfterFirst ( self ): \"\"\"The number of letters after which hyphenation in word wrap is allowed.\"\"\" return self . app . hyphenateAfterFirst @hyphenateAfterFirst . setter def hyphenateAfterFirst ( self , value ): self . app . hyphenateAfterFirst = value @property def hyphenateBeforeLast ( self ): \"\"\"The number of letters before which hyphenation in word wrap is allowed.\"\"\" return self . app . hyphenateBeforeLast @hyphenateBeforeLast . setter def hyphenateBeforeLast ( self , value ): self . app . hyphenateBeforeLast = value @property def hyphenateCapitalWords ( self ): \"\"\"True to allow hyphenation in word wrap of capitalized words\"\"\" return self . app . hyphenateCapitalWords @hyphenateCapitalWords . setter def hyphenateCapitalWords ( self , value ): self . app . hyphenateCapitalWords = value @property def hyphenateWordsLongerThan ( self ): \"\"\"The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.\"\"\" return self . app . hyphenateWordsLongerThan @hyphenateWordsLongerThan . setter def hyphenateWordsLongerThan ( self , value ): self . app . hyphenateWordsLongerThan = value @property def hyphenation ( self ): \"\"\"True to use hyphenation in word wrap.\"\"\" return self . app . hyphenation @hyphenation . setter def hyphenation ( self , value ): self . app . hyphenation = value @property def hyphenationZone ( self ): \"\"\"The distance at the end of a line that will cause a word to break in unjustified type.\"\"\" return self . app . hyphenationZone @hyphenationZone . setter def hyphenationZone ( self , value ): self . app . hyphenationZone = value @property def hyphenLimit ( self ): return self . app . hyphenLimit @hyphenLimit . setter def hyphenLimit ( self , value ): self . app . hyphenLimit = value @property def justification ( self ): \"\"\"The paragraph justification.\"\"\" return Justification ( self . app . justification ) @justification . setter def justification ( self , value ): self . app . justification = value @property def kind ( self ): return TextType ( self . app . kind ) @kind . setter def kind ( self , kind_type ): self . app . kind = kind_type @property def language ( self ): return Language ( self . app . language ) @language . setter def language ( self , text ): self . app . language = text @property def leading ( self ): return self . app . leading @leading . setter def leading ( self , value ): self . app . leading = value @property def leftIndent ( self ): \"\"\"The amoun of space to indent text from the left.\"\"\" return self . app . leftIndent @leftIndent . setter def leftIndent ( self , value ): self . app . leftIndent = value @property def ligatures ( self ): \"\"\"True to use ligatures.\"\"\" return self . app . ligatures @ligatures . setter def ligatures ( self , value ): self . app . ligatures = value @property def maximumGlyphScaling ( self ): \"\"\"The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required. \"\"\" return self . app . maximumGlyphScaling @maximumGlyphScaling . setter def maximumGlyphScaling ( self , value ): self . app . maximumGlyphScaling = value @property def maximumLetterScaling ( self ): \"\"\"The maximum amount of space to allow between letters (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required. \"\"\" return self . app . maximumLetterScaling @maximumLetterScaling . setter def maximumLetterScaling ( self , value ): self . app . maximumLetterScaling = value @property def maximumWordScaling ( self ): return self . app . maximumWordScaling @maximumWordScaling . setter def maximumWordScaling ( self , value ): self . app . maximumWordScaling = value @property def minimumGlyphScaling ( self ): \"\"\"The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required. \"\"\" return self . app . minimumGlyphScaling @minimumGlyphScaling . setter def minimumGlyphScaling ( self , value ): self . app . minimumGlyphScaling = value @property def minimumLetterScaling ( self ): \"\"\"The minimum amount of space to allow between letters (a percentage value; at 0, no space is removed between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required. \"\"\" return self . app . minimumLetterScaling @minimumLetterScaling . setter def minimumLetterScaling ( self , value ): self . app . minimumLetterScaling = value @property def minimumWordScaling ( self ): \"\"\"The minimum amount of space to allow between words (a percentage value; at 100, no additional space is removed between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required. \"\"\" return self . app . minimumWordScaling @minimumWordScaling . setter def minimumWordScaling ( self , value ): self . app . minimumWordScaling = value @property def noBreak ( self ): \"\"\"True to disallow line breaks in this text. Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen. \"\"\" return self . app . noBreak @noBreak . setter def noBreak ( self , value ): self . app . noBreak = value @property def oldStyle ( self ): return self . app . oldStyle @oldStyle . setter def oldStyle ( self , value ): self . app . oldStyle = value @property def parent ( self ): return self . app . parent @parent . setter def parent ( self , value ): self . app . parent = value @property def position ( self ): return self . app . position @position . setter def position ( self , array ): \"\"\"The position of the origin for the text. The array must contain two values. Setting this property is basically equivalent to clicking the text tool at a point in the documents to create the point of origin for text. \"\"\" self . app . position = array @property def rightIndent ( self ): return self . app . rightIndent @rightIndent . setter def rightIndent ( self , value ): self . app . rightIndent = value @property def size ( self ): \"\"\"The font size in UnitValue. NOTE: Type was points for CS3 and older. \"\"\" return self . app . size @size . setter def size ( self , value ): self . app . size = value @property def spaceAfter ( self ): \"\"\"The amount of space to use after each paragraph.\"\"\" return self . app . spaceAfter @spaceAfter . setter def spaceAfter ( self , value ): self . app . spaceAfter = value @property def spaceBefore ( self ): return self . app . spaceBefore @spaceBefore . setter def spaceBefore ( self , value ): self . app . spaceBefore = value @property def strikeThru ( self ): \"\"\"The text strike-through option to use.\"\"\" return StrikeThruType ( self . app . strikeThru ) @strikeThru . setter def strikeThru ( self , value ): self . app . strikeThru = value @property def textComposer ( self ): return TextComposer ( self . app . textComposer ) @textComposer . setter def textComposer ( self , value ): self . app . textComposer = value @property def tracking ( self ): return self . app . tracking @tracking . setter def tracking ( self , value ): self . app . tracking = value @property def underline ( self ): \"\"\"The text underlining options.\"\"\" return self . app . underline @underline . setter def underline ( self , value ): self . app . underline = value @property def useAutoLeading ( self ): return self . app . useAutoLeading @useAutoLeading . setter def useAutoLeading ( self , value ): self . app . useAutoLeading = value @property def verticalScale ( self ): return self . app . verticalScale @verticalScale . setter def verticalScale ( self , value ): self . app . verticalScale = value @property def warpBend ( self ): \"\"\"The warp bend percentage.\"\"\" return self . app . warpBend @warpBend . setter def warpBend ( self , value ): self . app . warpBend = value @property def warpDirection ( self ) -> Direction : \"\"\"The warp direction.\"\"\" return Direction ( self . app . warpDirection ) @warpDirection . setter def warpDirection ( self , value ): self . app . warpDirection = value @property def warpHorizontalDistortion ( self ): return self . app . warpHorizontalDistortion @warpHorizontalDistortion . setter def warpHorizontalDistortion ( self , value ): self . app . warpHorizontalDistortion = value @property def warpStyle ( self ): \"\"\"The style of warp to use.\"\"\" return self . app . warpStyle @warpStyle . setter def warpStyle ( self , value ): self . app . warpStyle = value @property def warpVerticalDistortion ( self ): return self . app . warpVerticalDistortion @warpVerticalDistortion . setter def warpVerticalDistortion ( self , value ): self . app . warpVerticalDistortion = value @property def width ( self ): \"\"\"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. \"\"\" return self . app . width @width . setter def width ( self , value : float ): \"\"\"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. \"\"\" self . app . width = value def convertToShape ( self ): \"\"\"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.\"\"\" return self . app . convertToShape () def createPath ( self ): \"\"\"Creates a clipping path from the outlines of the actual text items (such as letters or words). \"\"\" return self . app . createPath () antiAliasMethod : AntiAlias property writable The method of anti aliasing to use. autoKerning : AutoKernType property writable The auto kerning option to use. baselineShift property writable The unit value to use in the baseline offset of text. capitalization property writable Gets text case. color : SolidColor property writable The text color. contents : str property writable The actual text in the layer. desiredGlyphScaling property writable The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled. desiredLetterScaling property writable The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required. desiredWordScaling property writable The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required direction property writable The text orientation. fauxBold property writable True to use faux bold (default: false). Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette. fauxItalic property writable True to use faux italic (default: false). Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette. firstLineIndent property writable The amount (unit value) to indent the first line of paragraphs. font property writable .text_font.TextFont: Current font. hangingPunctuation property writable True to use Roman hanging punctuation. height property writable horizontalScale property writable Character scaling (horizontal) in proportion to verticalScale (a percentage value). hyphenateAfterFirst property writable The number of letters after which hyphenation in word wrap is allowed. hyphenateBeforeLast property writable The number of letters before which hyphenation in word wrap is allowed. hyphenateCapitalWords property writable True to allow hyphenation in word wrap of capitalized words hyphenateWordsLongerThan property writable The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed. hyphenation property writable True to use hyphenation in word wrap. hyphenationZone property writable The distance at the end of a line that will cause a word to break in unjustified type. justification property writable The paragraph justification. leftIndent property writable The amoun of space to indent text from the left. ligatures property writable True to use ligatures. maximumGlyphScaling property writable The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required. maximumLetterScaling property writable The maximum amount of space to allow between letters (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required. minimumGlyphScaling property writable The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required. minimumLetterScaling property writable The minimum amount of space to allow between letters (a percentage value; at 0, no space is removed between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required. minimumWordScaling property writable The minimum amount of space to allow between words (a percentage value; at 100, no additional space is removed between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required. noBreak property writable True to disallow line breaks in this text. Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen. size property writable The font size in UnitValue. NOTE: Type was points for CS3 and older. spaceAfter property writable The amount of space to use after each paragraph. strikeThru property writable The text strike-through option to use. underline property writable The text underlining options. warpBend property writable The warp bend percentage. warpDirection : Direction property writable The warp direction. warpStyle property writable The style of warp to use. width property writable The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. convertToShape () Converts the text item and its containing layer to a fill layer with the text changed to a clipping path. Source code in photoshop/api/text_item.py 677 678 679 680 def convertToShape ( self ): \"\"\"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.\"\"\" return self . app . convertToShape () createPath () Creates a clipping path from the outlines of the actual text items (such as letters or words). Source code in photoshop/api/text_item.py 682 683 684 685 686 687 688 def createPath ( self ): \"\"\"Creates a clipping path from the outlines of the actual text items (such as letters or words). \"\"\" return self . app . createPath ()","title":"text_item"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem","text":"Bases: Photoshop The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. Source code in photoshop/api/text_item.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 class TextItem ( Photoshop ): \"\"\"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer.\"\"\" object_name = \"Application\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"convertToShape\" , \"createPath\" , ) @property def alternateLigatures ( self ): return self . app . alternateLigatures @alternateLigatures . setter def alternateLigatures ( self , value ): self . app . alternateLigatures = value @property def antiAliasMethod ( self ) -> AntiAlias : \"\"\"The method of anti aliasing to use.\"\"\" return AntiAlias ( self . app . antiAliasMethod ) @antiAliasMethod . setter def antiAliasMethod ( self , value ): self . app . antiAliasMethod = value @property def autoKerning ( self ) -> AutoKernType : \"\"\"The auto kerning option to use.\"\"\" return AutoKernType ( self . app . autoKerning ) @autoKerning . setter def autoKerning ( self , value ): self . app . autoKerning = value @property def autoLeadingAmount ( self ): return self . app . autoLeadingAmount @autoLeadingAmount . setter def autoLeadingAmount ( self , value ): \"\"\"The percentage to use for auto (default) leading (in points). Valid only when useAutoLeading = True. \"\"\" self . app . useAutoLeading = True self . app . autoLeadingAmount = value @property def baselineShift ( self ): \"\"\"The unit value to use in the baseline offset of text.\"\"\" return self . app . baselineShift @baselineShift . setter def baselineShift ( self , value ): self . app . baselineShift = value @property def capitalization ( self ): \"\"\"Gets text case.\"\"\" return self . app . capitalization @capitalization . setter def capitalization ( self , value ): \"\"\"Sets text case.\"\"\" self . app . capitalization = value @property def color ( self ) -> SolidColor : \"\"\"The text color.\"\"\" return SolidColor ( self . app . color ) @color . setter def color ( self , color_value ): \"\"\"The color of textItem.\"\"\" self . app . color = color_value @property def contents ( self ) -> str : \"\"\"The actual text in the layer.\"\"\" return self . app . contents @contents . setter def contents ( self , text : str ): \"\"\"Set the actual text in the layer. Args: text: The actual text. \"\"\" self . app . contents = text @property def desiredGlyphScaling ( self ): \"\"\"The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled.\"\"\" return self . app . desiredGlyphScaling @desiredGlyphScaling . setter def desiredGlyphScaling ( self , value ): self . app . desiredGlyphScaling = value @property def desiredLetterScaling ( self ): \"\"\"The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required. \"\"\" return self . app . desiredLetterScaling @desiredLetterScaling . setter def desiredLetterScaling ( self , value ): self . app . desiredGlyphScaling = value @property def desiredWordScaling ( self ): \"\"\" The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required \"\"\" return self . app . desiredWordScaling @desiredWordScaling . setter def desiredWordScaling ( self , value ): self . app . desiredWordScaling = value @property def direction ( self ): \"\"\"The text orientation.\"\"\" return Direction ( self . app . direction ) @direction . setter def direction ( self , value ): self . app . direction = value @property def fauxBold ( self ): \"\"\"True to use faux bold (default: false). Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette. \"\"\" return self . app . fauxBold @fauxBold . setter def fauxBold ( self , value ): self . app . fauxBold = value @property def fauxItalic ( self ): \"\"\"True to use faux italic (default: false). Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette. \"\"\" return self . app . fauxItalic @fauxItalic . setter def fauxItalic ( self , value ): self . app . fauxItalic = value @property def firstLineIndent ( self ): \"\"\"The amount (unit value) to indent the first line of paragraphs.\"\"\" return self . app . firstLineIndent @firstLineIndent . setter def firstLineIndent ( self , value ): self . app . firstLineIndent = value @property def font ( self ): \"\"\".text_font.TextFont: Current font.\"\"\" return TextFont ( self . app . font ) @font . setter def font ( self , text_font ): self . app . font = text_font @property def hangingPunctuation ( self ): \"\"\"True to use Roman hanging punctuation.\"\"\" return self . app . hangingPunctuation @hangingPunctuation . setter def hangingPunctuation ( self , value ): self . app . hangingPunctuation = value @property def height ( self ): \"\"\"int:The height of the bounding box for paragraph text.\"\"\" return self . app . height @height . setter def height ( self , value ): self . app . height = value @property def horizontalScale ( self ): \"\"\"Character scaling (horizontal) in proportion to verticalScale (a percentage value). \"\"\" return self . app . horizontalScale @horizontalScale . setter def horizontalScale ( self , value ): self . app . horizontalScale = value @property def hyphenateAfterFirst ( self ): \"\"\"The number of letters after which hyphenation in word wrap is allowed.\"\"\" return self . app . hyphenateAfterFirst @hyphenateAfterFirst . setter def hyphenateAfterFirst ( self , value ): self . app . hyphenateAfterFirst = value @property def hyphenateBeforeLast ( self ): \"\"\"The number of letters before which hyphenation in word wrap is allowed.\"\"\" return self . app . hyphenateBeforeLast @hyphenateBeforeLast . setter def hyphenateBeforeLast ( self , value ): self . app . hyphenateBeforeLast = value @property def hyphenateCapitalWords ( self ): \"\"\"True to allow hyphenation in word wrap of capitalized words\"\"\" return self . app . hyphenateCapitalWords @hyphenateCapitalWords . setter def hyphenateCapitalWords ( self , value ): self . app . hyphenateCapitalWords = value @property def hyphenateWordsLongerThan ( self ): \"\"\"The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.\"\"\" return self . app . hyphenateWordsLongerThan @hyphenateWordsLongerThan . setter def hyphenateWordsLongerThan ( self , value ): self . app . hyphenateWordsLongerThan = value @property def hyphenation ( self ): \"\"\"True to use hyphenation in word wrap.\"\"\" return self . app . hyphenation @hyphenation . setter def hyphenation ( self , value ): self . app . hyphenation = value @property def hyphenationZone ( self ): \"\"\"The distance at the end of a line that will cause a word to break in unjustified type.\"\"\" return self . app . hyphenationZone @hyphenationZone . setter def hyphenationZone ( self , value ): self . app . hyphenationZone = value @property def hyphenLimit ( self ): return self . app . hyphenLimit @hyphenLimit . setter def hyphenLimit ( self , value ): self . app . hyphenLimit = value @property def justification ( self ): \"\"\"The paragraph justification.\"\"\" return Justification ( self . app . justification ) @justification . setter def justification ( self , value ): self . app . justification = value @property def kind ( self ): return TextType ( self . app . kind ) @kind . setter def kind ( self , kind_type ): self . app . kind = kind_type @property def language ( self ): return Language ( self . app . language ) @language . setter def language ( self , text ): self . app . language = text @property def leading ( self ): return self . app . leading @leading . setter def leading ( self , value ): self . app . leading = value @property def leftIndent ( self ): \"\"\"The amoun of space to indent text from the left.\"\"\" return self . app . leftIndent @leftIndent . setter def leftIndent ( self , value ): self . app . leftIndent = value @property def ligatures ( self ): \"\"\"True to use ligatures.\"\"\" return self . app . ligatures @ligatures . setter def ligatures ( self , value ): self . app . ligatures = value @property def maximumGlyphScaling ( self ): \"\"\"The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required. \"\"\" return self . app . maximumGlyphScaling @maximumGlyphScaling . setter def maximumGlyphScaling ( self , value ): self . app . maximumGlyphScaling = value @property def maximumLetterScaling ( self ): \"\"\"The maximum amount of space to allow between letters (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required. \"\"\" return self . app . maximumLetterScaling @maximumLetterScaling . setter def maximumLetterScaling ( self , value ): self . app . maximumLetterScaling = value @property def maximumWordScaling ( self ): return self . app . maximumWordScaling @maximumWordScaling . setter def maximumWordScaling ( self , value ): self . app . maximumWordScaling = value @property def minimumGlyphScaling ( self ): \"\"\"The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required. \"\"\" return self . app . minimumGlyphScaling @minimumGlyphScaling . setter def minimumGlyphScaling ( self , value ): self . app . minimumGlyphScaling = value @property def minimumLetterScaling ( self ): \"\"\"The minimum amount of space to allow between letters (a percentage value; at 0, no space is removed between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required. \"\"\" return self . app . minimumLetterScaling @minimumLetterScaling . setter def minimumLetterScaling ( self , value ): self . app . minimumLetterScaling = value @property def minimumWordScaling ( self ): \"\"\"The minimum amount of space to allow between words (a percentage value; at 100, no additional space is removed between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required. \"\"\" return self . app . minimumWordScaling @minimumWordScaling . setter def minimumWordScaling ( self , value ): self . app . minimumWordScaling = value @property def noBreak ( self ): \"\"\"True to disallow line breaks in this text. Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen. \"\"\" return self . app . noBreak @noBreak . setter def noBreak ( self , value ): self . app . noBreak = value @property def oldStyle ( self ): return self . app . oldStyle @oldStyle . setter def oldStyle ( self , value ): self . app . oldStyle = value @property def parent ( self ): return self . app . parent @parent . setter def parent ( self , value ): self . app . parent = value @property def position ( self ): return self . app . position @position . setter def position ( self , array ): \"\"\"The position of the origin for the text. The array must contain two values. Setting this property is basically equivalent to clicking the text tool at a point in the documents to create the point of origin for text. \"\"\" self . app . position = array @property def rightIndent ( self ): return self . app . rightIndent @rightIndent . setter def rightIndent ( self , value ): self . app . rightIndent = value @property def size ( self ): \"\"\"The font size in UnitValue. NOTE: Type was points for CS3 and older. \"\"\" return self . app . size @size . setter def size ( self , value ): self . app . size = value @property def spaceAfter ( self ): \"\"\"The amount of space to use after each paragraph.\"\"\" return self . app . spaceAfter @spaceAfter . setter def spaceAfter ( self , value ): self . app . spaceAfter = value @property def spaceBefore ( self ): return self . app . spaceBefore @spaceBefore . setter def spaceBefore ( self , value ): self . app . spaceBefore = value @property def strikeThru ( self ): \"\"\"The text strike-through option to use.\"\"\" return StrikeThruType ( self . app . strikeThru ) @strikeThru . setter def strikeThru ( self , value ): self . app . strikeThru = value @property def textComposer ( self ): return TextComposer ( self . app . textComposer ) @textComposer . setter def textComposer ( self , value ): self . app . textComposer = value @property def tracking ( self ): return self . app . tracking @tracking . setter def tracking ( self , value ): self . app . tracking = value @property def underline ( self ): \"\"\"The text underlining options.\"\"\" return self . app . underline @underline . setter def underline ( self , value ): self . app . underline = value @property def useAutoLeading ( self ): return self . app . useAutoLeading @useAutoLeading . setter def useAutoLeading ( self , value ): self . app . useAutoLeading = value @property def verticalScale ( self ): return self . app . verticalScale @verticalScale . setter def verticalScale ( self , value ): self . app . verticalScale = value @property def warpBend ( self ): \"\"\"The warp bend percentage.\"\"\" return self . app . warpBend @warpBend . setter def warpBend ( self , value ): self . app . warpBend = value @property def warpDirection ( self ) -> Direction : \"\"\"The warp direction.\"\"\" return Direction ( self . app . warpDirection ) @warpDirection . setter def warpDirection ( self , value ): self . app . warpDirection = value @property def warpHorizontalDistortion ( self ): return self . app . warpHorizontalDistortion @warpHorizontalDistortion . setter def warpHorizontalDistortion ( self , value ): self . app . warpHorizontalDistortion = value @property def warpStyle ( self ): \"\"\"The style of warp to use.\"\"\" return self . app . warpStyle @warpStyle . setter def warpStyle ( self , value ): self . app . warpStyle = value @property def warpVerticalDistortion ( self ): return self . app . warpVerticalDistortion @warpVerticalDistortion . setter def warpVerticalDistortion ( self , value ): self . app . warpVerticalDistortion = value @property def width ( self ): \"\"\"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. \"\"\" return self . app . width @width . setter def width ( self , value : float ): \"\"\"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. \"\"\" self . app . width = value def convertToShape ( self ): \"\"\"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.\"\"\" return self . app . convertToShape () def createPath ( self ): \"\"\"Creates a clipping path from the outlines of the actual text items (such as letters or words). \"\"\" return self . app . createPath ()","title":"TextItem"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.antiAliasMethod","text":"The method of anti aliasing to use.","title":"antiAliasMethod"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.autoKerning","text":"The auto kerning option to use.","title":"autoKerning"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.baselineShift","text":"The unit value to use in the baseline offset of text.","title":"baselineShift"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.capitalization","text":"Gets text case.","title":"capitalization"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.color","text":"The text color.","title":"color"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.contents","text":"The actual text in the layer.","title":"contents"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.desiredGlyphScaling","text":"The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled.","title":"desiredGlyphScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.desiredLetterScaling","text":"The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required.","title":"desiredLetterScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.desiredWordScaling","text":"The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required","title":"desiredWordScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.direction","text":"The text orientation.","title":"direction"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.fauxBold","text":"True to use faux bold (default: false). Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette.","title":"fauxBold"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.fauxItalic","text":"True to use faux italic (default: false). Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette.","title":"fauxItalic"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.firstLineIndent","text":"The amount (unit value) to indent the first line of paragraphs.","title":"firstLineIndent"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.font","text":".text_font.TextFont: Current font.","title":"font"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hangingPunctuation","text":"True to use Roman hanging punctuation.","title":"hangingPunctuation"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.height","text":"","title":"height"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.horizontalScale","text":"Character scaling (horizontal) in proportion to verticalScale (a percentage value).","title":"horizontalScale"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenateAfterFirst","text":"The number of letters after which hyphenation in word wrap is allowed.","title":"hyphenateAfterFirst"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenateBeforeLast","text":"The number of letters before which hyphenation in word wrap is allowed.","title":"hyphenateBeforeLast"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenateCapitalWords","text":"True to allow hyphenation in word wrap of capitalized words","title":"hyphenateCapitalWords"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenateWordsLongerThan","text":"The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.","title":"hyphenateWordsLongerThan"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenation","text":"True to use hyphenation in word wrap.","title":"hyphenation"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenationZone","text":"The distance at the end of a line that will cause a word to break in unjustified type.","title":"hyphenationZone"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.justification","text":"The paragraph justification.","title":"justification"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.leftIndent","text":"The amoun of space to indent text from the left.","title":"leftIndent"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.ligatures","text":"True to use ligatures.","title":"ligatures"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.maximumGlyphScaling","text":"The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required.","title":"maximumGlyphScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.maximumLetterScaling","text":"The maximum amount of space to allow between letters (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required.","title":"maximumLetterScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.minimumGlyphScaling","text":"The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required.","title":"minimumGlyphScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.minimumLetterScaling","text":"The minimum amount of space to allow between letters (a percentage value; at 0, no space is removed between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required.","title":"minimumLetterScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.minimumWordScaling","text":"The minimum amount of space to allow between words (a percentage value; at 100, no additional space is removed between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required.","title":"minimumWordScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.noBreak","text":"True to disallow line breaks in this text. Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen.","title":"noBreak"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.size","text":"The font size in UnitValue. NOTE: Type was points for CS3 and older.","title":"size"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.spaceAfter","text":"The amount of space to use after each paragraph.","title":"spaceAfter"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.strikeThru","text":"The text strike-through option to use.","title":"strikeThru"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.underline","text":"The text underlining options.","title":"underline"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.warpBend","text":"The warp bend percentage.","title":"warpBend"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.warpDirection","text":"The warp direction.","title":"warpDirection"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.warpStyle","text":"The style of warp to use.","title":"warpStyle"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.width","text":"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT.","title":"width"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.convertToShape","text":"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path. Source code in photoshop/api/text_item.py 677 678 679 680 def convertToShape ( self ): \"\"\"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.\"\"\" return self . app . convertToShape ()","title":"convertToShape()"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.createPath","text":"Creates a clipping path from the outlines of the actual text items (such as letters or words). Source code in photoshop/api/text_item.py 682 683 684 685 686 687 688 def createPath ( self ): \"\"\"Creates a clipping path from the outlines of the actual text items (such as letters or words). \"\"\" return self . app . createPath ()","title":"createPath()"},{"location":"reference/photoshop/api/colors/cmyk/","text":"Defines a CMYK color, used in the SolidColor object. CMYKColor Bases: Photoshop A CMYK color specification. Source code in photoshop/api/colors/cmyk.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 class CMYKColor ( Photoshop ): \"\"\"A CMYK color specification.\"\"\" object_name = \"CMYKColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def black ( self ) -> int : \"\"\"The black color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . black ) @black . setter def black ( self , value : int ): self . app . black = value @property def cyan ( self ) -> int : \"\"\"The cyan color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . cyan ) @cyan . setter def cyan ( self , value : int ): self . app . cyan = value @property def magenta ( self ) -> int : \"\"\"The magenta color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . magenta ) @magenta . setter def magenta ( self , value : int ): self . app . magenta = value @property def yellow ( self ) -> int : \"\"\"The yellow color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . yellow ) @yellow . setter def yellow ( self , value : int ): self . app . yellow = value black : int property writable The black color value. Range: 0.0 to 100.0. cyan : int property writable The cyan color value. Range: 0.0 to 100.0. magenta : int property writable The magenta color value. Range: 0.0 to 100.0. yellow : int property writable The yellow color value. Range: 0.0 to 100.0.","title":"cmyk"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor","text":"Bases: Photoshop A CMYK color specification. Source code in photoshop/api/colors/cmyk.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 class CMYKColor ( Photoshop ): \"\"\"A CMYK color specification.\"\"\" object_name = \"CMYKColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def black ( self ) -> int : \"\"\"The black color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . black ) @black . setter def black ( self , value : int ): self . app . black = value @property def cyan ( self ) -> int : \"\"\"The cyan color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . cyan ) @cyan . setter def cyan ( self , value : int ): self . app . cyan = value @property def magenta ( self ) -> int : \"\"\"The magenta color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . magenta ) @magenta . setter def magenta ( self , value : int ): self . app . magenta = value @property def yellow ( self ) -> int : \"\"\"The yellow color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . yellow ) @yellow . setter def yellow ( self , value : int ): self . app . yellow = value","title":"CMYKColor"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor.black","text":"The black color value. Range: 0.0 to 100.0.","title":"black"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor.cyan","text":"The cyan color value. Range: 0.0 to 100.0.","title":"cyan"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor.magenta","text":"The magenta color value. Range: 0.0 to 100.0.","title":"magenta"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor.yellow","text":"The yellow color value. Range: 0.0 to 100.0.","title":"yellow"},{"location":"reference/photoshop/api/colors/gray/","text":"Defines a gray color, used in the SolidColor object. GrayColor Bases: Photoshop Options for defining a gray color. Source code in photoshop/api/colors/gray.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 class GrayColor ( Photoshop ): \"\"\"Options for defining a gray color.\"\"\" object_name = \"GrayColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def gray ( self ) -> float : \"\"\"The gray value.\"\"\" return self . app . gray @gray . setter def gray ( self , value : float ): \"\"\"The gray value.\"\"\" self . app . gray = value gray : float property writable The gray value.","title":"gray"},{"location":"reference/photoshop/api/colors/gray/#photoshop.api.colors.gray.GrayColor","text":"Bases: Photoshop Options for defining a gray color. Source code in photoshop/api/colors/gray.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 class GrayColor ( Photoshop ): \"\"\"Options for defining a gray color.\"\"\" object_name = \"GrayColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def gray ( self ) -> float : \"\"\"The gray value.\"\"\" return self . app . gray @gray . setter def gray ( self , value : float ): \"\"\"The gray value.\"\"\" self . app . gray = value","title":"GrayColor"},{"location":"reference/photoshop/api/colors/gray/#photoshop.api.colors.gray.GrayColor.gray","text":"The gray value.","title":"gray"},{"location":"reference/photoshop/api/colors/hsb/","text":"Defines an HSB color, used in the SolidColor object. HSBColor Bases: Photoshop An HSB color specification. Source code in photoshop/api/colors/hsb.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 class HSBColor ( Photoshop ): \"\"\"An HSB color specification.\"\"\" object_name = \"HSBColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def brightness ( self ): return round ( self . app . brightness ) @brightness . setter def brightness ( self , value ): self . app . brightness = value @property def saturation ( self ): return round ( self . app . saturation ) @saturation . setter def saturation ( self , value ): self . app . saturation = value @property def hue ( self ): \"\"\"The hue value. Range: 0.0 to 360.0.\"\"\" return round ( self . app . hue ) @hue . setter def hue ( self , value ): self . app . hue = value hue property writable The hue value. Range: 0.0 to 360.0.","title":"hsb"},{"location":"reference/photoshop/api/colors/hsb/#photoshop.api.colors.hsb.HSBColor","text":"Bases: Photoshop An HSB color specification. Source code in photoshop/api/colors/hsb.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 class HSBColor ( Photoshop ): \"\"\"An HSB color specification.\"\"\" object_name = \"HSBColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def brightness ( self ): return round ( self . app . brightness ) @brightness . setter def brightness ( self , value ): self . app . brightness = value @property def saturation ( self ): return round ( self . app . saturation ) @saturation . setter def saturation ( self , value ): self . app . saturation = value @property def hue ( self ): \"\"\"The hue value. Range: 0.0 to 360.0.\"\"\" return round ( self . app . hue ) @hue . setter def hue ( self , value ): self . app . hue = value","title":"HSBColor"},{"location":"reference/photoshop/api/colors/hsb/#photoshop.api.colors.hsb.HSBColor.hue","text":"The hue value. Range: 0.0 to 360.0.","title":"hue"},{"location":"reference/photoshop/api/colors/lab/","text":"LabColor Bases: Photoshop A Lab color specification. Source code in photoshop/api/colors/lab.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 class LabColor ( Photoshop ): \"\"\"A Lab color specification.\"\"\" object_name = \"LabColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def A ( self ): return round ( self . app . A ) @A . setter def A ( self , value ): self . app . A = value @property def B ( self ): return round ( self . app . B ) @B . setter def B ( self , value ): self . app . B = value @property def L ( self ): return round ( self . app . L ) @L . setter def L ( self , value ): self . app . L = value","title":"lab"},{"location":"reference/photoshop/api/colors/lab/#photoshop.api.colors.lab.LabColor","text":"Bases: Photoshop A Lab color specification. Source code in photoshop/api/colors/lab.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 class LabColor ( Photoshop ): \"\"\"A Lab color specification.\"\"\" object_name = \"LabColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def A ( self ): return round ( self . app . A ) @A . setter def A ( self , value ): self . app . A = value @property def B ( self ): return round ( self . app . B ) @B . setter def B ( self , value ): self . app . B = value @property def L ( self ): return round ( self . app . L ) @L . setter def L ( self , value ): self . app . L = value","title":"LabColor"},{"location":"reference/photoshop/api/colors/rgb/","text":"RGBColor Bases: Photoshop The definition of an RGB color mode. Source code in photoshop/api/colors/rgb.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 class RGBColor ( Photoshop ): \"\"\"The definition of an RGB color mode.\"\"\" object_name = \"RGBColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . blue = self . app . blue self . green = self . app . green self . red = self . app . red @property def blue ( self ) -> int : return round ( self . app . blue ) @blue . setter def blue ( self , value : int ): self . app . blue = value @property def green ( self ) -> int : return round ( self . app . green ) @green . setter def green ( self , value : int ): self . app . green = value @property def red ( self ) -> int : return round ( self . app . red ) @red . setter def red ( self , value : int ): self . app . red = value @property def hexValue ( self ): return self . app . hexValue @hexValue . setter def hexValue ( self , value ): self . app . hexValue = value def __str__ ( self ): return f \"[red: { self . red } , green: { self . green } , blue: { self . blue } )]\"","title":"rgb"},{"location":"reference/photoshop/api/colors/rgb/#photoshop.api.colors.rgb.RGBColor","text":"Bases: Photoshop The definition of an RGB color mode. Source code in photoshop/api/colors/rgb.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 class RGBColor ( Photoshop ): \"\"\"The definition of an RGB color mode.\"\"\" object_name = \"RGBColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . blue = self . app . blue self . green = self . app . green self . red = self . app . red @property def blue ( self ) -> int : return round ( self . app . blue ) @blue . setter def blue ( self , value : int ): self . app . blue = value @property def green ( self ) -> int : return round ( self . app . green ) @green . setter def green ( self , value : int ): self . app . green = value @property def red ( self ) -> int : return round ( self . app . red ) @red . setter def red ( self , value : int ): self . app . red = value @property def hexValue ( self ): return self . app . hexValue @hexValue . setter def hexValue ( self , value ): self . app . hexValue = value def __str__ ( self ): return f \"[red: { self . red } , green: { self . green } , blue: { self . blue } )]\"","title":"RGBColor"},{"location":"reference/photoshop/api/open_options/eps/","text":"EPSOpenOptions Bases: Photoshop Options for saving a document in EPS format. using the Document.saveAs() Source code in photoshop/api/open_options/eps.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 class EPSOpenOptions ( Photoshop ): \"\"\"Options for saving a document in EPS format. using the `Document.saveAs()` \"\"\" object_name = \"EPSOpenOptions\" def __init__ ( self ): super () . __init__ () @property def antiAlias ( self ): return self . app . antiAlias @property def constrainProportions ( self ): return self . app . constrainProportions @property def height ( self ): return self . app . height @property def mode ( self ): return self . app . mode @property def resolution ( self ): return self . app . resolution @property def width ( self ): return self . app . width @property def embedColorProfile ( self ): return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , boolean ): self . app . embedColorProfile = boolean","title":"eps"},{"location":"reference/photoshop/api/open_options/eps/#photoshop.api.open_options.eps.EPSOpenOptions","text":"Bases: Photoshop Options for saving a document in EPS format. using the Document.saveAs() Source code in photoshop/api/open_options/eps.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 class EPSOpenOptions ( Photoshop ): \"\"\"Options for saving a document in EPS format. using the `Document.saveAs()` \"\"\" object_name = \"EPSOpenOptions\" def __init__ ( self ): super () . __init__ () @property def antiAlias ( self ): return self . app . antiAlias @property def constrainProportions ( self ): return self . app . constrainProportions @property def height ( self ): return self . app . height @property def mode ( self ): return self . app . mode @property def resolution ( self ): return self . app . resolution @property def width ( self ): return self . app . width @property def embedColorProfile ( self ): return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , boolean ): self . app . embedColorProfile = boolean","title":"EPSOpenOptions"},{"location":"reference/photoshop/api/save_options/bmp/","text":"Options for saving a document in BMO format. BMPSaveOptions Bases: Photoshop Options for saving a document in BMP format. Source code in photoshop/api/save_options/bmp.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 class BMPSaveOptions ( Photoshop ): \"\"\"Options for saving a document in BMP format.\"\"\" object_name = \"BMPSaveOptions\" def __init__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"State to save the alpha channels.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): \"\"\"Sets whether to save the alpha channels or not. Args: \"\"\" self . app . alphaChannels = value alphaChannels property writable State to save the alpha channels.","title":"bmp"},{"location":"reference/photoshop/api/save_options/bmp/#photoshop.api.save_options.bmp.BMPSaveOptions","text":"Bases: Photoshop Options for saving a document in BMP format. Source code in photoshop/api/save_options/bmp.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 class BMPSaveOptions ( Photoshop ): \"\"\"Options for saving a document in BMP format.\"\"\" object_name = \"BMPSaveOptions\" def __init__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"State to save the alpha channels.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): \"\"\"Sets whether to save the alpha channels or not. Args: \"\"\" self . app . alphaChannels = value","title":"BMPSaveOptions"},{"location":"reference/photoshop/api/save_options/bmp/#photoshop.api.save_options.bmp.BMPSaveOptions.alphaChannels","text":"State to save the alpha channels.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/eps/","text":"EPSSaveOptions Bases: Photoshop Options for saving a document in EPS format. using the Document.saveAs() Source code in photoshop/api/save_options/eps.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 class EPSSaveOptions ( Photoshop ): \"\"\"Options for saving a document in EPS format. using the `Document.saveAs()` \"\"\" object_name = \"EPSSaveOptions\" def __init__ ( self ): super () . __init__ () @property def embedColorProfile ( self ) -> bool : \"\"\"True to embed the color profile in this document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , boolean : bool ): \"\"\"True to embed the color profile in this document.\"\"\" self . app . embedColorProfile = boolean @property def encoding ( self ): return self . app . encoding @encoding . setter def encoding ( self , value : bool ): self . app . encoding = value @property def halftoneScreen ( self ): return self . app . halftoneScreen @halftoneScreen . setter def halftoneScreen ( self , value : bool ): self . app . halftoneScreen = value @property def interpolation ( self ): return self . app . interpolation @interpolation . setter def interpolation ( self , value : bool ): self . app . interpolation = value @property def preview ( self ): return self . app . preview @preview . setter def preview ( self , value : bool ): self . app . preview = value @property def psColorManagement ( self ): return self . app . psColorManagement @psColorManagement . setter def psColorManagement ( self , value : bool ): self . app . psColorManagement = value @property def transferFunction ( self ): return self . app . transferFunction @transferFunction . setter def transferFunction ( self , value : bool ): self . app . transferFunction = value @property def transparentWhites ( self ) -> bool : \"\"\"True to display white areas as transparent\"\"\" return self . app . transparentWhites @transparentWhites . setter def transparentWhites ( self , value : bool ): \"\"\"True to display white areas as transparent\"\"\" self . app . transparentWhites = value @property def vectorData ( self ): \"\"\"True to include vector data.\"\"\" return self . app . vectorData @vectorData . setter def vectorData ( self , value : bool ): \"\"\"True to include vector data. Valid only if the document includes vector data (text). \"\"\" self . app . vectorData = value embedColorProfile : bool property writable True to embed the color profile in this document. transparentWhites : bool property writable True to display white areas as transparent vectorData property writable True to include vector data.","title":"eps"},{"location":"reference/photoshop/api/save_options/eps/#photoshop.api.save_options.eps.EPSSaveOptions","text":"Bases: Photoshop Options for saving a document in EPS format. using the Document.saveAs() Source code in photoshop/api/save_options/eps.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 class EPSSaveOptions ( Photoshop ): \"\"\"Options for saving a document in EPS format. using the `Document.saveAs()` \"\"\" object_name = \"EPSSaveOptions\" def __init__ ( self ): super () . __init__ () @property def embedColorProfile ( self ) -> bool : \"\"\"True to embed the color profile in this document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , boolean : bool ): \"\"\"True to embed the color profile in this document.\"\"\" self . app . embedColorProfile = boolean @property def encoding ( self ): return self . app . encoding @encoding . setter def encoding ( self , value : bool ): self . app . encoding = value @property def halftoneScreen ( self ): return self . app . halftoneScreen @halftoneScreen . setter def halftoneScreen ( self , value : bool ): self . app . halftoneScreen = value @property def interpolation ( self ): return self . app . interpolation @interpolation . setter def interpolation ( self , value : bool ): self . app . interpolation = value @property def preview ( self ): return self . app . preview @preview . setter def preview ( self , value : bool ): self . app . preview = value @property def psColorManagement ( self ): return self . app . psColorManagement @psColorManagement . setter def psColorManagement ( self , value : bool ): self . app . psColorManagement = value @property def transferFunction ( self ): return self . app . transferFunction @transferFunction . setter def transferFunction ( self , value : bool ): self . app . transferFunction = value @property def transparentWhites ( self ) -> bool : \"\"\"True to display white areas as transparent\"\"\" return self . app . transparentWhites @transparentWhites . setter def transparentWhites ( self , value : bool ): \"\"\"True to display white areas as transparent\"\"\" self . app . transparentWhites = value @property def vectorData ( self ): \"\"\"True to include vector data.\"\"\" return self . app . vectorData @vectorData . setter def vectorData ( self , value : bool ): \"\"\"True to include vector data. Valid only if the document includes vector data (text). \"\"\" self . app . vectorData = value","title":"EPSSaveOptions"},{"location":"reference/photoshop/api/save_options/eps/#photoshop.api.save_options.eps.EPSSaveOptions.embedColorProfile","text":"True to embed the color profile in this document.","title":"embedColorProfile"},{"location":"reference/photoshop/api/save_options/eps/#photoshop.api.save_options.eps.EPSSaveOptions.transparentWhites","text":"True to display white areas as transparent","title":"transparentWhites"},{"location":"reference/photoshop/api/save_options/eps/#photoshop.api.save_options.eps.EPSSaveOptions.vectorData","text":"True to include vector data.","title":"vectorData"},{"location":"reference/photoshop/api/save_options/gif/","text":"GIFSaveOptions Bases: Photoshop Options for saving a document in GIF format. Source code in photoshop/api/save_options/gif.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 class GIFSaveOptions ( Photoshop ): \"\"\"Options for saving a document in GIF format.\"\"\" object_name = \"GIFSaveOptions\" def __init__ ( self ): super () . __init__ () @property def colors ( self ): return self . app . color @colors . setter def colors ( self , value ): self . app . colors = value @property def dither ( self ): return self . app . dither @dither . setter def dither ( self , value ): self . app . dither = value @property def ditherAmount ( self ): return self . app . ditherAmount @ditherAmount . setter def ditherAmount ( self , value ): self . app . ditherAmount = value @property def forced ( self ): return self . app . forced @forced . setter def forced ( self , value ): self . app . forced = value @property def interlaced ( self ): return self . app . interlaced @interlaced . setter def interlaced ( self , value ): self . app . interlaced = value @property def matte ( self ): return self . app . matte @matte . setter def matte ( self , value ): self . app . matte = value @property def palette ( self ): return self . app . palette @palette . setter def palette ( self , value ): self . app . palette = value @property def preserveExactColors ( self ): return self . app . preserveExactColors @preserveExactColors . setter def preserveExactColors ( self , value ): self . app . preserveExactColors = value @property def transparency ( self ): return self . app . transparency @transparency . setter def transparency ( self , value ): self . app . transparency = value","title":"gif"},{"location":"reference/photoshop/api/save_options/gif/#photoshop.api.save_options.gif.GIFSaveOptions","text":"Bases: Photoshop Options for saving a document in GIF format. Source code in photoshop/api/save_options/gif.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 class GIFSaveOptions ( Photoshop ): \"\"\"Options for saving a document in GIF format.\"\"\" object_name = \"GIFSaveOptions\" def __init__ ( self ): super () . __init__ () @property def colors ( self ): return self . app . color @colors . setter def colors ( self , value ): self . app . colors = value @property def dither ( self ): return self . app . dither @dither . setter def dither ( self , value ): self . app . dither = value @property def ditherAmount ( self ): return self . app . ditherAmount @ditherAmount . setter def ditherAmount ( self , value ): self . app . ditherAmount = value @property def forced ( self ): return self . app . forced @forced . setter def forced ( self , value ): self . app . forced = value @property def interlaced ( self ): return self . app . interlaced @interlaced . setter def interlaced ( self , value ): self . app . interlaced = value @property def matte ( self ): return self . app . matte @matte . setter def matte ( self , value ): self . app . matte = value @property def palette ( self ): return self . app . palette @palette . setter def palette ( self , value ): self . app . palette = value @property def preserveExactColors ( self ): return self . app . preserveExactColors @preserveExactColors . setter def preserveExactColors ( self , value ): self . app . preserveExactColors = value @property def transparency ( self ): return self . app . transparency @transparency . setter def transparency ( self , value ): self . app . transparency = value","title":"GIFSaveOptions"},{"location":"reference/photoshop/api/save_options/jpg/","text":"JPEGSaveOptions Bases: Photoshop Options for saving a document in JPEG format. Source code in photoshop/api/save_options/jpg.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 class JPEGSaveOptions ( Photoshop ): \"\"\"Options for saving a document in JPEG format.\"\"\" object_name = \"JPEGSaveOptions\" def __init__ ( self , quality = 5 , embedColorProfile = True , matte = MatteType . NoMatte ): super () . __init__ () self . quality = quality self . embedColorProfile = embedColorProfile self . matte = matte @property def quality ( self ): return self . app . quality @quality . setter def quality ( self , value ): self . app . quality = value @property def formatOptions ( self ): \"\"\"The download format to use.\"\"\" return self . app . formatOptions @formatOptions . setter def formatOptions ( self , value ): self . app . formatOptions = value @property def embedColorProfile ( self ): return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def matte ( self ): \"\"\"The color to use to fill anti-aliased edges adjacent to transparent\"\"\" return self . app . matte @matte . setter def matte ( self , value ): self . app . matte = value @property def scans ( self ): return self . app . scans @scans . setter def scans ( self , value ): self . app . scans = value formatOptions property writable The download format to use. matte property writable The color to use to fill anti-aliased edges adjacent to transparent","title":"jpg"},{"location":"reference/photoshop/api/save_options/jpg/#photoshop.api.save_options.jpg.JPEGSaveOptions","text":"Bases: Photoshop Options for saving a document in JPEG format. Source code in photoshop/api/save_options/jpg.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 class JPEGSaveOptions ( Photoshop ): \"\"\"Options for saving a document in JPEG format.\"\"\" object_name = \"JPEGSaveOptions\" def __init__ ( self , quality = 5 , embedColorProfile = True , matte = MatteType . NoMatte ): super () . __init__ () self . quality = quality self . embedColorProfile = embedColorProfile self . matte = matte @property def quality ( self ): return self . app . quality @quality . setter def quality ( self , value ): self . app . quality = value @property def formatOptions ( self ): \"\"\"The download format to use.\"\"\" return self . app . formatOptions @formatOptions . setter def formatOptions ( self , value ): self . app . formatOptions = value @property def embedColorProfile ( self ): return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def matte ( self ): \"\"\"The color to use to fill anti-aliased edges adjacent to transparent\"\"\" return self . app . matte @matte . setter def matte ( self , value ): self . app . matte = value @property def scans ( self ): return self . app . scans @scans . setter def scans ( self , value ): self . app . scans = value","title":"JPEGSaveOptions"},{"location":"reference/photoshop/api/save_options/jpg/#photoshop.api.save_options.jpg.JPEGSaveOptions.formatOptions","text":"The download format to use.","title":"formatOptions"},{"location":"reference/photoshop/api/save_options/jpg/#photoshop.api.save_options.jpg.JPEGSaveOptions.matte","text":"The color to use to fill anti-aliased edges adjacent to transparent","title":"matte"},{"location":"reference/photoshop/api/save_options/pdf/","text":"Options for saving a document in Adobe PDF format. using the Document.saveAs() method. PDFSaveOptions Bases: Photoshop Options for saving a document in PDF format. Source code in photoshop/api/save_options/pdf.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 class PDFSaveOptions ( Photoshop ): \"\"\"Options for saving a document in PDF format.\"\"\" object_name = \"PDFSaveOptions\" def __init__ ( self , ** kwargs ): super () . __init__ () self . layers = False self . jpegQuality = 12 self . alphaChannels = False self . embedThumbnail = True self . view = False self . annotations = True self . colorConversion = False self . convertToEightBit = True self . description = \"No description.\" self . encoding_types = PDFEncodingType self . downSample = PDFResampleType . NoResample self . embedColorProfile = True if kwargs : if \"encoding\" in kwargs : self . encoding = kwargs . get ( \"encoding\" , self . encoding_types . PDFJPEG ) for key , value in kwargs . items (): setattr ( self , key , value ) @property def alphaChannels ( self ): \"\"\"True to save the alpha channels with the file.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): \"\"\"True to save the alpha channels with the file.\"\"\" self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . anotations @annotations . setter def annotations ( self , value ): \"\"\"If true, the annotations are saved.\"\"\" self . app . annotations = value @property def colorConversion ( self ): \"\"\"If true, converts the color profile to the destination profile.\"\"\" return self . app . colorConversion @colorConversion . setter def colorConversion ( self , value ): \"\"\"If true, converts the color profile to the destination profile.\"\"\" self . app . colorConversion = value @property def convertToEightBit ( self ): \"\"\"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.\"\"\" return self . app . convertToEightBit @convertToEightBit . setter def convertToEightBit ( self , value ): \"\"\"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.\"\"\" self . app . convertToEightBit = value @property def description ( self ): \"\"\"Description of the save options in use.\"\"\" return self . app . description @description . setter def description ( self , text ): \"\"\"Description of the save options in use.\"\"\" self . app . description = text @property def destinationProfile ( self ): \"\"\"Describes the final RGB or CMYK output device, such as a monitor or press standard.\"\"\" try : return self . app . destinationProfile except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @destinationProfile . setter def destinationProfile ( self , value ): \"\"\"Describes the final RGB or CMYK output device, such as a monitor or press standard.\"\"\" self . app . destinationProfile = value @property def downSample ( self ): \"\"\"The downsample method to use.\"\"\" return self . app . downSample @downSample . setter def downSample ( self , value ): \"\"\"The downsample method to use.\"\"\" self . app . downSample = value @property def downSampleSize ( self ): \"\"\"The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit.\"\"\" try : return self . app . downSampleSize except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @downSampleSize . setter def downSampleSize ( self , value ): \"\"\"The size (in pixels per inch) to downsample images to if they exceed the value specified for \u2018down sample size limit\u2019.\"\"\" self . app . downSampleSize = value @property def downSampleSizeLimit ( self ): \"\"\"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).\"\"\" try : return self . app . downSampleSizeLimit except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @downSampleSizeLimit . setter def downSampleSizeLimit ( self , value : float ): \"\"\"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).\"\"\" self . app . downSampleSizeLimit = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value : bool ): \"\"\"If true, the color profile is embedded in the document.\"\"\" self . app . embedColorProfile = value @property def embedThumbnail ( self ): \"\"\"If true, includes a small preview image in Acrobat.\"\"\" return self . app . embedThumbnail @embedThumbnail . setter def embedThumbnail ( self , value : bool ): \"\"\"If true, includes a small preview image in Acrobat.\"\"\" self . app . embedThumbnail = value @property def encoding ( self ): \"\"\"The encoding method to use.\"\"\" try : return self . app . encoding except COMError : return self . encoding_types . PDFJPEG @encoding . setter def encoding ( self , value : str ): \"\"\"The encoding method to use.\"\"\" self . app . encoding = value @property def jpegQuality ( self ): \"\"\"Get the quality of the produced image.\"\"\" return self . app . jpegQuality @jpegQuality . setter def jpegQuality ( self , quality : int ): \"\"\"Set the quality of the produced image. Valid only for JPEG-encoded PDF documents. Range: 0 to 12. \"\"\" self . app . jpegQuality = quality @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers @layers . setter def layers ( self , value : bool ): \"\"\"If true, the layers are saved.\"\"\" self . app . layers = value @property def optimizeForWeb ( self ): \"\"\"If true, improves performance of PDFs on Web servers.\"\"\" return self . app . optimizeForWeb @optimizeForWeb . setter def optimizeForWeb ( self , value : bool ): \"\"\"If true, improves performance of PDFs on Web servers.\"\"\" self . app . optimizeForWeb = value @property def outputCondition ( self ): \"\"\"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.\"\"\" return self . app . outputCondition @outputCondition . setter def outputCondition ( self , value ): \"\"\"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.\"\"\" self . app . outputCondition = value @property def outputConditionID ( self ): \"\"\"The identifier for the output condition.\"\"\" try : return self . app . outputConditionID except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @outputConditionID . setter def outputConditionID ( self , value ): \"\"\"The identifier for the output condition.\"\"\" self . app . outputConditionID = value @property def preserveEditing ( self ): \"\"\"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.\"\"\" try : return self . app . preserveEditing except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @preserveEditing . setter def preserveEditing ( self , value ): \"\"\"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.\"\"\" self . app . preserveEditing = value @property def presetFile ( self ): \"\"\"The preset file to use for settings; overrides other settings.\"\"\" try : return self . app . presetFile except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @presetFile . setter def presetFile ( self , file_name ): \"\"\"The preset file to use for settings; overrides other settings.\"\"\" self . app . presetFile = file_name @property def profileInclusionPolicy ( self ): \"\"\"If true, shows which profiles to include.\"\"\" try : return self . app . profileInclusionPolicy except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @profileInclusionPolicy . setter def profileInclusionPolicy ( self , value ): \"\"\"If true, shows which profiles to include.\"\"\" self . app . profileInclusionPolicy = value @property def registryName ( self ): \"\"\"The URL where the output condition is registered.\"\"\" try : return self . app . registryName except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @registryName . setter def registryName ( self , value ): \"\"\"The URL where the output condition is registered.\"\"\" self . app . registryName = value @property def spotColors ( self ): \"\"\"If true, the spot colors are saved.\"\"\" try : return self . app . spotColors except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @spotColors . setter def spotColors ( self , value ): \"\"\"If true, the spot colors are saved.\"\"\" self . app . spotColors = value @property def tileSize ( self ): \"\"\"The compression option. Valid only when encoding is JPEG2000.\"\"\" try : return self . app . tileSize except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @tileSize . setter def tileSize ( self , value ): \"\"\"The compression option. Valid only when encoding is JPEG2000.\"\"\" if self . encoding not in ( self . encoding_types . PDFJPEG2000HIGH , self . encoding_types . PDFJPEG2000LOSSLESS , self . encoding_types . PDFJPEG2000MED , self . encoding_types . PDFJPEG2000MEDLOW , self . encoding_types . PDFJPEG2000LOW , self . encoding_types . PDFJPEG2000MEDHIGH , ): raise ValueError ( \"tileSize only work in JPEG2000. Please \" \"change PDFSaveOptions.encoding to JPEG2000.\" ) self . app . tileSize = value @property def view ( self ): \"\"\"If true, opens the saved PDF in Acrobat.\"\"\" return self . app . view @view . setter def view ( self , value ): \"\"\"If true, opens the saved PDF in Acrobat.\"\"\" self . app . view = value alphaChannels property writable True to save the alpha channels with the file. annotations property writable If true, the annotations are saved. colorConversion property writable If true, converts the color profile to the destination profile. convertToEightBit property writable If true, converts a 16-bit image to 8-bit for better compatibility with other applications. description property writable Description of the save options in use. destinationProfile property writable Describes the final RGB or CMYK output device, such as a monitor or press standard. downSample property writable The downsample method to use. downSampleSize property writable The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit. downSampleSizeLimit property writable Limits downsampling or subsampling to images that exceed this value (in pixels per inch). embedColorProfile property writable If true, the color profile is embedded in the document. embedThumbnail property writable If true, includes a small preview image in Acrobat. encoding property writable The encoding method to use. jpegQuality property writable Get the quality of the produced image. layers property writable If true, the layers are saved. optimizeForWeb property writable If true, improves performance of PDFs on Web servers. outputCondition property writable An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file. outputConditionID property writable The identifier for the output condition. preserveEditing property writable If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact. presetFile property writable The preset file to use for settings; overrides other settings. profileInclusionPolicy property writable If true, shows which profiles to include. registryName property writable The URL where the output condition is registered. spotColors property writable If true, the spot colors are saved. tileSize property writable The compression option. Valid only when encoding is JPEG2000. view property writable If true, opens the saved PDF in Acrobat.","title":"pdf"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions","text":"Bases: Photoshop Options for saving a document in PDF format. Source code in photoshop/api/save_options/pdf.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 class PDFSaveOptions ( Photoshop ): \"\"\"Options for saving a document in PDF format.\"\"\" object_name = \"PDFSaveOptions\" def __init__ ( self , ** kwargs ): super () . __init__ () self . layers = False self . jpegQuality = 12 self . alphaChannels = False self . embedThumbnail = True self . view = False self . annotations = True self . colorConversion = False self . convertToEightBit = True self . description = \"No description.\" self . encoding_types = PDFEncodingType self . downSample = PDFResampleType . NoResample self . embedColorProfile = True if kwargs : if \"encoding\" in kwargs : self . encoding = kwargs . get ( \"encoding\" , self . encoding_types . PDFJPEG ) for key , value in kwargs . items (): setattr ( self , key , value ) @property def alphaChannels ( self ): \"\"\"True to save the alpha channels with the file.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): \"\"\"True to save the alpha channels with the file.\"\"\" self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . anotations @annotations . setter def annotations ( self , value ): \"\"\"If true, the annotations are saved.\"\"\" self . app . annotations = value @property def colorConversion ( self ): \"\"\"If true, converts the color profile to the destination profile.\"\"\" return self . app . colorConversion @colorConversion . setter def colorConversion ( self , value ): \"\"\"If true, converts the color profile to the destination profile.\"\"\" self . app . colorConversion = value @property def convertToEightBit ( self ): \"\"\"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.\"\"\" return self . app . convertToEightBit @convertToEightBit . setter def convertToEightBit ( self , value ): \"\"\"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.\"\"\" self . app . convertToEightBit = value @property def description ( self ): \"\"\"Description of the save options in use.\"\"\" return self . app . description @description . setter def description ( self , text ): \"\"\"Description of the save options in use.\"\"\" self . app . description = text @property def destinationProfile ( self ): \"\"\"Describes the final RGB or CMYK output device, such as a monitor or press standard.\"\"\" try : return self . app . destinationProfile except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @destinationProfile . setter def destinationProfile ( self , value ): \"\"\"Describes the final RGB or CMYK output device, such as a monitor or press standard.\"\"\" self . app . destinationProfile = value @property def downSample ( self ): \"\"\"The downsample method to use.\"\"\" return self . app . downSample @downSample . setter def downSample ( self , value ): \"\"\"The downsample method to use.\"\"\" self . app . downSample = value @property def downSampleSize ( self ): \"\"\"The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit.\"\"\" try : return self . app . downSampleSize except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @downSampleSize . setter def downSampleSize ( self , value ): \"\"\"The size (in pixels per inch) to downsample images to if they exceed the value specified for \u2018down sample size limit\u2019.\"\"\" self . app . downSampleSize = value @property def downSampleSizeLimit ( self ): \"\"\"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).\"\"\" try : return self . app . downSampleSizeLimit except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @downSampleSizeLimit . setter def downSampleSizeLimit ( self , value : float ): \"\"\"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).\"\"\" self . app . downSampleSizeLimit = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value : bool ): \"\"\"If true, the color profile is embedded in the document.\"\"\" self . app . embedColorProfile = value @property def embedThumbnail ( self ): \"\"\"If true, includes a small preview image in Acrobat.\"\"\" return self . app . embedThumbnail @embedThumbnail . setter def embedThumbnail ( self , value : bool ): \"\"\"If true, includes a small preview image in Acrobat.\"\"\" self . app . embedThumbnail = value @property def encoding ( self ): \"\"\"The encoding method to use.\"\"\" try : return self . app . encoding except COMError : return self . encoding_types . PDFJPEG @encoding . setter def encoding ( self , value : str ): \"\"\"The encoding method to use.\"\"\" self . app . encoding = value @property def jpegQuality ( self ): \"\"\"Get the quality of the produced image.\"\"\" return self . app . jpegQuality @jpegQuality . setter def jpegQuality ( self , quality : int ): \"\"\"Set the quality of the produced image. Valid only for JPEG-encoded PDF documents. Range: 0 to 12. \"\"\" self . app . jpegQuality = quality @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers @layers . setter def layers ( self , value : bool ): \"\"\"If true, the layers are saved.\"\"\" self . app . layers = value @property def optimizeForWeb ( self ): \"\"\"If true, improves performance of PDFs on Web servers.\"\"\" return self . app . optimizeForWeb @optimizeForWeb . setter def optimizeForWeb ( self , value : bool ): \"\"\"If true, improves performance of PDFs on Web servers.\"\"\" self . app . optimizeForWeb = value @property def outputCondition ( self ): \"\"\"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.\"\"\" return self . app . outputCondition @outputCondition . setter def outputCondition ( self , value ): \"\"\"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.\"\"\" self . app . outputCondition = value @property def outputConditionID ( self ): \"\"\"The identifier for the output condition.\"\"\" try : return self . app . outputConditionID except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @outputConditionID . setter def outputConditionID ( self , value ): \"\"\"The identifier for the output condition.\"\"\" self . app . outputConditionID = value @property def preserveEditing ( self ): \"\"\"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.\"\"\" try : return self . app . preserveEditing except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @preserveEditing . setter def preserveEditing ( self , value ): \"\"\"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.\"\"\" self . app . preserveEditing = value @property def presetFile ( self ): \"\"\"The preset file to use for settings; overrides other settings.\"\"\" try : return self . app . presetFile except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @presetFile . setter def presetFile ( self , file_name ): \"\"\"The preset file to use for settings; overrides other settings.\"\"\" self . app . presetFile = file_name @property def profileInclusionPolicy ( self ): \"\"\"If true, shows which profiles to include.\"\"\" try : return self . app . profileInclusionPolicy except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @profileInclusionPolicy . setter def profileInclusionPolicy ( self , value ): \"\"\"If true, shows which profiles to include.\"\"\" self . app . profileInclusionPolicy = value @property def registryName ( self ): \"\"\"The URL where the output condition is registered.\"\"\" try : return self . app . registryName except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @registryName . setter def registryName ( self , value ): \"\"\"The URL where the output condition is registered.\"\"\" self . app . registryName = value @property def spotColors ( self ): \"\"\"If true, the spot colors are saved.\"\"\" try : return self . app . spotColors except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @spotColors . setter def spotColors ( self , value ): \"\"\"If true, the spot colors are saved.\"\"\" self . app . spotColors = value @property def tileSize ( self ): \"\"\"The compression option. Valid only when encoding is JPEG2000.\"\"\" try : return self . app . tileSize except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @tileSize . setter def tileSize ( self , value ): \"\"\"The compression option. Valid only when encoding is JPEG2000.\"\"\" if self . encoding not in ( self . encoding_types . PDFJPEG2000HIGH , self . encoding_types . PDFJPEG2000LOSSLESS , self . encoding_types . PDFJPEG2000MED , self . encoding_types . PDFJPEG2000MEDLOW , self . encoding_types . PDFJPEG2000LOW , self . encoding_types . PDFJPEG2000MEDHIGH , ): raise ValueError ( \"tileSize only work in JPEG2000. Please \" \"change PDFSaveOptions.encoding to JPEG2000.\" ) self . app . tileSize = value @property def view ( self ): \"\"\"If true, opens the saved PDF in Acrobat.\"\"\" return self . app . view @view . setter def view ( self , value ): \"\"\"If true, opens the saved PDF in Acrobat.\"\"\" self . app . view = value","title":"PDFSaveOptions"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.alphaChannels","text":"True to save the alpha channels with the file.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.annotations","text":"If true, the annotations are saved.","title":"annotations"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.colorConversion","text":"If true, converts the color profile to the destination profile.","title":"colorConversion"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.convertToEightBit","text":"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.","title":"convertToEightBit"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.description","text":"Description of the save options in use.","title":"description"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.destinationProfile","text":"Describes the final RGB or CMYK output device, such as a monitor or press standard.","title":"destinationProfile"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.downSample","text":"The downsample method to use.","title":"downSample"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.downSampleSize","text":"The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit.","title":"downSampleSize"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.downSampleSizeLimit","text":"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).","title":"downSampleSizeLimit"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.embedColorProfile","text":"If true, the color profile is embedded in the document.","title":"embedColorProfile"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.embedThumbnail","text":"If true, includes a small preview image in Acrobat.","title":"embedThumbnail"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.encoding","text":"The encoding method to use.","title":"encoding"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.jpegQuality","text":"Get the quality of the produced image.","title":"jpegQuality"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.layers","text":"If true, the layers are saved.","title":"layers"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.optimizeForWeb","text":"If true, improves performance of PDFs on Web servers.","title":"optimizeForWeb"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.outputCondition","text":"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.","title":"outputCondition"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.outputConditionID","text":"The identifier for the output condition.","title":"outputConditionID"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.preserveEditing","text":"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.","title":"preserveEditing"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.presetFile","text":"The preset file to use for settings; overrides other settings.","title":"presetFile"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.profileInclusionPolicy","text":"If true, shows which profiles to include.","title":"profileInclusionPolicy"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.registryName","text":"The URL where the output condition is registered.","title":"registryName"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.spotColors","text":"If true, the spot colors are saved.","title":"spotColors"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.tileSize","text":"The compression option. Valid only when encoding is JPEG2000.","title":"tileSize"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.view","text":"If true, opens the saved PDF in Acrobat.","title":"view"},{"location":"reference/photoshop/api/save_options/png/","text":"ExportOptionsSaveForWeb Bases: Photoshop Options for exporting Save For Web files. Source code in photoshop/api/save_options/png.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 class ExportOptionsSaveForWeb ( Photoshop ): \"\"\"Options for exporting Save For Web files.\"\"\" object_name = \"ExportOptionsSaveForWeb\" def __init__ ( self ): super () . __init__ () self . format = 13 # PNG self . PNG8 = False # Sets it to PNG-24 bit @property def PNG8 ( self ) -> bool : \"\"\"If true, uses 8 bits. If false, uses 24 bits. Valid only when \u2018format\u2019 = PNG.\"\"\" return self . app . PNG8 @PNG8 . setter def PNG8 ( self , value : bool ): self . app . PNG8 = value @property def blur ( self ) -> float : \"\"\"Applies blur to the image to reduce artifacts.\"\"\" return self . app . blur @blur . setter def blur ( self , value : float ): self . app . blur = value @property def colorReduction ( self ) -> ColorReductionType : \"\"\"The color reduction algorithm.\"\"\" return self . app . colorReduction @colorReduction . setter def colorReduction ( self , value : ColorReductionType ): self . app . colorReduction = value @property def colors ( self ) -> int : \"\"\"The number of colors in the palette.\"\"\" return self . app . colors @colors . setter def colors ( self , value : int ): self . app . colors = value @property def dither ( self ) -> DitherType : \"\"\"The type of dither to use.\"\"\" return self . app . dither @dither . setter def dither ( self , value : DitherType ): self . app . dither = value @property def quality ( self ) -> int : \"\"\"The quality of the output image, from 0 to 100.\"\"\" return self . app . quality @quality . setter def quality ( self , value : int ): self . app . quality = value PNG8 : bool property writable If true, uses 8 bits. If false, uses 24 bits. Valid only when \u2018format\u2019 = PNG. blur : float property writable Applies blur to the image to reduce artifacts. colorReduction : ColorReductionType property writable The color reduction algorithm. colors : int property writable The number of colors in the palette. dither : DitherType property writable The type of dither to use. quality : int property writable The quality of the output image, from 0 to 100. PNGSaveOptions Bases: Photoshop Options for saving file as PNG. Source code in photoshop/api/save_options/png.py 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 class PNGSaveOptions ( Photoshop ): \"\"\"Options for saving file as PNG.\"\"\" object_name = \"PNGSaveOptions\" def __init__ ( self , interlaced : bool = False , compression : int = 6 ): super () . __init__ () self . interlaced = interlaced self . compression = compression @property def interlaced ( self ) -> bool : return self . app . interlaced @interlaced . setter def interlaced ( self , value : bool ): self . app . interlaced = value @property def compression ( self ) -> int : return self . app . compression @compression . setter def compression ( self , value : int ): self . app . compression = value","title":"png"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb","text":"Bases: Photoshop Options for exporting Save For Web files. Source code in photoshop/api/save_options/png.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 class ExportOptionsSaveForWeb ( Photoshop ): \"\"\"Options for exporting Save For Web files.\"\"\" object_name = \"ExportOptionsSaveForWeb\" def __init__ ( self ): super () . __init__ () self . format = 13 # PNG self . PNG8 = False # Sets it to PNG-24 bit @property def PNG8 ( self ) -> bool : \"\"\"If true, uses 8 bits. If false, uses 24 bits. Valid only when \u2018format\u2019 = PNG.\"\"\" return self . app . PNG8 @PNG8 . setter def PNG8 ( self , value : bool ): self . app . PNG8 = value @property def blur ( self ) -> float : \"\"\"Applies blur to the image to reduce artifacts.\"\"\" return self . app . blur @blur . setter def blur ( self , value : float ): self . app . blur = value @property def colorReduction ( self ) -> ColorReductionType : \"\"\"The color reduction algorithm.\"\"\" return self . app . colorReduction @colorReduction . setter def colorReduction ( self , value : ColorReductionType ): self . app . colorReduction = value @property def colors ( self ) -> int : \"\"\"The number of colors in the palette.\"\"\" return self . app . colors @colors . setter def colors ( self , value : int ): self . app . colors = value @property def dither ( self ) -> DitherType : \"\"\"The type of dither to use.\"\"\" return self . app . dither @dither . setter def dither ( self , value : DitherType ): self . app . dither = value @property def quality ( self ) -> int : \"\"\"The quality of the output image, from 0 to 100.\"\"\" return self . app . quality @quality . setter def quality ( self , value : int ): self . app . quality = value","title":"ExportOptionsSaveForWeb"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.PNG8","text":"If true, uses 8 bits. If false, uses 24 bits. Valid only when \u2018format\u2019 = PNG.","title":"PNG8"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.blur","text":"Applies blur to the image to reduce artifacts.","title":"blur"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.colorReduction","text":"The color reduction algorithm.","title":"colorReduction"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.colors","text":"The number of colors in the palette.","title":"colors"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.dither","text":"The type of dither to use.","title":"dither"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.quality","text":"The quality of the output image, from 0 to 100.","title":"quality"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.PNGSaveOptions","text":"Bases: Photoshop Options for saving file as PNG. Source code in photoshop/api/save_options/png.py 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 class PNGSaveOptions ( Photoshop ): \"\"\"Options for saving file as PNG.\"\"\" object_name = \"PNGSaveOptions\" def __init__ ( self , interlaced : bool = False , compression : int = 6 ): super () . __init__ () self . interlaced = interlaced self . compression = compression @property def interlaced ( self ) -> bool : return self . app . interlaced @interlaced . setter def interlaced ( self , value : bool ): self . app . interlaced = value @property def compression ( self ) -> int : return self . app . compression @compression . setter def compression ( self , value : int ): self . app . compression = value","title":"PNGSaveOptions"},{"location":"reference/photoshop/api/save_options/psd/","text":"PhotoshopSaveOptions Bases: Photoshop Options for saving a Photoshop document. Source code in photoshop/api/save_options/psd.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class PhotoshopSaveOptions ( Photoshop ): \"\"\"Options for saving a Photoshop document.\"\"\" object_name = \"PhotoshopSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels () @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . annotations () @annotations . setter def annotations ( self , value ): self . app . annotations = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile () @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers () @layers . setter def layers ( self , value ): self . app . layers = value @property def spotColors ( self ): \"\"\"If true, spot colors are saved.\"\"\" return self . app . spotColors () @spotColors . setter def spotColors ( self , value ): self . app . spotColors = value alphaChannels property writable If true, the alpha channels are saved. annotations property writable If true, the annotations are saved. embedColorProfile property writable If true, the color profile is embedded in the document. layers property writable If true, the layers are saved. spotColors property writable If true, spot colors are saved.","title":"psd"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions","text":"Bases: Photoshop Options for saving a Photoshop document. Source code in photoshop/api/save_options/psd.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class PhotoshopSaveOptions ( Photoshop ): \"\"\"Options for saving a Photoshop document.\"\"\" object_name = \"PhotoshopSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels () @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . annotations () @annotations . setter def annotations ( self , value ): self . app . annotations = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile () @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers () @layers . setter def layers ( self , value ): self . app . layers = value @property def spotColors ( self ): \"\"\"If true, spot colors are saved.\"\"\" return self . app . spotColors () @spotColors . setter def spotColors ( self , value ): self . app . spotColors = value","title":"PhotoshopSaveOptions"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.alphaChannels","text":"If true, the alpha channels are saved.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.annotations","text":"If true, the annotations are saved.","title":"annotations"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.embedColorProfile","text":"If true, the color profile is embedded in the document.","title":"embedColorProfile"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.layers","text":"If true, the layers are saved.","title":"layers"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.spotColors","text":"If true, spot colors are saved.","title":"spotColors"},{"location":"reference/photoshop/api/save_options/tag/","text":"TargaSaveOptions Bases: Photoshop Options for saving a document in TGA (Targa) format. Source code in photoshop/api/save_options/tag.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 class TargaSaveOptions ( Photoshop ): \"\"\"Options for saving a document in TGA (Targa) format.\"\"\" object_name = \"TargaSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def resolution ( self ): return self . app . resolution @resolution . setter def resolution ( self , value : TargaBitsPerPixels = TargaBitsPerPixels . Targa24Bits ): self . app . resolution = value @property def rleCompression ( self ): return self . app . rleCompression @rleCompression . setter def rleCompression ( self , value ): self . app . rleCompression = value alphaChannels property writable If true, the alpha channels are saved.","title":"tag"},{"location":"reference/photoshop/api/save_options/tag/#photoshop.api.save_options.tag.TargaSaveOptions","text":"Bases: Photoshop Options for saving a document in TGA (Targa) format. Source code in photoshop/api/save_options/tag.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 class TargaSaveOptions ( Photoshop ): \"\"\"Options for saving a document in TGA (Targa) format.\"\"\" object_name = \"TargaSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def resolution ( self ): return self . app . resolution @resolution . setter def resolution ( self , value : TargaBitsPerPixels = TargaBitsPerPixels . Targa24Bits ): self . app . resolution = value @property def rleCompression ( self ): return self . app . rleCompression @rleCompression . setter def rleCompression ( self , value ): self . app . rleCompression = value","title":"TargaSaveOptions"},{"location":"reference/photoshop/api/save_options/tag/#photoshop.api.save_options.tag.TargaSaveOptions.alphaChannels","text":"If true, the alpha channels are saved.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/tif/","text":"TiffSaveOptions Bases: Photoshop Options for saving a document in TIFF format. Source code in photoshop/api/save_options/tif.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 class TiffSaveOptions ( Photoshop ): \"\"\"Options for saving a document in TIFF format.\"\"\" object_name = \"TiffSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . annotations @annotations . setter def annotations ( self , value ): self . app . annotations = value @property def byteOrder ( self ): \"\"\"The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows. \"\"\" return self . app . byteOrder @byteOrder . setter def byteOrder ( self , value ): self . app . byteOrder = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def imageCompression ( self ): \"\"\"The compression type.\"\"\" return self . app . imageCompression @imageCompression . setter def imageCompression ( self , value ): self . app . imageCompression = value @property def interleaveChannels ( self ): \"\"\"If true, the channels in the image are interleaved.\"\"\" return self . app . interleaveChannels @interleaveChannels . setter def interleaveChannels ( self , value ): self . app . interleaveChannels = value @property def jpegQuality ( self ): \"\"\"The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12. \"\"\" return self . app . jpegQuality @jpegQuality . setter def jpegQuality ( self , value ): self . app . jpegQuality = value @property def layerCompression ( self ): return self . app . layerCompression @layerCompression . setter def layerCompression ( self , value ): \"\"\"The method of compression to use when saving layers (as opposed to saving composite data). Valid only when `layers` = true. \"\"\" self . app . layerCompression = value @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers @layers . setter def layers ( self , value ): self . app . layers = value @property def saveImagePyramid ( self ): \"\"\"If true, preserves multi-resolution information.\"\"\" return self . app . saveImagePyramid @saveImagePyramid . setter def saveImagePyramid ( self , value ): self . app . saveImagePyramid = value @property def spotColors ( self ): \"\"\"If true, spot colors are saved.\"\"\" return self . app . spotColors @spotColors . setter def spotColors ( self , value ): self . app . spotColors = value @property def transparency ( self ): return self . app . transparency @transparency . setter def transparency ( self , value ): \"\"\"If true, saves the transparency as an additional alpha channel when the file is opened in another application.\"\"\" self . app . transparency = value alphaChannels property writable If true, the alpha channels are saved. annotations property writable If true, the annotations are saved. byteOrder property writable The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows. embedColorProfile property writable If true, the color profile is embedded in the document. imageCompression property writable The compression type. interleaveChannels property writable If true, the channels in the image are interleaved. jpegQuality property writable The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12. layers property writable If true, the layers are saved. saveImagePyramid property writable If true, preserves multi-resolution information. spotColors property writable If true, spot colors are saved.","title":"tif"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions","text":"Bases: Photoshop Options for saving a document in TIFF format. Source code in photoshop/api/save_options/tif.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 class TiffSaveOptions ( Photoshop ): \"\"\"Options for saving a document in TIFF format.\"\"\" object_name = \"TiffSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . annotations @annotations . setter def annotations ( self , value ): self . app . annotations = value @property def byteOrder ( self ): \"\"\"The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows. \"\"\" return self . app . byteOrder @byteOrder . setter def byteOrder ( self , value ): self . app . byteOrder = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def imageCompression ( self ): \"\"\"The compression type.\"\"\" return self . app . imageCompression @imageCompression . setter def imageCompression ( self , value ): self . app . imageCompression = value @property def interleaveChannels ( self ): \"\"\"If true, the channels in the image are interleaved.\"\"\" return self . app . interleaveChannels @interleaveChannels . setter def interleaveChannels ( self , value ): self . app . interleaveChannels = value @property def jpegQuality ( self ): \"\"\"The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12. \"\"\" return self . app . jpegQuality @jpegQuality . setter def jpegQuality ( self , value ): self . app . jpegQuality = value @property def layerCompression ( self ): return self . app . layerCompression @layerCompression . setter def layerCompression ( self , value ): \"\"\"The method of compression to use when saving layers (as opposed to saving composite data). Valid only when `layers` = true. \"\"\" self . app . layerCompression = value @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers @layers . setter def layers ( self , value ): self . app . layers = value @property def saveImagePyramid ( self ): \"\"\"If true, preserves multi-resolution information.\"\"\" return self . app . saveImagePyramid @saveImagePyramid . setter def saveImagePyramid ( self , value ): self . app . saveImagePyramid = value @property def spotColors ( self ): \"\"\"If true, spot colors are saved.\"\"\" return self . app . spotColors @spotColors . setter def spotColors ( self , value ): self . app . spotColors = value @property def transparency ( self ): return self . app . transparency @transparency . setter def transparency ( self , value ): \"\"\"If true, saves the transparency as an additional alpha channel when the file is opened in another application.\"\"\" self . app . transparency = value","title":"TiffSaveOptions"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.alphaChannels","text":"If true, the alpha channels are saved.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.annotations","text":"If true, the annotations are saved.","title":"annotations"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.byteOrder","text":"The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows.","title":"byteOrder"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.embedColorProfile","text":"If true, the color profile is embedded in the document.","title":"embedColorProfile"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.imageCompression","text":"The compression type.","title":"imageCompression"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.interleaveChannels","text":"If true, the channels in the image are interleaved.","title":"interleaveChannels"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.jpegQuality","text":"The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12.","title":"jpegQuality"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.layers","text":"If true, the layers are saved.","title":"layers"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.saveImagePyramid","text":"If true, preserves multi-resolution information.","title":"saveImagePyramid"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.spotColors","text":"If true, spot colors are saved.","title":"spotColors"}]} \ No newline at end of file +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](..#contributors-) Python API for Photoshop. The example above was created with Photoshop Python API. Check it out at https://loonghao.github.io/photoshop-python-api/examples . Has been tested and used Photoshop version: Photoshop Version Supported 2023 \u2705 2022 \u2705 2021 \u2705 2020 \u2705 cc2019 \u2705 cc2018 \u2705 cc2017 \u2705 Installing You can install via pip. pip install photoshop_python_api Since it uses COM (Component Object Model) connect Photoshop, it can be used in any DCC software with a python interpreter. Hello World import photoshop.api as ps app = ps . Application () doc = app . documents . add () new_doc = doc . artLayers . add () text_color = ps . SolidColor () text_color . rgb . red = 0 text_color . rgb . green = 255 text_color . rgb . blue = 0 new_text_layer = new_doc new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) # # save to jpg jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' ) Photoshop Session Use it as context. from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) ps . app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' ) Contributors \u2728 Thanks goes to these wonderful people ( emoji key ): Hal \ud83d\udcbb voodraizer \ud83d\udc1b brunosly \ud83d\udc1b tubi \ud83d\udc1b wjxiehaixin \ud83d\udc1b \u7f57\u9a6c\u949f \ud83d\udc1b clement \ud83d\udc1b krevlinmen \ud83d\udc1b Thomas \ud83d\udc1b CaptainCsaba \ud83d\udc1b Il Harper \ud83d\udcbb blunderedbishop \ud83d\udc1b MrTeferi \ud83d\udcbb Damien Chambe \ud83d\udcbb Ehsan Akbari Tabar \ud83d\udc1b Michael Ikemann \ud83d\udc1b Enguerrand DE SMET \ud83d\udcbb Proton \ud83d\udcbb This project follows the all-contributors specification. Contributions of any kind are welcome! Repobeats analytics how to get Photoshop program ID PS> Get-ChildItem \"HKLM:\\SOFTWARE\\Classes\" | ?{ ($_.PSChildName -match \"^[a-z]+\\.[a-z]+(\\.\\d+)?$\") -and ($_.GetSubKeyNames() -contains \"CLSID\") } | ?{ $_.PSChildName -match \"Photoshop.Application\" } | ft PSChildName How to get a list of COM objects from the registry Useful links https://theiviaxx.github.io/photoshop-docs/Photoshop/ http://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref-2015.pdf https://github.com/lohriialo/photoshop-scripting-python https://www.adobe.com/devnet/photoshop/scripting.html https://www.youtube.com/playlist?list=PLUEniN8BpU8-Qmjyv3zyWaNvDYwJOJZ4m http://yearbook.github.io/esdocs/#/Photoshop/Application http://www.shining-lucy.com/wiki/page.php?id=appwiki:photoshop:ps_script http://www.tonton-pixel.com/wp-content/uploads/DecisionTable.pdf http://jongware.mit.edu/pscs5js_html/psjscs5/pc_Application.html https://indd.adobe.com/view/a0207571-ff5b-4bbf-a540-07079bd21d75 http://shining-lucy.com/wiki/page.php?id=appwiki:photoshop:ps_script http://web.archive.org/web/20140121053819/http://www.pcpix.com/Photoshop/char.html http://www.tonton-pixel.com/scripts/utility-scripts/get-equivalent-id-code/index.html https://github.com/Adobe-CEP/Samples/tree/master/PhotoshopEvents https://evanmccall.wordpress.com/2015/03/09/how-to-develop-photoshop-tools-in-python","title":"Overview"},{"location":"#installing","text":"You can install via pip. pip install photoshop_python_api Since it uses COM (Component Object Model) connect Photoshop, it can be used in any DCC software with a python interpreter.","title":"Installing"},{"location":"#hello-world","text":"import photoshop.api as ps app = ps . Application () doc = app . documents . add () new_doc = doc . artLayers . add () text_color = ps . SolidColor () text_color . rgb . red = 0 text_color . rgb . green = 255 text_color . rgb . blue = 0 new_text_layer = new_doc new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) # # save to jpg jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' )","title":"Hello World"},{"location":"#photoshop-session","text":"Use it as context. from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) ps . app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' )","title":"Photoshop Session"},{"location":"#contributors","text":"Thanks goes to these wonderful people ( emoji key ): Hal \ud83d\udcbb voodraizer \ud83d\udc1b brunosly \ud83d\udc1b tubi \ud83d\udc1b wjxiehaixin \ud83d\udc1b \u7f57\u9a6c\u949f \ud83d\udc1b clement \ud83d\udc1b krevlinmen \ud83d\udc1b Thomas \ud83d\udc1b CaptainCsaba \ud83d\udc1b Il Harper \ud83d\udcbb blunderedbishop \ud83d\udc1b MrTeferi \ud83d\udcbb Damien Chambe \ud83d\udcbb Ehsan Akbari Tabar \ud83d\udc1b Michael Ikemann \ud83d\udc1b Enguerrand DE SMET \ud83d\udcbb Proton \ud83d\udcbb This project follows the all-contributors specification. Contributions of any kind are welcome!","title":"Contributors \u2728"},{"location":"#repobeats-analytics","text":"","title":"Repobeats analytics"},{"location":"#how-to-get-photoshop-program-id","text":"PS> Get-ChildItem \"HKLM:\\SOFTWARE\\Classes\" | ?{ ($_.PSChildName -match \"^[a-z]+\\.[a-z]+(\\.\\d+)?$\") -and ($_.GetSubKeyNames() -contains \"CLSID\") } | ?{ $_.PSChildName -match \"Photoshop.Application\" } | ft PSChildName How to get a list of COM objects from the registry","title":"how to get Photoshop program ID"},{"location":"#useful-links","text":"https://theiviaxx.github.io/photoshop-docs/Photoshop/ http://wwwimages.adobe.com/www.adobe.com/content/dam/acom/en/devnet/photoshop/pdfs/photoshop-cc-javascript-ref-2015.pdf https://github.com/lohriialo/photoshop-scripting-python https://www.adobe.com/devnet/photoshop/scripting.html https://www.youtube.com/playlist?list=PLUEniN8BpU8-Qmjyv3zyWaNvDYwJOJZ4m http://yearbook.github.io/esdocs/#/Photoshop/Application http://www.shining-lucy.com/wiki/page.php?id=appwiki:photoshop:ps_script http://www.tonton-pixel.com/wp-content/uploads/DecisionTable.pdf http://jongware.mit.edu/pscs5js_html/psjscs5/pc_Application.html https://indd.adobe.com/view/a0207571-ff5b-4bbf-a540-07079bd21d75 http://shining-lucy.com/wiki/page.php?id=appwiki:photoshop:ps_script http://web.archive.org/web/20140121053819/http://www.pcpix.com/Photoshop/char.html http://www.tonton-pixel.com/scripts/utility-scripts/get-equivalent-id-code/index.html https://github.com/Adobe-CEP/Samples/tree/master/PhotoshopEvents https://evanmccall.wordpress.com/2015/03/09/how-to-develop-photoshop-tools-in-python","title":"Useful links"},{"location":"changelog/","text":"v0.22.2 (2023-11-08) Fix workflows : Add quotes to prevent 3.10 being interpretted as 3.1 typing : Replace list with List as Python <= 3.8 does not support subscriptable types Refactor Photoshop : Remove unnecessary exception type from suppress Application : Fix incorrect docstring for app.purge, allow Path objects for app.load, wrap colorSettings exceptions Photoshop : Restructure the sequence of events attempting to initialize a valid Dispatch object v0.22.1 (2023-09-22) Refactor TextFonts : Add support for method 'get' and operator 'in' v0.22.0 (2023-09-18) Feat Explicitly flag COM methods Fix formatting and linting comtypes does not play well with hasattr v0.21.10 (2023-09-14) Fix fix auto bump version fix can't set attribute activeHistoryState v0.21.9 (2023-08-31) Fix constants : Update PHOTOSHOP_VERSION_MAPPINGS to add 2024 release mapping (v24/180.0) v0.21.8 (2023-08-22) Fix deps : update dependency wheel to v0.41.2 v0.21.7 (2023-08-17) Fix deps : update dependency wheel to ^0.41.0 v0.21.6 (2023-08-17) Fix test_imports.py : Include root in install lines import-test.yml : Try an alternate approach with multiple poetry install retries import-test.yml : Correct typo in poetry version string import-test.yml : Revert to <= poetry 1.5.0 to fix \"Import Test\" workflow import-test.yml : Attempt to update lock to prevent inconsitent poetry.lock and pyproject.toml import-test : Attempt to fix poetry bug in \"Import Test\" workflow deps : Attempt to fix failing \"Import Test\" workflow Refactor TextFonts : Implement getitem to allow lookup by postScriptName v0.21.5 (2023-07-02) Fix fix paste contents of the clipboard v0.21.4 (2023-06-13) Fix LayerSets : Fix infinite recursion when trying to access LayerSets as a list Refactor Photoshop : Attempt to get running Photoshop application before spawning new one v0.21.3 (2023-05-18) Fix deps : update dependency wheel to ^0.40.0 v0.21.2 (2023-05-17) Refactor artLayers,layerSets : Refactored getitem to work like a dictionary key on LayerSets. Added type hinting and try/except to getitem for both ArtLayers and LayerSets v0.21.1 (2023-02-14) Refactor update constants for support Photoshop 2023 v0.21.0 (2023-01-06) Feat png.py : Add optional args to PNGSaveOptions v0.20.1 (2022-11-28) Refactor action_descriptor : Fix type hints for doubles v0.20.0 (2022-11-26) Feat add a new option for create batch v0.19.7 (2022-11-14) Fix deps : update dependency wheel to ^0.38.0 v0.19.6 (2022-11-06) Refactor update constants for support Photoshop 2022 v0.19.5 (2022-07-17) Refactor application : add a default value of action v0.19.4 (2022-07-10) Fix get document by document name from documents. v0.19.3 (2022-06-17) Fix fix import EPSSaveOptions v0.19.2 (2022-06-14) Refactor session.py : add EPS save options v0.19.1 (2022-05-29) Fix document : export document png : exported PNG image is too large v0.19.0 (2022-05-20) Fix ArtLayer,-LayerSet : adjusted linkedLayers property, fixed remove() Feat ArtLayer : added linkedLayers and opacity, fixed unlink v0.18.1 (2022-04-17) Refactor ActionList : Added ActionList to init and Session to make ActionList callable from Application or Session object v0.18.0 (2022-04-04) Fix fix export document Feat add new function to convert as javascript v0.17.7 (2022-03-20) Fix deps : update dependency wheel to ^0.37.0 v0.17.6 (2022-03-19) Refactor improve type hints Fix add ArtLayer instance return when duplicate layer v0.17.5 (2022-03-13) Fix update ci config and re-tag v0.17.4 (2022-03-13) Perf add more docstrings v0.17.3 (2022-03-13) Perf add more docstrings v0.17.2 (2022-03-13) Perf improve docs Fix retag and update ci Refactor improve getByName from artLayers and layers v0.17.1 (2022-03-12) Refactor improve docs v0.17.0 (2021-09-21) Feat Update the logic of searching the installation path of Photoshop through the registration v0.16.3 (2021-09-12) Fix add 2021 to version mappings v0.16.2 (2021-08-15) Fix api/text_item.py : missing width.setter for paragraphtext in text_item.py v0.16.1 (2021-07-04) Fix fix install failed in python-3.9 v0.16.0 (2021-05-29) Feat documents : support get document by index v0.15.2 (2021-05-29) Refactor use absolute path imports use absolute path imports 0.15.1 (2021-02-03) 0.15.0 (2021-01-10) 0.14.0 (2020-10-22) 0.13.0 (2020-09-23) 0.12.1 (2020-09-13) 0.12.0 (2020-05-10) 0.11.0 (2020-05-07) 0.10.0 (2020-04-22) 0.9.0 (2020-04-09) 0.8.0 (2020-04-08) 0.7.2 (2020-04-01) 0.3.0 (2020-02-24) 0.2.1 (2020-02-17)","title":"Changelog"},{"location":"changelog/#v0222-2023-11-08","text":"","title":"v0.22.2 (2023-11-08)"},{"location":"changelog/#fix","text":"workflows : Add quotes to prevent 3.10 being interpretted as 3.1 typing : Replace list with List as Python <= 3.8 does not support subscriptable types","title":"Fix"},{"location":"changelog/#refactor","text":"Photoshop : Remove unnecessary exception type from suppress Application : Fix incorrect docstring for app.purge, allow Path objects for app.load, wrap colorSettings exceptions Photoshop : Restructure the sequence of events attempting to initialize a valid Dispatch object","title":"Refactor"},{"location":"changelog/#v0221-2023-09-22","text":"","title":"v0.22.1 (2023-09-22)"},{"location":"changelog/#refactor_1","text":"TextFonts : Add support for method 'get' and operator 'in'","title":"Refactor"},{"location":"changelog/#v0220-2023-09-18","text":"","title":"v0.22.0 (2023-09-18)"},{"location":"changelog/#feat","text":"Explicitly flag COM methods","title":"Feat"},{"location":"changelog/#fix_1","text":"formatting and linting comtypes does not play well with hasattr","title":"Fix"},{"location":"changelog/#v02110-2023-09-14","text":"","title":"v0.21.10 (2023-09-14)"},{"location":"changelog/#fix_2","text":"fix auto bump version fix can't set attribute activeHistoryState","title":"Fix"},{"location":"changelog/#v0219-2023-08-31","text":"","title":"v0.21.9 (2023-08-31)"},{"location":"changelog/#fix_3","text":"constants : Update PHOTOSHOP_VERSION_MAPPINGS to add 2024 release mapping (v24/180.0)","title":"Fix"},{"location":"changelog/#v0218-2023-08-22","text":"","title":"v0.21.8 (2023-08-22)"},{"location":"changelog/#fix_4","text":"deps : update dependency wheel to v0.41.2","title":"Fix"},{"location":"changelog/#v0217-2023-08-17","text":"","title":"v0.21.7 (2023-08-17)"},{"location":"changelog/#fix_5","text":"deps : update dependency wheel to ^0.41.0","title":"Fix"},{"location":"changelog/#v0216-2023-08-17","text":"","title":"v0.21.6 (2023-08-17)"},{"location":"changelog/#fix_6","text":"test_imports.py : Include root in install lines import-test.yml : Try an alternate approach with multiple poetry install retries import-test.yml : Correct typo in poetry version string import-test.yml : Revert to <= poetry 1.5.0 to fix \"Import Test\" workflow import-test.yml : Attempt to update lock to prevent inconsitent poetry.lock and pyproject.toml import-test : Attempt to fix poetry bug in \"Import Test\" workflow deps : Attempt to fix failing \"Import Test\" workflow","title":"Fix"},{"location":"changelog/#refactor_2","text":"TextFonts : Implement getitem to allow lookup by postScriptName","title":"Refactor"},{"location":"changelog/#v0215-2023-07-02","text":"","title":"v0.21.5 (2023-07-02)"},{"location":"changelog/#fix_7","text":"fix paste contents of the clipboard","title":"Fix"},{"location":"changelog/#v0214-2023-06-13","text":"","title":"v0.21.4 (2023-06-13)"},{"location":"changelog/#fix_8","text":"LayerSets : Fix infinite recursion when trying to access LayerSets as a list","title":"Fix"},{"location":"changelog/#refactor_3","text":"Photoshop : Attempt to get running Photoshop application before spawning new one","title":"Refactor"},{"location":"changelog/#v0213-2023-05-18","text":"","title":"v0.21.3 (2023-05-18)"},{"location":"changelog/#fix_9","text":"deps : update dependency wheel to ^0.40.0","title":"Fix"},{"location":"changelog/#v0212-2023-05-17","text":"","title":"v0.21.2 (2023-05-17)"},{"location":"changelog/#refactor_4","text":"artLayers,layerSets : Refactored getitem to work like a dictionary key on LayerSets. Added type hinting and try/except to getitem for both ArtLayers and LayerSets","title":"Refactor"},{"location":"changelog/#v0211-2023-02-14","text":"","title":"v0.21.1 (2023-02-14)"},{"location":"changelog/#refactor_5","text":"update constants for support Photoshop 2023","title":"Refactor"},{"location":"changelog/#v0210-2023-01-06","text":"","title":"v0.21.0 (2023-01-06)"},{"location":"changelog/#feat_1","text":"png.py : Add optional args to PNGSaveOptions","title":"Feat"},{"location":"changelog/#v0201-2022-11-28","text":"","title":"v0.20.1 (2022-11-28)"},{"location":"changelog/#refactor_6","text":"action_descriptor : Fix type hints for doubles","title":"Refactor"},{"location":"changelog/#v0200-2022-11-26","text":"","title":"v0.20.0 (2022-11-26)"},{"location":"changelog/#feat_2","text":"add a new option for create batch","title":"Feat"},{"location":"changelog/#v0197-2022-11-14","text":"","title":"v0.19.7 (2022-11-14)"},{"location":"changelog/#fix_10","text":"deps : update dependency wheel to ^0.38.0","title":"Fix"},{"location":"changelog/#v0196-2022-11-06","text":"","title":"v0.19.6 (2022-11-06)"},{"location":"changelog/#refactor_7","text":"update constants for support Photoshop 2022","title":"Refactor"},{"location":"changelog/#v0195-2022-07-17","text":"","title":"v0.19.5 (2022-07-17)"},{"location":"changelog/#refactor_8","text":"application : add a default value of action","title":"Refactor"},{"location":"changelog/#v0194-2022-07-10","text":"","title":"v0.19.4 (2022-07-10)"},{"location":"changelog/#fix_11","text":"get document by document name from documents.","title":"Fix"},{"location":"changelog/#v0193-2022-06-17","text":"","title":"v0.19.3 (2022-06-17)"},{"location":"changelog/#fix_12","text":"fix import EPSSaveOptions","title":"Fix"},{"location":"changelog/#v0192-2022-06-14","text":"","title":"v0.19.2 (2022-06-14)"},{"location":"changelog/#refactor_9","text":"session.py : add EPS save options","title":"Refactor"},{"location":"changelog/#v0191-2022-05-29","text":"","title":"v0.19.1 (2022-05-29)"},{"location":"changelog/#fix_13","text":"document : export document png : exported PNG image is too large","title":"Fix"},{"location":"changelog/#v0190-2022-05-20","text":"","title":"v0.19.0 (2022-05-20)"},{"location":"changelog/#fix_14","text":"ArtLayer,-LayerSet : adjusted linkedLayers property, fixed remove()","title":"Fix"},{"location":"changelog/#feat_3","text":"ArtLayer : added linkedLayers and opacity, fixed unlink","title":"Feat"},{"location":"changelog/#v0181-2022-04-17","text":"","title":"v0.18.1 (2022-04-17)"},{"location":"changelog/#refactor_10","text":"ActionList : Added ActionList to init and Session to make ActionList callable from Application or Session object","title":"Refactor"},{"location":"changelog/#v0180-2022-04-04","text":"","title":"v0.18.0 (2022-04-04)"},{"location":"changelog/#fix_15","text":"fix export document","title":"Fix"},{"location":"changelog/#feat_4","text":"add new function to convert as javascript","title":"Feat"},{"location":"changelog/#v0177-2022-03-20","text":"","title":"v0.17.7 (2022-03-20)"},{"location":"changelog/#fix_16","text":"deps : update dependency wheel to ^0.37.0","title":"Fix"},{"location":"changelog/#v0176-2022-03-19","text":"","title":"v0.17.6 (2022-03-19)"},{"location":"changelog/#refactor_11","text":"improve type hints","title":"Refactor"},{"location":"changelog/#fix_17","text":"add ArtLayer instance return when duplicate layer","title":"Fix"},{"location":"changelog/#v0175-2022-03-13","text":"","title":"v0.17.5 (2022-03-13)"},{"location":"changelog/#fix_18","text":"update ci config and re-tag","title":"Fix"},{"location":"changelog/#v0174-2022-03-13","text":"","title":"v0.17.4 (2022-03-13)"},{"location":"changelog/#perf","text":"add more docstrings","title":"Perf"},{"location":"changelog/#v0173-2022-03-13","text":"","title":"v0.17.3 (2022-03-13)"},{"location":"changelog/#perf_1","text":"add more docstrings","title":"Perf"},{"location":"changelog/#v0172-2022-03-13","text":"","title":"v0.17.2 (2022-03-13)"},{"location":"changelog/#perf_2","text":"improve docs","title":"Perf"},{"location":"changelog/#fix_19","text":"retag and update ci","title":"Fix"},{"location":"changelog/#refactor_12","text":"improve getByName from artLayers and layers","title":"Refactor"},{"location":"changelog/#v0171-2022-03-12","text":"","title":"v0.17.1 (2022-03-12)"},{"location":"changelog/#refactor_13","text":"improve docs","title":"Refactor"},{"location":"changelog/#v0170-2021-09-21","text":"","title":"v0.17.0 (2021-09-21)"},{"location":"changelog/#feat_5","text":"Update the logic of searching the installation path of Photoshop through the registration","title":"Feat"},{"location":"changelog/#v0163-2021-09-12","text":"","title":"v0.16.3 (2021-09-12)"},{"location":"changelog/#fix_20","text":"add 2021 to version mappings","title":"Fix"},{"location":"changelog/#v0162-2021-08-15","text":"","title":"v0.16.2 (2021-08-15)"},{"location":"changelog/#fix_21","text":"api/text_item.py : missing width.setter for paragraphtext in text_item.py","title":"Fix"},{"location":"changelog/#v0161-2021-07-04","text":"","title":"v0.16.1 (2021-07-04)"},{"location":"changelog/#fix_22","text":"fix install failed in python-3.9","title":"Fix"},{"location":"changelog/#v0160-2021-05-29","text":"","title":"v0.16.0 (2021-05-29)"},{"location":"changelog/#feat_6","text":"documents : support get document by index","title":"Feat"},{"location":"changelog/#v0152-2021-05-29","text":"","title":"v0.15.2 (2021-05-29)"},{"location":"changelog/#refactor_14","text":"use absolute path imports use absolute path imports","title":"Refactor"},{"location":"changelog/#0151-2021-02-03","text":"","title":"0.15.1 (2021-02-03)"},{"location":"changelog/#0150-2021-01-10","text":"","title":"0.15.0 (2021-01-10)"},{"location":"changelog/#0140-2020-10-22","text":"","title":"0.14.0 (2020-10-22)"},{"location":"changelog/#0130-2020-09-23","text":"","title":"0.13.0 (2020-09-23)"},{"location":"changelog/#0121-2020-09-13","text":"","title":"0.12.1 (2020-09-13)"},{"location":"changelog/#0120-2020-05-10","text":"","title":"0.12.0 (2020-05-10)"},{"location":"changelog/#0110-2020-05-07","text":"","title":"0.11.0 (2020-05-07)"},{"location":"changelog/#0100-2020-04-22","text":"","title":"0.10.0 (2020-04-22)"},{"location":"changelog/#090-2020-04-09","text":"","title":"0.9.0 (2020-04-09)"},{"location":"changelog/#080-2020-04-08","text":"","title":"0.8.0 (2020-04-08)"},{"location":"changelog/#072-2020-04-01","text":"","title":"0.7.2 (2020-04-01)"},{"location":"changelog/#030-2020-02-24","text":"","title":"0.3.0 (2020-02-24)"},{"location":"changelog/#021-2020-02-17","text":"","title":"0.2.1 (2020-02-17)"},{"location":"examples/","text":"Examples Get Document By Name \"\"\"Get document by document name from documents.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () slate_template = PSD_FILE [ \"slate_template.psd\" ] with Session ( slate_template , action = \"open\" , auto_close = True ) as ps : for doc in ps . app . documents : print ( doc . name ) print ( ps . app . documents . getByName ( \"slate_template.psd\" ) . fullName ) Open Psd # Import local modules from photoshop import Session import photoshop.api as ps # style 1 app = ps . Application () app . load ( \"your/psd/or/psb/file_path.psd\" ) # style 2 with Session ( \"your/psd/or/psb/file_path.psd\" , action = \"open\" ) as ps : ps . echo ( ps . active_document . name ) Session New Document \"\"\"Action for create new document and print new document name.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : ps . echo ( ps . active_document . name ) Current Tool # Import local modules from photoshop import Session with Session () as ps : # Print the current tool. ps . echo ( ps . app . currentTool ) # Set current tool to `typeCreateOrEditTool`. ps . app . currentTool = \"typeCreateOrEditTool\" Run Batch # Import built-in modules import os # Import local modules from photoshop import Session root = \"your/images/root\" files = [] for name in os . listdir ( root ): files . append ( os . path . join ( root , name )) with Session () as api : options = api . BatchOptions () options . destination = 3 options . destinationFolder = \"c: \\\\ test\" api . app . batch ( files = files , actionName = \"Quadrant Colors\" , actionSet = \"Default Actions\" , options = options ) Move To End # Import local modules import photoshop.api as ps # Get photoshop instance. app = ps . Application () # Add new document and set name to \"Example for move to End.\" active_document = app . documents . add ( name = \"Example for move to End.\" ) # Add a new layer set. group_layer = active_document . layerSets . add () # Add a layer in the group. layer = group_layer . artLayers . add () layer . name = \"This is a child layer.\" # Add a new layer in this active document top. top_layer = active_document . artLayers . add () top_layer . name = \"This is a top layer.\" top_layer . moveToEnd ( group_layer ) Creating A Layer \"\"\" Let's get the current document and create a new layer \"Background\" and fill it with red color. In order to use the Fill tool we will first select the entire layer and then fill it with a color. \"\"\" # Import local modules from photoshop import Session with Session () as ps : document = ps . active_document # Create color object of color red. fillColor = ps . SolidColor () fillColor . rgb . red = 222 fillColor . rgb . green = 0 fillColor . rgb . blue = 0 # Add a new layer called Background. layer = document . artLayers . add () layer . name = \"Background\" # Select the entire layer. document . selection . selectAll () # Fill the selection with color. document . selection . fill ( fillColor ) # Deselect. document . selection . deselect () Active Layer # Set the active layer to the last art layer of the active document, or the # first if the last is already active. # Import local modules from photoshop import Session with Session () as ps : if len ( ps . app . documents ) < 1 : docRef = ps . app . documents . add () else : docRef = ps . app . activeDocument if len ( docRef . layers ) < 2 : docRef . artLayers . add () ps . echo ( docRef . activeLayer . name ) new_layer = docRef . artLayers . add () ps . echo ( new_layer . name ) new_layer . name = \"test\" Convert Smartobject To Layer \"\"\"Convert Smart object to artLayer.\"\"\" # Import local modules from photoshop import Session # example 1 with Session () as ps : js = \"\"\" var idplacedLayerConvertToLayers = stringIDToTypeID( \"placedLayerConvertToLayers\" ); executeAction( idplacedLayerConvertToLayers, undefined, DialogModes.NO ); \"\"\" ps . app . doJavaScript ( js ) # example 2 with Session () as ps : descriptor = ps . ActionDescriptor idplacedLayerConvertToLayers = ps . app . stringIDToTypeID ( \"placedLayerConvertToLayers\" ) ps . app . executeAction ( idplacedLayerConvertToLayers , descriptor ) Export Document # Import built-in modules import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () if __name__ == \"__main__\" : psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" , auto_close = True ) as ps : opts = ps . ExportOptionsSaveForWeb () png_file = os . path . join ( mkdtemp (), \"test.png\" ) active_document = ps . app . activeDocument active_document . exportDocument ( png_file , ps . ExportType . SaveForWeb , opts ) os . startfile ( png_file ) Add Metadata \"\"\"Add metadata to current active document.\"\"\" # Import built-in modules import os # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document doc . info . author = os . getenv ( \"USERNAME\" ) doc . info . provinceState = \"Beijing\" doc . info . title = \"My Demo\" print ( \"Print all metadata of current active document.\" ) ps . echo ( doc . info ) Create Thumbnail \"\"\"Create a thumbnail image for currently active document. You can use the thumbnail image to upload to Shotgun or Ftrack. \"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session def create_thumbnail ( output_path = None , max_resolution = 512 ): \"\"\"Create a thumbnail image for currently active document. Args: output_path (str): The absolute output path of the thumbnail image. The default is to output to a temporary folder. max_resolution (int): The max resolution of the thumbnail. The default is `512`. Returns: str: The absolute output path of the thumbnail image. \"\"\" output_path = output_path or os . path . join ( mkdtemp (), \"thumb.jpg\" ) with Session ( auto_close = True ) as ps : orig_name = ps . active_document . name width_str = ps . active_document . width height_str = ps . active_document . height thumb_name = f \" { orig_name } _thumb\" max_resolution = width_str / max_resolution thumb_width = int ( width_str / max_resolution ) thumb_height = int ( height_str / max_resolution ) thumb_doc = ps . active_document . duplicate ( thumb_name ) thumb_doc . resizeImage ( thumb_width , thumb_height - 100 ) thumb_doc . saveAs ( output_path , ps . JPEGSaveOptions (), asCopy = True ) thumb_doc . close () return output_path if __name__ == \"__main__\" : thumb_file = create_thumbnail () print ( f \"Save thumbnail file to { thumb_file } .\" ) Session Smart Sharpen \"\"\"This script demonstrates how you can use the action manager to execute the Emboss filter. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SmartSharpen.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"layer_comps.psd\" ] with Session ( file_path , action = \"open\" ) as ps : def SmartSharpen ( inAmount , inRadius , inNoise ): idsmart_sharpen_id = ps . app . stringIDToTypeID ( ps . EventID . SmartSharpen ) desc37 = ps . ActionDescriptor () idpresetKind = ps . app . stringIDToTypeID ( ps . EventID . PresetKind ) idpresetKindType = ps . app . stringIDToTypeID ( ps . EventID . PresetKindType ) idpresetKindCustom = ps . app . stringIDToTypeID ( ps . EventID . PresetKindCustom ) desc37 . putEnumerated ( idpresetKind , idpresetKindType , idpresetKindCustom ) idAmnt = ps . app . charIDToTypeID ( \"Amnt\" ) idPrc = ps . app . charIDToTypeID ( \"Rds \" ) desc37 . putUnitDouble ( idAmnt , idPrc , inAmount ) idRds = ps . app . charIDToTypeID ( \"Rds \" ) idPxl = ps . app . charIDToTypeID ( \"#Pxl\" ) desc37 . putUnitDouble ( idRds , idPxl , inRadius ) idnoiseReduction = ps . app . stringIDToTypeID ( \"noiseReduction\" ) idPrc = ps . app . charIDToTypeID ( \"#Prc\" ) desc37 . putUnitDouble ( idnoiseReduction , idPrc , inNoise ) idblur = ps . app . charIDToTypeID ( \"blur\" ) idblurType = ps . app . stringIDToTypeID ( \"blurType\" ) idGsnB = ps . app . charIDToTypeID ( \"GsnB\" ) desc37 . putEnumerated ( idblur , idblurType , idGsnB ) ps . app . ExecuteAction ( idsmart_sharpen_id , desc37 ) docRef = ps . active_document nlayerSets = docRef . layerSets nArtLayers = docRef . layerSets . item ( nlayerSets . length ) docRef . activeLayer = nArtLayers . artLayers . item ( nArtLayers . artLayers . length ) SmartSharpen ( 300 , 2.0 , 20 ) Load Selection # This script will demonstrate how to load a selection from a saved alpha # channel. # Import local modules from photoshop import Session with Session () as ps : doc_ref = ps . app . documents . add ( 320 , 240 ) start_ruler_units = ps . app . preferences . rulerUnits if start_ruler_units is not ps . Units . Pixels : ps . app . Preferences . RulerUnits = ps . Units . Pixels # Save a rectangular selection area offset by 50 pixels from the image # border into an alpha channel. offset = 50 selBounds1 = ( ( offset , offset ), ( doc_ref . Width - offset , offset ), ( doc_ref . Width - offset , doc_ref . Height - offset ), ( offset , doc_ref . Height - offset ), ) doc_ref . selection . select ( selBounds1 ) selAlpha = doc_ref . channels . Add () doc_ref . selection . store ( selAlpha ) # Now create a second wider but less tall selection. selBounds2 = (( 0 , 75 ), ( doc_ref . Width , 75 ), ( doc_ref . Width , 150 ), ( 0 , 150 )) doc_ref . selection . select ( selBounds2 ) # Load the selection from the just saved alpha channel, combining it with # the active selection. doc_ref . selection . load ( selAlpha , ps . SelectionType . ExtendSelection , False ) # Set ruler back to where it was. ps . app . Preferences . RulerUnits = start_ruler_units Photoshop Session \"\"\"Add slate information dynamically.\"\"\" # Import built-in modules from datetime import datetime import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"slate_template.psd\" ] with Session ( file_path , action = \"open\" , auto_close = True ) as ps : layer_set = ps . active_document . layerSets . getByName ( \"template\" ) data = { \"project name\" : \"test_project\" , \"datetime\" : datetime . today () . strftime ( \"%Y-%m- %d \" ), } for layer in layer_set . layers : if layer . kind == ps . LayerKind . TextLayer : layer . textItem . contents = data [ layer . textItem . contents . strip ()] jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"slate.jpg\" ) ps . active_document . saveAs ( jpg_file , ps . JPEGSaveOptions ()) os . startfile ( jpg_file ) Apply Filters \"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ApplyFilters.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules # selections in the open document. import photoshop.api as ps PSD_FILE = psd . get_psd_files () # Start up Photoshop application app = ps . Application () # We don't want any Photoshop dialogs displayed during automated execution app . displayDialogs = ps . DialogModes . DisplayNoDialogs psPixels = 1 start_ruler_units = app . preferences . rulerUnits if start_ruler_units is not psPixels : app . preferences . rulerUnits = psPixels fileName = PSD_FILE [ \"layer_comps.psd\" ] docRef = app . open ( fileName ) nLayerSets = len ( list (( i , x ) for i , x in enumerate ( docRef . layerSets ))) - 1 nArtLayers = len ( list (( i , x ) for i , x in enumerate ( docRef . layerSets [ nLayerSets ] . artLayers )), ) active_layer = docRef . activeLayer = docRef . layerSets [ nLayerSets ] . artLayers [ nArtLayers ] sel_area = (( 0 , 212 ), ( 300 , 212 ), ( 300 , 300 ), ( 0 , 300 )) docRef . selection . select ( sel_area , ps . SelectionType . ReplaceSelection , 20 , True ) print ( f \"Current active layer: { active_layer . name } \" ) active_layer . applyAddNoise ( 15 , ps . NoiseDistribution . GaussianNoise , False ) backColor = ps . SolidColor () backColor . hsb . hue = 0 backColor . hsb . saturation = 0 backColor . hsb . brightness = 100 app . backgroundColor = backColor sel_area2 = (( 120 , 20 ), ( 210 , 20 ), ( 210 , 110 ), ( 120 , 110 )) docRef . selection . select ( sel_area2 , ps . SelectionType . ReplaceSelection , 25 , False ) active_layer . applyDiffuseGlow ( 9 , 12 , 15 ) active_layer . applyGlassEffect ( 7 , 3 , 7 , False , ps . TextureType . TinyLensTexture , None , ) docRef . selection . deselect () # Set ruler units back the way we found it. if start_ruler_units is not psPixels : app . Preferences . RulerUnits = start_ruler_units Operate Layer Set \"\"\"A examples to show you how to operate layerSet.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : docRef = ps . active_document # Add a new layerSet. new_layer_set = docRef . layerSets . add () # Print the layerSet count. ps . echo ( docRef . layerSets . length ) ps . echo ( len ( docRef . layerSets )) # Rename the layerSet. docRef . layerSets [ 0 ] . name = \"New Name\" ps . echo ( new_layer_set . name ) # Change the layerSet opacity new_layer_set . opacity = 90 ps . echo ( new_layer_set . opacity ) # Duplicate the layerSet. duplicate_layer_set = new_layer_set . duplicate () # Add a new artLayer in current active document. layer = docRef . artLayers . add () # Move the artLayer under the duplicate layerSet. layer . move ( duplicate_layer_set , ps . ElementPlacement . PlaceInside ) # Merge the layerSet. merged_layer = duplicate_layer_set . merge () ps . echo ( merged_layer . name ) # Set visible. new_layer_set . visible = False merged_layer . remove () Selection Stroke \"\"\"Create a stroke around the current selection, Set the stroke color and width of the new stroke. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SelectionStroke.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if len ( list (( i , x ) for i , x in enumerate ( app . documents , 1 ))) > 0 : if not app . activeDocument . activeLayer . isBackgroundLayer : psPixels = 1 start_ruler_units = app . Preferences . RulerUnits app . preferences . rulerUnits = ps . Units . Pixels selRef = app . activeDocument . selection offset = 10 selBounds = ( ( offset , offset ), ( app . activeDocument . width - offset , offset ), ( app . activeDocument . width - offset , app . activeDocument . height - offset ), ( offset , app . activeDocument . height - offset ), ) selRef . select ( selBounds ) selRef . selectBorder ( 5 ) # create text color properties strokeColor = ps . SolidColor () strokeColor . cmyk . cyan = 58 strokeColor . cmyk . magenta = 0 strokeColor . cmyk . yellow = 70 strokeColor . cmyk . black = 0 app . displayDialogs = ps . DialogModes . DisplayNoDialogs selRef . stroke ( strokeColor , 2 , ps . StrokeLocation . OutsideStroke , ps . ColorBlendMode . ColorBlendMode , 75 , True , ) # Set ruler units back the way we found it. app . preferences . rulerUnits = start_ruler_units else : print ( \"Operation cannot be performed on background layer\" ) else : print ( \"Create a document with an active selection before running this \" \"script!\" ) Cropping \"\"\"A cropping example.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : ps . active_document . crop ( bounds = [ 100 , 12 , 354 , 246 ], width = 1920 , height = 1080 ) Create New Document \"\"\"Create a new document.\"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . preferences . rulerUnits = ps . Units . Pixels ps . app . documents . add ( 1920 , 1080 , name = \"my_new_document\" ) Replace Images \"\"\"Replace the image of the current active layer with a new image.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () with Session ( PSD_FILE [ \"replace_images.psd\" ], action = \"open\" ) as ps : active_layer = ps . active_document . activeLayer bounds = active_layer . bounds print ( f \"current layer { active_layer . name } : { bounds } \" ) input_file = PSD_FILE [ \"red_100x200.png\" ] replace_contents = ps . app . stringIDToTypeID ( \"placedLayerReplaceContents\" ) desc = ps . ActionDescriptor idnull = ps . app . charIDToTypeID ( \"null\" ) desc . putPath ( idnull , input_file ) ps . app . executeAction ( replace_contents , desc ) # replaced image. active_layer = ps . active_document . activeLayer current_bounds = active_layer . bounds width = bounds [ 2 ] - bounds [ 0 ] height = bounds [ 3 ] - bounds [ 1 ] current_width = current_bounds [ 2 ] - current_bounds [ 0 ] current_height = current_bounds [ 3 ] - current_bounds [ 1 ] new_size = width / current_width * 100 active_layer . resize ( new_size , new_size , ps . AnchorPosition . MiddleCenter ) print ( f \"current layer { active_layer . name } : { current_bounds } \" ) Link Layer # Import local modules import photoshop.api as ps app = ps . Application () start_ruler_units = app . preferences . rulerUnits if len ( app . documents ) < 1 : if start_ruler_units is not ps . Units . Pixels : app . preferences . rulerUnits = ps . Units . Pixels docRef = app . documents . add ( 320 , 240 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . BackgroundColor , ) else : docRef = app . activeDocument layerRef = docRef . artLayers . add () layerRef2 = docRef . artLayers . add () layerRef . link ( layerRef2 ) # Set the ruler back to where it was app . preferences . rulerUnits = start_ruler_units Fill Selection # Fill the current selection with an RGB color. # Import local modules from photoshop import Session with Session () as ps : start_ruler_units = ps . app . Preferences . RulerUnits if len ( ps . app . documents ) < 1 : if start_ruler_units is not ps . Units . Pixels : ps . app . Preferences . RulerUnits = ps . Units . Pixels docRef = ps . app . documents . add ( 320 , 240 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . White ) docRef . artLayers . add () ps . app . preferences . rulerUnits = start_ruler_units if not ps . active_document . activeLayer . isBackgroundLayer : selRef = ps . active_document . selection fillcolor = ps . SolidColor () fillcolor . rgb . red = 225 fillcolor . rgb . green = 0 fillcolor . rgb . blue = 0 selRef . fill ( fillcolor , ps . ColorBlendMode . NormalBlendColor , 25 , False ) else : ps . echo ( \"Can't perform operation on background layer.\" ) Change Color Of Background And Foreground \"\"\"Change the color of the background and foreground.\"\"\" # Import local modules from photoshop import Session with Session () as ps : foregroundColor = ps . SolidColor () foregroundColor . rgb . red = 255 foregroundColor . rgb . green = 0 foregroundColor . rgb . blue = 0 ps . app . foregroundColor = foregroundColor backgroundColor = ps . SolidColor () backgroundColor . rgb . red = 0 backgroundColor . rgb . green = 0 backgroundColor . rgb . blue = 0 ps . app . backgroundColor = backgroundColor Add Slate \"\"\"Add slate information dynamically. - Open template. - Update info. - Save as jpg. - Close current document. \"\"\" # Import built-in modules from datetime import datetime import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () slate_template = PSD_FILE [ \"slate_template.psd\" ] with Session ( slate_template , action = \"open\" , auto_close = True ) as ps : layer_set = ps . active_document . layerSets . getByName ( \"template\" ) data = { \"project name\" : \"test_project\" , \"datetime\" : datetime . today () . strftime ( \"%Y-%m- %d \" ), } for layer in layer_set . layers : if layer . kind == ps . LayerKind . TextLayer : layer . textItem . contents = data [ layer . textItem . contents . strip ()] jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"slate.jpg\" ) ps . active_document . saveAs ( jpg_file , ps . JPEGSaveOptions ()) print ( f \"Save jpg to { jpg_file } \" ) os . startfile ( jpg_file ) New Document # Create a new Photoshop document with diminsions 4 inches by 4 inches. # Import local modules import photoshop.api as ps # Start up Photoshop application app = ps . Application () start_ruler_units = app . preferences . rulerUnits app . preferences . rulerUnits = ps . Units . Pixels # Create the document docRef = app . documents . add ( 1920 , 1080 , 72.0 , \"My New Document\" ) # Make sure to set the ruler units prior to creating the document. app . preferences . rulerUnits = start_ruler_units Export Layers As Png \"\"\"Export every layer as a .png file.\"\"\" # Import built-in modules import os # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () def hide_all_layers ( layers ): for layer in layers : layer . visible = False def main (): psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" ) as ps : doc = ps . active_document options = ps . PNGSaveOptions () options . compression = 1 layers = doc . artLayers for layer in layers : hide_all_layers ( layers ) layer . visible = True layer_path = os . path . join ( doc . path , layer . name ) print ( layer_path ) if not os . path . exists ( layer_path ): os . makedirs ( layer_path ) image_path = os . path . join ( layer_path , f \" { layer . name } .png\" ) doc . saveAs ( image_path , options = options , asCopy = True ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) if __name__ == \"__main__\" : main () Import Image As Layer \"\"\"Import a image as a artLayer.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : desc = ps . ActionDescriptor desc . putPath ( ps . app . charIDToTypeID ( \"null\" ), \"your/image/path\" ) event_id = ps . app . charIDToTypeID ( \"Plc \" ) # `Plc` need one space in here. ps . app . executeAction ( ps . app . charIDToTypeID ( \"Plc \" ), desc ) List Documents \"\"\"List current photoshop all documents.\"\"\" # Import local modules import photoshop.api as ps app = ps . Application () doc = app . documents [ 0 ] print ( doc . name ) for doc in app . documents : print ( doc . name ) Export Layers Use Export Options Saveforweb \"\"\"Export every layer as a .png file use `ExportOptionsSaveForWeb`.\"\"\" # Import built-in modules import os # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () def hide_all_layers ( layers ): for layer in layers : layer . visible = False def main (): psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" ) as ps : doc = ps . active_document options = ps . ExportOptionsSaveForWeb () layers = doc . artLayers for layer in layers : hide_all_layers ( layers ) layer . visible = True layer_path = os . path . join ( doc . path , layer . name ) print ( layer_path ) if not os . path . exists ( layer_path ): os . makedirs ( layer_path ) image_path = os . path . join ( layer_path , f \" { layer . name } .png\" ) doc . exportDocument ( image_path , exportAs = ps . ExportType . SaveForWeb , options = options ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) if __name__ == \"__main__\" : main () Add Start Application Event \"\"\"Add event for Photoshop start application. In the current example, every time we start photoshop it will alert \"Start Application Event\". Just like you manually in Script> Script Events Manager to enable the event. \"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as ps : root = mkdtemp () jsx_file = os . path . join ( root , \"event.jsx\" ) with open ( jsx_file , \"w\" ) as f : f . write ( 'alert(\"Start Application event.\")' ) ps . app . notifiers . add ( ps . EventID . Notify , jsx_file ) print ( \"Add event done.\" ) Session Document Duplicate \"\"\"Action for duplicate current active document.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"document_duplicate\" ) as ps : ps . echo ( ps . active_document . name ) Save To Psd \"\"\"Save your current active document as a .psd file.\"\"\" # Import local modules from photoshop import Session with Session () as ps : psd_file = \"your/psd/save/file/path.psd\" doc = ps . active_document options = ps . PhotoshopSaveOptions () layers = doc . artLayers doc . saveAs ( psd_file , options , True ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) Set Active Layer \"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ActiveLayer.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if app . documents . length < 1 : docRef = app . documents . add () else : docRef = app . activeDocument if docRef . layers . length < 2 : docRef . artLayers . add () activeLayerName = docRef . activeLayer . name if docRef . activeLayer . name != docRef . layers . item ( docRef . layers . length ) . name : docRef . activeLayer = docRef . layers . item ( docRef . layers . length ) else : docRef . activeLayer = docRef . layers . item ( 1 ) Smart Sharpen \"\"\"This script demonstrates how you can use the action manager to execute the Emboss filter. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SmartSharpen.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules import photoshop.api as ps app = ps . Application () PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"layer_comps.psd\" ] docRef = app . open ( file_path ) nlayerSets = docRef . layerSets nArtLayers = docRef . layerSets . item ( nlayerSets . length ) docRef . activeLayer = nArtLayers . artLayers . item ( nArtLayers . artLayers . length ) def SmartSharpen ( inAmount , inRadius , inNoise ): idsmart_sharpen_id = app . stringIDToTypeID ( ps . EventID . SmartSharpen ) desc37 = ps . ActionDescriptor () idpresetKind = app . stringIDToTypeID ( ps . EventID . PresetKind ) idpresetKindType = app . stringIDToTypeID ( ps . EventID . PresetKindType ) idpresetKindCustom = app . stringIDToTypeID ( ps . EventID . PresetKindCustom ) desc37 . putEnumerated ( idpresetKind , idpresetKindType , idpresetKindCustom ) idAmnt = app . charIDToTypeID ( \"Amnt\" ) idPrc = app . charIDToTypeID ( \"Rds \" ) desc37 . putUnitDouble ( idAmnt , idPrc , inAmount ) idRds = app . charIDToTypeID ( \"Rds \" ) idPxl = app . charIDToTypeID ( \"#Pxl\" ) desc37 . putUnitDouble ( idRds , idPxl , inRadius ) idnoiseReduction = app . stringIDToTypeID ( \"noiseReduction\" ) idPrc = app . charIDToTypeID ( \"#Prc\" ) desc37 . putUnitDouble ( idnoiseReduction , idPrc , inNoise ) idblur = app . charIDToTypeID ( \"blur\" ) idblurType = app . stringIDToTypeID ( \"blurType\" ) idGsnB = app . charIDToTypeID ( \"GsnB\" ) desc37 . putEnumerated ( idblur , idblurType , idGsnB ) app . ExecuteAction ( idsmart_sharpen_id , desc37 ) SmartSharpen ( 300 , 2.0 , 20 ) Revert Changes \"\"\"This example demonstrates how to roll back history.\"\"\" # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document old_state = doc . activeHistoryState print ( old_state . name ) doc . artLayers . add () last_state = doc . activeHistoryState print ( last_state . name ) doc . activeHistoryState = old_state print ( doc . activeHistoryState . name ) Toggle Proof Colors \"\"\"Toggle the proof color. Like operating in the menu: **View** > **Proof Colors** (Ctrl + Y) \"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . runMenuItem ( ps . app . stringIDToTypeID ( \"toggleProofColors\" )) Fit On Screen \"\"\"Let the current document Fit on screen.\"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . runMenuItem ( ps . app . charIDToTypeID ( \"FtOn\" )) Session Callback # Import local modules from photoshop import Session def do_something ( photoshop_api ): print ( photoshop_api . active_document ) print ( \"Do something.\" ) with Session ( callback = do_something ) as ps : ps . echo ( ps . active_document . name ) ps . alert ( ps . active_document . name ) Session Hello World \"\"\"Add slate information dynamically.\"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as adobe : doc = adobe . app . documents . add ( 2000 , 2000 ) text_color = adobe . SolidColor () text_color . rgb . red = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = adobe . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = adobe . JPEGSaveOptions ( quality = 1 ) jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"hello_world.jpg\" ) doc . saveAs ( jpg_file , options , asCopy = True ) adobe . app . doJavaScript ( f 'alert(\"save to jpg: { jpg_file } \")' ) Get Layer By Name # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" , auto_close = True ) as ps : art_layer = ps . active_document . artLayers . getByName ( \"blue\" ) assert art_layer . name == \"blue\" Save As Tga # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 text_color . rgb . red = 0 text_color . rgb . blue = 0 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color tga_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"test.tga\" ) doc . saveAs ( tga_file , ps . TargaSaveOptions (), asCopy = True ) os . startfile ( tga_file ) Compare Colors \"\"\"Check whether the foreground is equal to the background color. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/CompareColors.py \"\"\" # Import local modules from photoshop import Session with Session () as ps : if ps . app . foregroundColor . isEqual ( ps . app . backgroundColor ): ps . echo ( \"They're Equal.\" ) else : ps . echo ( \"NOT Equal.\" ) Hello World # Import built-in modules import os from tempfile import mkdtemp # Import local modules import photoshop.api as ps def hello_world (): app = ps . Application () doc = app . documents . add () text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"hello_world.jpg\" ) doc . saveAs ( jpg_file , options , asCopy = True ) os . startfile ( jpg_file ) if __name__ == \"__main__\" : hello_world () Emboss Action # Import local modules from photoshop import Session with Session () as ps : app = ps . app for index , x in enumerate ( range ( 50 )): # Execute an existing action from action palette. idPly = app . charIDToTypeID ( \"Ply \" ) desc8 = ps . ActionDescriptor () idnull = app . charIDToTypeID ( \"null\" ) ref3 = ps . ActionReference () idActn = app . charIDToTypeID ( \"Actn\" ) ref3 . putName ( idActn , \"Sepia Toning (layer)\" ) idASet = app . charIDToTypeID ( \"ASet\" ) ref3 . PutName ( idASet , \"Default Actions\" ) desc8 . putReference ( idnull , ref3 ) app . executeAction ( idPly , desc8 , ps . DialogModes . DisplayNoDialogs ) # Create solid color fill layer. idMk = app . charIDToTypeID ( \"Mk \" ) desc21 = ps . ActionDescriptor () idNull = app . charIDToTypeID ( \"null\" ) ref12 = ps . ActionReference () idContentLayer1 = app . stringIDToTypeID ( \"contentLayer\" ) ref12 . putClass ( idContentLayer1 ) desc21 . putReference ( idNull , ref12 ) idUsng = app . charIDToTypeID ( \"Usng\" ) desc22 = ps . ActionDescriptor () idType = app . charIDToTypeID ( \"Type\" ) desc23 = ps . ActionDescriptor () idClr = app . charIDToTypeID ( \"Clr \" ) desc24 = ps . ActionDescriptor () idRd = app . charIDToTypeID ( \"Rd \" ) desc24 . putDouble ( idRd , index ) idGrn = app . charIDToTypeID ( \"Grn \" ) desc24 . putDouble ( idGrn , index ) idBl = app . charIDToTypeID ( \"Bl \" ) desc24 . putDouble ( idBl , index ) idRGBC = app . charIDToTypeID ( \"RGBC\" ) desc23 . putObject ( idClr , idRGBC , desc24 ) idSolidColorLayer = app . StringIDToTypeID ( \"solidColorLayer\" ) desc22 . putObject ( idType , idSolidColorLayer , desc23 ) idContentLayer2 = app . StringIDToTypeID ( \"contentLayer\" ) desc21 . putObject ( idUsng , idContentLayer2 , desc22 ) app . executeAction ( idMk , desc21 , ps . DialogModes . DisplayNoDialogs ) # Select mask. idSlct = app . charIDToTypeID ( \"slct\" ) desc38 = ps . ActionDescriptor () idNull1 = app . charIDToTypeID ( \"null\" ) ref20 = ps . ActionReference () idChnl1 = app . charIDToTypeID ( \"Chnl\" ) idChnl2 = app . charIDToTypeID ( \"Chnl\" ) idMsk = app . charIDToTypeID ( \"Msk \" ) ref20 . putEnumerated ( idChnl1 , idChnl2 , idMsk ) desc38 . putReference ( idNull1 , ref20 ) idMkVs = app . charIDToTypeID ( \"MkVs\" ) desc38 . putBoolean ( idMkVs , False ) app . executeAction ( idSlct , desc38 , ps . DialogModes . DisplayNoDialogs ) app . activeDocument . activeLayer . invert () Rotate Layer \"\"\"This scripts demonstrates how to rotate a layer 45 degrees clockwise. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/RotateLayer.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if len ( app . documents ) > 0 : print ( app . activeDocument . activeLayer . typename ) if not app . activeDocument . activeLayer . isBackgroundLayer : docRef = app . activeDocument layerRef = docRef . layers [ 0 ] layerRef . rotate ( 45.0 ) else : print ( \"Operation cannot be performed on background layer\" ) else : print ( \"You must have at least one open document to run this script!\" ) Trim \"\"\"A trim example.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () example_file = PSD_FILE [ \"trim.psd\" ] with Session ( example_file , action = \"open\" ) as ps : ps . active_document . trim ( ps . TrimType . TopLeftPixel , True , True , True , True ) Save As Pdf \"\"\"Save current active document as a PDF file.\"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as ps : option = ps . PDFSaveOptions ( jpegQuality = 12 , layers = True , view = True ) pdf = os . path . join ( mkdtemp (), \"test.pdf\" ) ps . active_document . saveAs ( pdf , option ) with Session () as ps : option = ps . PDFSaveOptions () option . jpegQuality = 12 option . layers = True option . view = True # opens the saved PDF in Acrobat. pdf = os . path . join ( mkdtemp (), \"test.pdf\" ) ps . active_document . saveAs ( pdf , option ) Color # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document # Add a solid color. textColor = ps . SolidColor () textColor . rgb . red = 255.0 textColor . rgb . green = 197 textColor . rgb . blue = 255 # Create empty layer. new_text_layer = doc . artLayers . add () # Set empty layer type to text layer new_text_layer . kind = ps . LayerKind . TextLayer # Set current text layer contents to \"Hello, World!\". new_text_layer . textItem . contents = \"Hello, World!\" # Change current text layer position. new_text_layer . textItem . position = [ 160 , 167 ] # Change current text layer text size. new_text_layer . textItem . size = 36 # Change current text layer color. new_text_layer . textItem . color = textColor assert new_text_layer . textItem . color . rgb . red == textColor . rgb . red Operate Channels \"\"\"A examples to show you how to operate active document channels.\"\"\" # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document print ( len ( doc . channels )) doc . channels . add () doc . channels . removeAll () channel = doc . channels . getByName ( \"Red\" ) print ( channel . name ) channel . remove () Enable Generator \"\"\"Enable Generator features.\"\"\" # Import local modules from photoshop import Session with Session () as ps : plugin_name = \"generator-assets-dummy-menu\" generatorDesc = ps . ActionDescriptor generatorDesc . putString ( ps . app . stringIDToTypeID ( \"name\" ), plugin_name ) ps . app . executeAction ( ps . app . stringIDToTypeID ( \"generateAssets\" ), generatorDesc ) Copy And Paste \"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/CopyAndPaste.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () startRulerUnits = app . preferences . rulerUnits app . preferences . rulerUnits = ps . Units . Inches doc = app . documents . add ( 7 , 5 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . White ) # Make sure the active layer is not a text layer, which cannot be copied to the # clipboard. if doc . activeLayer . kind != ps . LayerKind . TextLayer : # Select the left half of the document. Selections are always expressed # in pixels regardless of the current ruler unit type, so we're computing # the selection corner points based on the inch unit width and height # of the document x2 = ( doc . width * doc . resolution ) / 2 y2 = doc . height * doc . resolution sel_area = (( 0 , 0 ), ( x2 , 0 ), ( x2 , y2 ), ( 0 , y2 )) doc . selection . select ( sel_area , ps . SelectionType . ReplaceSelection , 0 , False ) doc . selection . copy () # The new doc is created # need to change ruler units to pixels because x2 and y2 are pixel units. app . preferences . rulerUnits = ps . Units . Pixels pasteDoc = app . documents . add ( x2 , y2 , doc . resolution , \"Paste Target\" ) pasteDoc . paste () else : print ( \"You cannot copy from a text layer\" ) if startRulerUnits != app . preferences . rulerUnits : app . preferences . rulerUnits = startRulerUnits Apply Crystallize Filter Action \"\"\" This script demonstrates how you can use the action manager to execute the Crystallize filter. In order to find all the IDs, see https://helpx.adobe.com/photoshop/kb/downloadable-plugins-and-content.html#ScriptingListenerplugin # noqa: E501 This blog here explains what a script listener is http://blogs.adobe.com/crawlspace/2006/05/installing_and_1.html References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ApplyCrystallizeFilterAction.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () with Session ( PSD_FILE [ \"layer_comps.psd\" ], \"open\" ) as ps : active_document = ps . active_document nLayerSets = active_document . layerSets print ( f \"The total amount of current layerSet (Group) is \" f \" { len ( nLayerSets ) } .\" ) nArtLayers = active_document . layerSets . item ( len ( nLayerSets )) . artLayers # get the last layer in LayerSets active_document . activeLayer = active_document . layerSets . item ( len ( nLayerSets )) . artLayers . item ( len ( nArtLayers )) def applyCrystallize ( cellSize ): cellSizeID = ps . app . CharIDToTypeID ( \"ClSz\" ) eventCrystallizeID = ps . app . CharIDToTypeID ( \"Crst\" ) filterDescriptor = ps . ActionDescriptor filterDescriptor . putInteger ( cellSizeID , cellSize ) ps . app . executeAction ( eventCrystallizeID , filterDescriptor ) applyCrystallize ( 25 ) print ( \"Apply crystallize done.\" ) Eval Javascript # Import local modules import photoshop.api as ps app = ps . Application () jsx = r \"\"\" var doc = app.activeDocument; var orig_name = doc.name; alert(orig_name); \"\"\" app . doJavaScript ( jsx ) # Print name of current active document. print ( app . doJavaScript ( \"app.activeDocument.name\" )) Do Photoshop Action \"\"\"Do a photoshop action.\"\"\" # Import local modules from photoshop import Session with Session () as api : api . app . doAction ( action = \"Frame Channel - 50 pixel\" )","title":"Examples"},{"location":"examples/#examples","text":"","title":"Examples"},{"location":"examples/#get-document-by-name","text":"\"\"\"Get document by document name from documents.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () slate_template = PSD_FILE [ \"slate_template.psd\" ] with Session ( slate_template , action = \"open\" , auto_close = True ) as ps : for doc in ps . app . documents : print ( doc . name ) print ( ps . app . documents . getByName ( \"slate_template.psd\" ) . fullName )","title":"Get Document By Name"},{"location":"examples/#open-psd","text":"# Import local modules from photoshop import Session import photoshop.api as ps # style 1 app = ps . Application () app . load ( \"your/psd/or/psb/file_path.psd\" ) # style 2 with Session ( \"your/psd/or/psb/file_path.psd\" , action = \"open\" ) as ps : ps . echo ( ps . active_document . name )","title":"Open Psd"},{"location":"examples/#session-new-document","text":"\"\"\"Action for create new document and print new document name.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : ps . echo ( ps . active_document . name )","title":"Session New Document"},{"location":"examples/#current-tool","text":"# Import local modules from photoshop import Session with Session () as ps : # Print the current tool. ps . echo ( ps . app . currentTool ) # Set current tool to `typeCreateOrEditTool`. ps . app . currentTool = \"typeCreateOrEditTool\"","title":"Current Tool"},{"location":"examples/#run-batch","text":"# Import built-in modules import os # Import local modules from photoshop import Session root = \"your/images/root\" files = [] for name in os . listdir ( root ): files . append ( os . path . join ( root , name )) with Session () as api : options = api . BatchOptions () options . destination = 3 options . destinationFolder = \"c: \\\\ test\" api . app . batch ( files = files , actionName = \"Quadrant Colors\" , actionSet = \"Default Actions\" , options = options )","title":"Run Batch"},{"location":"examples/#move-to-end","text":"# Import local modules import photoshop.api as ps # Get photoshop instance. app = ps . Application () # Add new document and set name to \"Example for move to End.\" active_document = app . documents . add ( name = \"Example for move to End.\" ) # Add a new layer set. group_layer = active_document . layerSets . add () # Add a layer in the group. layer = group_layer . artLayers . add () layer . name = \"This is a child layer.\" # Add a new layer in this active document top. top_layer = active_document . artLayers . add () top_layer . name = \"This is a top layer.\" top_layer . moveToEnd ( group_layer )","title":"Move To End"},{"location":"examples/#creating-a-layer","text":"\"\"\" Let's get the current document and create a new layer \"Background\" and fill it with red color. In order to use the Fill tool we will first select the entire layer and then fill it with a color. \"\"\" # Import local modules from photoshop import Session with Session () as ps : document = ps . active_document # Create color object of color red. fillColor = ps . SolidColor () fillColor . rgb . red = 222 fillColor . rgb . green = 0 fillColor . rgb . blue = 0 # Add a new layer called Background. layer = document . artLayers . add () layer . name = \"Background\" # Select the entire layer. document . selection . selectAll () # Fill the selection with color. document . selection . fill ( fillColor ) # Deselect. document . selection . deselect ()","title":"Creating A Layer"},{"location":"examples/#active-layer","text":"# Set the active layer to the last art layer of the active document, or the # first if the last is already active. # Import local modules from photoshop import Session with Session () as ps : if len ( ps . app . documents ) < 1 : docRef = ps . app . documents . add () else : docRef = ps . app . activeDocument if len ( docRef . layers ) < 2 : docRef . artLayers . add () ps . echo ( docRef . activeLayer . name ) new_layer = docRef . artLayers . add () ps . echo ( new_layer . name ) new_layer . name = \"test\"","title":"Active Layer"},{"location":"examples/#convert-smartobject-to-layer","text":"\"\"\"Convert Smart object to artLayer.\"\"\" # Import local modules from photoshop import Session # example 1 with Session () as ps : js = \"\"\" var idplacedLayerConvertToLayers = stringIDToTypeID( \"placedLayerConvertToLayers\" ); executeAction( idplacedLayerConvertToLayers, undefined, DialogModes.NO ); \"\"\" ps . app . doJavaScript ( js ) # example 2 with Session () as ps : descriptor = ps . ActionDescriptor idplacedLayerConvertToLayers = ps . app . stringIDToTypeID ( \"placedLayerConvertToLayers\" ) ps . app . executeAction ( idplacedLayerConvertToLayers , descriptor )","title":"Convert Smartobject To Layer"},{"location":"examples/#export-document","text":"# Import built-in modules import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () if __name__ == \"__main__\" : psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" , auto_close = True ) as ps : opts = ps . ExportOptionsSaveForWeb () png_file = os . path . join ( mkdtemp (), \"test.png\" ) active_document = ps . app . activeDocument active_document . exportDocument ( png_file , ps . ExportType . SaveForWeb , opts ) os . startfile ( png_file )","title":"Export Document"},{"location":"examples/#add-metadata","text":"\"\"\"Add metadata to current active document.\"\"\" # Import built-in modules import os # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document doc . info . author = os . getenv ( \"USERNAME\" ) doc . info . provinceState = \"Beijing\" doc . info . title = \"My Demo\" print ( \"Print all metadata of current active document.\" ) ps . echo ( doc . info )","title":"Add Metadata"},{"location":"examples/#create-thumbnail","text":"\"\"\"Create a thumbnail image for currently active document. You can use the thumbnail image to upload to Shotgun or Ftrack. \"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session def create_thumbnail ( output_path = None , max_resolution = 512 ): \"\"\"Create a thumbnail image for currently active document. Args: output_path (str): The absolute output path of the thumbnail image. The default is to output to a temporary folder. max_resolution (int): The max resolution of the thumbnail. The default is `512`. Returns: str: The absolute output path of the thumbnail image. \"\"\" output_path = output_path or os . path . join ( mkdtemp (), \"thumb.jpg\" ) with Session ( auto_close = True ) as ps : orig_name = ps . active_document . name width_str = ps . active_document . width height_str = ps . active_document . height thumb_name = f \" { orig_name } _thumb\" max_resolution = width_str / max_resolution thumb_width = int ( width_str / max_resolution ) thumb_height = int ( height_str / max_resolution ) thumb_doc = ps . active_document . duplicate ( thumb_name ) thumb_doc . resizeImage ( thumb_width , thumb_height - 100 ) thumb_doc . saveAs ( output_path , ps . JPEGSaveOptions (), asCopy = True ) thumb_doc . close () return output_path if __name__ == \"__main__\" : thumb_file = create_thumbnail () print ( f \"Save thumbnail file to { thumb_file } .\" )","title":"Create Thumbnail"},{"location":"examples/#session-smart-sharpen","text":"\"\"\"This script demonstrates how you can use the action manager to execute the Emboss filter. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SmartSharpen.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"layer_comps.psd\" ] with Session ( file_path , action = \"open\" ) as ps : def SmartSharpen ( inAmount , inRadius , inNoise ): idsmart_sharpen_id = ps . app . stringIDToTypeID ( ps . EventID . SmartSharpen ) desc37 = ps . ActionDescriptor () idpresetKind = ps . app . stringIDToTypeID ( ps . EventID . PresetKind ) idpresetKindType = ps . app . stringIDToTypeID ( ps . EventID . PresetKindType ) idpresetKindCustom = ps . app . stringIDToTypeID ( ps . EventID . PresetKindCustom ) desc37 . putEnumerated ( idpresetKind , idpresetKindType , idpresetKindCustom ) idAmnt = ps . app . charIDToTypeID ( \"Amnt\" ) idPrc = ps . app . charIDToTypeID ( \"Rds \" ) desc37 . putUnitDouble ( idAmnt , idPrc , inAmount ) idRds = ps . app . charIDToTypeID ( \"Rds \" ) idPxl = ps . app . charIDToTypeID ( \"#Pxl\" ) desc37 . putUnitDouble ( idRds , idPxl , inRadius ) idnoiseReduction = ps . app . stringIDToTypeID ( \"noiseReduction\" ) idPrc = ps . app . charIDToTypeID ( \"#Prc\" ) desc37 . putUnitDouble ( idnoiseReduction , idPrc , inNoise ) idblur = ps . app . charIDToTypeID ( \"blur\" ) idblurType = ps . app . stringIDToTypeID ( \"blurType\" ) idGsnB = ps . app . charIDToTypeID ( \"GsnB\" ) desc37 . putEnumerated ( idblur , idblurType , idGsnB ) ps . app . ExecuteAction ( idsmart_sharpen_id , desc37 ) docRef = ps . active_document nlayerSets = docRef . layerSets nArtLayers = docRef . layerSets . item ( nlayerSets . length ) docRef . activeLayer = nArtLayers . artLayers . item ( nArtLayers . artLayers . length ) SmartSharpen ( 300 , 2.0 , 20 )","title":"Session Smart Sharpen"},{"location":"examples/#load-selection","text":"# This script will demonstrate how to load a selection from a saved alpha # channel. # Import local modules from photoshop import Session with Session () as ps : doc_ref = ps . app . documents . add ( 320 , 240 ) start_ruler_units = ps . app . preferences . rulerUnits if start_ruler_units is not ps . Units . Pixels : ps . app . Preferences . RulerUnits = ps . Units . Pixels # Save a rectangular selection area offset by 50 pixels from the image # border into an alpha channel. offset = 50 selBounds1 = ( ( offset , offset ), ( doc_ref . Width - offset , offset ), ( doc_ref . Width - offset , doc_ref . Height - offset ), ( offset , doc_ref . Height - offset ), ) doc_ref . selection . select ( selBounds1 ) selAlpha = doc_ref . channels . Add () doc_ref . selection . store ( selAlpha ) # Now create a second wider but less tall selection. selBounds2 = (( 0 , 75 ), ( doc_ref . Width , 75 ), ( doc_ref . Width , 150 ), ( 0 , 150 )) doc_ref . selection . select ( selBounds2 ) # Load the selection from the just saved alpha channel, combining it with # the active selection. doc_ref . selection . load ( selAlpha , ps . SelectionType . ExtendSelection , False ) # Set ruler back to where it was. ps . app . Preferences . RulerUnits = start_ruler_units","title":"Load Selection"},{"location":"examples/#photoshop-session","text":"\"\"\"Add slate information dynamically.\"\"\" # Import built-in modules from datetime import datetime import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"slate_template.psd\" ] with Session ( file_path , action = \"open\" , auto_close = True ) as ps : layer_set = ps . active_document . layerSets . getByName ( \"template\" ) data = { \"project name\" : \"test_project\" , \"datetime\" : datetime . today () . strftime ( \"%Y-%m- %d \" ), } for layer in layer_set . layers : if layer . kind == ps . LayerKind . TextLayer : layer . textItem . contents = data [ layer . textItem . contents . strip ()] jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"slate.jpg\" ) ps . active_document . saveAs ( jpg_file , ps . JPEGSaveOptions ()) os . startfile ( jpg_file )","title":"Photoshop Session"},{"location":"examples/#apply-filters","text":"\"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ApplyFilters.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules # selections in the open document. import photoshop.api as ps PSD_FILE = psd . get_psd_files () # Start up Photoshop application app = ps . Application () # We don't want any Photoshop dialogs displayed during automated execution app . displayDialogs = ps . DialogModes . DisplayNoDialogs psPixels = 1 start_ruler_units = app . preferences . rulerUnits if start_ruler_units is not psPixels : app . preferences . rulerUnits = psPixels fileName = PSD_FILE [ \"layer_comps.psd\" ] docRef = app . open ( fileName ) nLayerSets = len ( list (( i , x ) for i , x in enumerate ( docRef . layerSets ))) - 1 nArtLayers = len ( list (( i , x ) for i , x in enumerate ( docRef . layerSets [ nLayerSets ] . artLayers )), ) active_layer = docRef . activeLayer = docRef . layerSets [ nLayerSets ] . artLayers [ nArtLayers ] sel_area = (( 0 , 212 ), ( 300 , 212 ), ( 300 , 300 ), ( 0 , 300 )) docRef . selection . select ( sel_area , ps . SelectionType . ReplaceSelection , 20 , True ) print ( f \"Current active layer: { active_layer . name } \" ) active_layer . applyAddNoise ( 15 , ps . NoiseDistribution . GaussianNoise , False ) backColor = ps . SolidColor () backColor . hsb . hue = 0 backColor . hsb . saturation = 0 backColor . hsb . brightness = 100 app . backgroundColor = backColor sel_area2 = (( 120 , 20 ), ( 210 , 20 ), ( 210 , 110 ), ( 120 , 110 )) docRef . selection . select ( sel_area2 , ps . SelectionType . ReplaceSelection , 25 , False ) active_layer . applyDiffuseGlow ( 9 , 12 , 15 ) active_layer . applyGlassEffect ( 7 , 3 , 7 , False , ps . TextureType . TinyLensTexture , None , ) docRef . selection . deselect () # Set ruler units back the way we found it. if start_ruler_units is not psPixels : app . Preferences . RulerUnits = start_ruler_units","title":"Apply Filters"},{"location":"examples/#operate-layer-set","text":"\"\"\"A examples to show you how to operate layerSet.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : docRef = ps . active_document # Add a new layerSet. new_layer_set = docRef . layerSets . add () # Print the layerSet count. ps . echo ( docRef . layerSets . length ) ps . echo ( len ( docRef . layerSets )) # Rename the layerSet. docRef . layerSets [ 0 ] . name = \"New Name\" ps . echo ( new_layer_set . name ) # Change the layerSet opacity new_layer_set . opacity = 90 ps . echo ( new_layer_set . opacity ) # Duplicate the layerSet. duplicate_layer_set = new_layer_set . duplicate () # Add a new artLayer in current active document. layer = docRef . artLayers . add () # Move the artLayer under the duplicate layerSet. layer . move ( duplicate_layer_set , ps . ElementPlacement . PlaceInside ) # Merge the layerSet. merged_layer = duplicate_layer_set . merge () ps . echo ( merged_layer . name ) # Set visible. new_layer_set . visible = False merged_layer . remove ()","title":"Operate Layer Set"},{"location":"examples/#selection-stroke","text":"\"\"\"Create a stroke around the current selection, Set the stroke color and width of the new stroke. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SelectionStroke.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if len ( list (( i , x ) for i , x in enumerate ( app . documents , 1 ))) > 0 : if not app . activeDocument . activeLayer . isBackgroundLayer : psPixels = 1 start_ruler_units = app . Preferences . RulerUnits app . preferences . rulerUnits = ps . Units . Pixels selRef = app . activeDocument . selection offset = 10 selBounds = ( ( offset , offset ), ( app . activeDocument . width - offset , offset ), ( app . activeDocument . width - offset , app . activeDocument . height - offset ), ( offset , app . activeDocument . height - offset ), ) selRef . select ( selBounds ) selRef . selectBorder ( 5 ) # create text color properties strokeColor = ps . SolidColor () strokeColor . cmyk . cyan = 58 strokeColor . cmyk . magenta = 0 strokeColor . cmyk . yellow = 70 strokeColor . cmyk . black = 0 app . displayDialogs = ps . DialogModes . DisplayNoDialogs selRef . stroke ( strokeColor , 2 , ps . StrokeLocation . OutsideStroke , ps . ColorBlendMode . ColorBlendMode , 75 , True , ) # Set ruler units back the way we found it. app . preferences . rulerUnits = start_ruler_units else : print ( \"Operation cannot be performed on background layer\" ) else : print ( \"Create a document with an active selection before running this \" \"script!\" )","title":"Selection Stroke"},{"location":"examples/#cropping","text":"\"\"\"A cropping example.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : ps . active_document . crop ( bounds = [ 100 , 12 , 354 , 246 ], width = 1920 , height = 1080 )","title":"Cropping"},{"location":"examples/#create-new-document","text":"\"\"\"Create a new document.\"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . preferences . rulerUnits = ps . Units . Pixels ps . app . documents . add ( 1920 , 1080 , name = \"my_new_document\" )","title":"Create New Document"},{"location":"examples/#replace-images","text":"\"\"\"Replace the image of the current active layer with a new image.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () with Session ( PSD_FILE [ \"replace_images.psd\" ], action = \"open\" ) as ps : active_layer = ps . active_document . activeLayer bounds = active_layer . bounds print ( f \"current layer { active_layer . name } : { bounds } \" ) input_file = PSD_FILE [ \"red_100x200.png\" ] replace_contents = ps . app . stringIDToTypeID ( \"placedLayerReplaceContents\" ) desc = ps . ActionDescriptor idnull = ps . app . charIDToTypeID ( \"null\" ) desc . putPath ( idnull , input_file ) ps . app . executeAction ( replace_contents , desc ) # replaced image. active_layer = ps . active_document . activeLayer current_bounds = active_layer . bounds width = bounds [ 2 ] - bounds [ 0 ] height = bounds [ 3 ] - bounds [ 1 ] current_width = current_bounds [ 2 ] - current_bounds [ 0 ] current_height = current_bounds [ 3 ] - current_bounds [ 1 ] new_size = width / current_width * 100 active_layer . resize ( new_size , new_size , ps . AnchorPosition . MiddleCenter ) print ( f \"current layer { active_layer . name } : { current_bounds } \" )","title":"Replace Images"},{"location":"examples/#link-layer","text":"# Import local modules import photoshop.api as ps app = ps . Application () start_ruler_units = app . preferences . rulerUnits if len ( app . documents ) < 1 : if start_ruler_units is not ps . Units . Pixels : app . preferences . rulerUnits = ps . Units . Pixels docRef = app . documents . add ( 320 , 240 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . BackgroundColor , ) else : docRef = app . activeDocument layerRef = docRef . artLayers . add () layerRef2 = docRef . artLayers . add () layerRef . link ( layerRef2 ) # Set the ruler back to where it was app . preferences . rulerUnits = start_ruler_units","title":"Link Layer"},{"location":"examples/#fill-selection","text":"# Fill the current selection with an RGB color. # Import local modules from photoshop import Session with Session () as ps : start_ruler_units = ps . app . Preferences . RulerUnits if len ( ps . app . documents ) < 1 : if start_ruler_units is not ps . Units . Pixels : ps . app . Preferences . RulerUnits = ps . Units . Pixels docRef = ps . app . documents . add ( 320 , 240 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . White ) docRef . artLayers . add () ps . app . preferences . rulerUnits = start_ruler_units if not ps . active_document . activeLayer . isBackgroundLayer : selRef = ps . active_document . selection fillcolor = ps . SolidColor () fillcolor . rgb . red = 225 fillcolor . rgb . green = 0 fillcolor . rgb . blue = 0 selRef . fill ( fillcolor , ps . ColorBlendMode . NormalBlendColor , 25 , False ) else : ps . echo ( \"Can't perform operation on background layer.\" )","title":"Fill Selection"},{"location":"examples/#change-color-of-background-and-foreground","text":"\"\"\"Change the color of the background and foreground.\"\"\" # Import local modules from photoshop import Session with Session () as ps : foregroundColor = ps . SolidColor () foregroundColor . rgb . red = 255 foregroundColor . rgb . green = 0 foregroundColor . rgb . blue = 0 ps . app . foregroundColor = foregroundColor backgroundColor = ps . SolidColor () backgroundColor . rgb . red = 0 backgroundColor . rgb . green = 0 backgroundColor . rgb . blue = 0 ps . app . backgroundColor = backgroundColor","title":"Change Color Of Background And Foreground"},{"location":"examples/#add-slate","text":"\"\"\"Add slate information dynamically. - Open template. - Update info. - Save as jpg. - Close current document. \"\"\" # Import built-in modules from datetime import datetime import os from tempfile import mkdtemp # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () slate_template = PSD_FILE [ \"slate_template.psd\" ] with Session ( slate_template , action = \"open\" , auto_close = True ) as ps : layer_set = ps . active_document . layerSets . getByName ( \"template\" ) data = { \"project name\" : \"test_project\" , \"datetime\" : datetime . today () . strftime ( \"%Y-%m- %d \" ), } for layer in layer_set . layers : if layer . kind == ps . LayerKind . TextLayer : layer . textItem . contents = data [ layer . textItem . contents . strip ()] jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"slate.jpg\" ) ps . active_document . saveAs ( jpg_file , ps . JPEGSaveOptions ()) print ( f \"Save jpg to { jpg_file } \" ) os . startfile ( jpg_file )","title":"Add Slate"},{"location":"examples/#new-document","text":"# Create a new Photoshop document with diminsions 4 inches by 4 inches. # Import local modules import photoshop.api as ps # Start up Photoshop application app = ps . Application () start_ruler_units = app . preferences . rulerUnits app . preferences . rulerUnits = ps . Units . Pixels # Create the document docRef = app . documents . add ( 1920 , 1080 , 72.0 , \"My New Document\" ) # Make sure to set the ruler units prior to creating the document. app . preferences . rulerUnits = start_ruler_units","title":"New Document"},{"location":"examples/#export-layers-as-png","text":"\"\"\"Export every layer as a .png file.\"\"\" # Import built-in modules import os # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () def hide_all_layers ( layers ): for layer in layers : layer . visible = False def main (): psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" ) as ps : doc = ps . active_document options = ps . PNGSaveOptions () options . compression = 1 layers = doc . artLayers for layer in layers : hide_all_layers ( layers ) layer . visible = True layer_path = os . path . join ( doc . path , layer . name ) print ( layer_path ) if not os . path . exists ( layer_path ): os . makedirs ( layer_path ) image_path = os . path . join ( layer_path , f \" { layer . name } .png\" ) doc . saveAs ( image_path , options = options , asCopy = True ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) if __name__ == \"__main__\" : main ()","title":"Export Layers As Png"},{"location":"examples/#import-image-as-layer","text":"\"\"\"Import a image as a artLayer.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : desc = ps . ActionDescriptor desc . putPath ( ps . app . charIDToTypeID ( \"null\" ), \"your/image/path\" ) event_id = ps . app . charIDToTypeID ( \"Plc \" ) # `Plc` need one space in here. ps . app . executeAction ( ps . app . charIDToTypeID ( \"Plc \" ), desc )","title":"Import Image As Layer"},{"location":"examples/#list-documents","text":"\"\"\"List current photoshop all documents.\"\"\" # Import local modules import photoshop.api as ps app = ps . Application () doc = app . documents [ 0 ] print ( doc . name ) for doc in app . documents : print ( doc . name )","title":"List Documents"},{"location":"examples/#export-layers-use-export-options-saveforweb","text":"\"\"\"Export every layer as a .png file use `ExportOptionsSaveForWeb`.\"\"\" # Import built-in modules import os # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () def hide_all_layers ( layers ): for layer in layers : layer . visible = False def main (): psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" ) as ps : doc = ps . active_document options = ps . ExportOptionsSaveForWeb () layers = doc . artLayers for layer in layers : hide_all_layers ( layers ) layer . visible = True layer_path = os . path . join ( doc . path , layer . name ) print ( layer_path ) if not os . path . exists ( layer_path ): os . makedirs ( layer_path ) image_path = os . path . join ( layer_path , f \" { layer . name } .png\" ) doc . exportDocument ( image_path , exportAs = ps . ExportType . SaveForWeb , options = options ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer ) if __name__ == \"__main__\" : main ()","title":"Export Layers Use Export Options Saveforweb"},{"location":"examples/#add-start-application-event","text":"\"\"\"Add event for Photoshop start application. In the current example, every time we start photoshop it will alert \"Start Application Event\". Just like you manually in Script> Script Events Manager to enable the event. \"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as ps : root = mkdtemp () jsx_file = os . path . join ( root , \"event.jsx\" ) with open ( jsx_file , \"w\" ) as f : f . write ( 'alert(\"Start Application event.\")' ) ps . app . notifiers . add ( ps . EventID . Notify , jsx_file ) print ( \"Add event done.\" )","title":"Add Start Application Event"},{"location":"examples/#session-document-duplicate","text":"\"\"\"Action for duplicate current active document.\"\"\" # Import local modules from photoshop import Session with Session ( action = \"document_duplicate\" ) as ps : ps . echo ( ps . active_document . name )","title":"Session Document Duplicate"},{"location":"examples/#save-to-psd","text":"\"\"\"Save your current active document as a .psd file.\"\"\" # Import local modules from photoshop import Session with Session () as ps : psd_file = \"your/psd/save/file/path.psd\" doc = ps . active_document options = ps . PhotoshopSaveOptions () layers = doc . artLayers doc . saveAs ( psd_file , options , True ) ps . alert ( \"Task done!\" ) ps . echo ( doc . activeLayer )","title":"Save To Psd"},{"location":"examples/#set-active-layer","text":"\"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ActiveLayer.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if app . documents . length < 1 : docRef = app . documents . add () else : docRef = app . activeDocument if docRef . layers . length < 2 : docRef . artLayers . add () activeLayerName = docRef . activeLayer . name if docRef . activeLayer . name != docRef . layers . item ( docRef . layers . length ) . name : docRef . activeLayer = docRef . layers . item ( docRef . layers . length ) else : docRef . activeLayer = docRef . layers . item ( 1 )","title":"Set Active Layer"},{"location":"examples/#smart-sharpen","text":"\"\"\"This script demonstrates how you can use the action manager to execute the Emboss filter. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/SmartSharpen.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules import photoshop.api as ps app = ps . Application () PSD_FILE = psd . get_psd_files () file_path = PSD_FILE [ \"layer_comps.psd\" ] docRef = app . open ( file_path ) nlayerSets = docRef . layerSets nArtLayers = docRef . layerSets . item ( nlayerSets . length ) docRef . activeLayer = nArtLayers . artLayers . item ( nArtLayers . artLayers . length ) def SmartSharpen ( inAmount , inRadius , inNoise ): idsmart_sharpen_id = app . stringIDToTypeID ( ps . EventID . SmartSharpen ) desc37 = ps . ActionDescriptor () idpresetKind = app . stringIDToTypeID ( ps . EventID . PresetKind ) idpresetKindType = app . stringIDToTypeID ( ps . EventID . PresetKindType ) idpresetKindCustom = app . stringIDToTypeID ( ps . EventID . PresetKindCustom ) desc37 . putEnumerated ( idpresetKind , idpresetKindType , idpresetKindCustom ) idAmnt = app . charIDToTypeID ( \"Amnt\" ) idPrc = app . charIDToTypeID ( \"Rds \" ) desc37 . putUnitDouble ( idAmnt , idPrc , inAmount ) idRds = app . charIDToTypeID ( \"Rds \" ) idPxl = app . charIDToTypeID ( \"#Pxl\" ) desc37 . putUnitDouble ( idRds , idPxl , inRadius ) idnoiseReduction = app . stringIDToTypeID ( \"noiseReduction\" ) idPrc = app . charIDToTypeID ( \"#Prc\" ) desc37 . putUnitDouble ( idnoiseReduction , idPrc , inNoise ) idblur = app . charIDToTypeID ( \"blur\" ) idblurType = app . stringIDToTypeID ( \"blurType\" ) idGsnB = app . charIDToTypeID ( \"GsnB\" ) desc37 . putEnumerated ( idblur , idblurType , idGsnB ) app . ExecuteAction ( idsmart_sharpen_id , desc37 ) SmartSharpen ( 300 , 2.0 , 20 )","title":"Smart Sharpen"},{"location":"examples/#revert-changes","text":"\"\"\"This example demonstrates how to roll back history.\"\"\" # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document old_state = doc . activeHistoryState print ( old_state . name ) doc . artLayers . add () last_state = doc . activeHistoryState print ( last_state . name ) doc . activeHistoryState = old_state print ( doc . activeHistoryState . name )","title":"Revert Changes"},{"location":"examples/#toggle-proof-colors","text":"\"\"\"Toggle the proof color. Like operating in the menu: **View** > **Proof Colors** (Ctrl + Y) \"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . runMenuItem ( ps . app . stringIDToTypeID ( \"toggleProofColors\" ))","title":"Toggle Proof Colors"},{"location":"examples/#fit-on-screen","text":"\"\"\"Let the current document Fit on screen.\"\"\" # Import local modules from photoshop import Session with Session () as ps : ps . app . runMenuItem ( ps . app . charIDToTypeID ( \"FtOn\" ))","title":"Fit On Screen"},{"location":"examples/#session-callback","text":"# Import local modules from photoshop import Session def do_something ( photoshop_api ): print ( photoshop_api . active_document ) print ( \"Do something.\" ) with Session ( callback = do_something ) as ps : ps . echo ( ps . active_document . name ) ps . alert ( ps . active_document . name )","title":"Session Callback"},{"location":"examples/#session-hello-world","text":"\"\"\"Add slate information dynamically.\"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as adobe : doc = adobe . app . documents . add ( 2000 , 2000 ) text_color = adobe . SolidColor () text_color . rgb . red = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = adobe . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = adobe . JPEGSaveOptions ( quality = 1 ) jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"hello_world.jpg\" ) doc . saveAs ( jpg_file , options , asCopy = True ) adobe . app . doJavaScript ( f 'alert(\"save to jpg: { jpg_file } \")' )","title":"Session Hello World"},{"location":"examples/#get-layer-by-name","text":"# Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () psd_file = PSD_FILE [ \"export_layers_as_png.psd\" ] with Session ( psd_file , action = \"open\" , auto_close = True ) as ps : art_layer = ps . active_document . artLayers . getByName ( \"blue\" ) assert art_layer . name == \"blue\"","title":"Get Layer By Name"},{"location":"examples/#save-as-tga","text":"# Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 text_color . rgb . red = 0 text_color . rgb . blue = 0 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color tga_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"test.tga\" ) doc . saveAs ( tga_file , ps . TargaSaveOptions (), asCopy = True ) os . startfile ( tga_file )","title":"Save As Tga"},{"location":"examples/#compare-colors","text":"\"\"\"Check whether the foreground is equal to the background color. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/CompareColors.py \"\"\" # Import local modules from photoshop import Session with Session () as ps : if ps . app . foregroundColor . isEqual ( ps . app . backgroundColor ): ps . echo ( \"They're Equal.\" ) else : ps . echo ( \"NOT Equal.\" )","title":"Compare Colors"},{"location":"examples/#hello-world","text":"# Import built-in modules import os from tempfile import mkdtemp # Import local modules import photoshop.api as ps def hello_world (): app = ps . Application () doc = app . documents . add () text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = \"Hello, World!\" new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg_file = os . path . join ( mkdtemp ( \"photoshop-python-api\" ), \"hello_world.jpg\" ) doc . saveAs ( jpg_file , options , asCopy = True ) os . startfile ( jpg_file ) if __name__ == \"__main__\" : hello_world ()","title":"Hello World"},{"location":"examples/#emboss-action","text":"# Import local modules from photoshop import Session with Session () as ps : app = ps . app for index , x in enumerate ( range ( 50 )): # Execute an existing action from action palette. idPly = app . charIDToTypeID ( \"Ply \" ) desc8 = ps . ActionDescriptor () idnull = app . charIDToTypeID ( \"null\" ) ref3 = ps . ActionReference () idActn = app . charIDToTypeID ( \"Actn\" ) ref3 . putName ( idActn , \"Sepia Toning (layer)\" ) idASet = app . charIDToTypeID ( \"ASet\" ) ref3 . PutName ( idASet , \"Default Actions\" ) desc8 . putReference ( idnull , ref3 ) app . executeAction ( idPly , desc8 , ps . DialogModes . DisplayNoDialogs ) # Create solid color fill layer. idMk = app . charIDToTypeID ( \"Mk \" ) desc21 = ps . ActionDescriptor () idNull = app . charIDToTypeID ( \"null\" ) ref12 = ps . ActionReference () idContentLayer1 = app . stringIDToTypeID ( \"contentLayer\" ) ref12 . putClass ( idContentLayer1 ) desc21 . putReference ( idNull , ref12 ) idUsng = app . charIDToTypeID ( \"Usng\" ) desc22 = ps . ActionDescriptor () idType = app . charIDToTypeID ( \"Type\" ) desc23 = ps . ActionDescriptor () idClr = app . charIDToTypeID ( \"Clr \" ) desc24 = ps . ActionDescriptor () idRd = app . charIDToTypeID ( \"Rd \" ) desc24 . putDouble ( idRd , index ) idGrn = app . charIDToTypeID ( \"Grn \" ) desc24 . putDouble ( idGrn , index ) idBl = app . charIDToTypeID ( \"Bl \" ) desc24 . putDouble ( idBl , index ) idRGBC = app . charIDToTypeID ( \"RGBC\" ) desc23 . putObject ( idClr , idRGBC , desc24 ) idSolidColorLayer = app . StringIDToTypeID ( \"solidColorLayer\" ) desc22 . putObject ( idType , idSolidColorLayer , desc23 ) idContentLayer2 = app . StringIDToTypeID ( \"contentLayer\" ) desc21 . putObject ( idUsng , idContentLayer2 , desc22 ) app . executeAction ( idMk , desc21 , ps . DialogModes . DisplayNoDialogs ) # Select mask. idSlct = app . charIDToTypeID ( \"slct\" ) desc38 = ps . ActionDescriptor () idNull1 = app . charIDToTypeID ( \"null\" ) ref20 = ps . ActionReference () idChnl1 = app . charIDToTypeID ( \"Chnl\" ) idChnl2 = app . charIDToTypeID ( \"Chnl\" ) idMsk = app . charIDToTypeID ( \"Msk \" ) ref20 . putEnumerated ( idChnl1 , idChnl2 , idMsk ) desc38 . putReference ( idNull1 , ref20 ) idMkVs = app . charIDToTypeID ( \"MkVs\" ) desc38 . putBoolean ( idMkVs , False ) app . executeAction ( idSlct , desc38 , ps . DialogModes . DisplayNoDialogs ) app . activeDocument . activeLayer . invert ()","title":"Emboss Action"},{"location":"examples/#rotate-layer","text":"\"\"\"This scripts demonstrates how to rotate a layer 45 degrees clockwise. References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/RotateLayer.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () if len ( app . documents ) > 0 : print ( app . activeDocument . activeLayer . typename ) if not app . activeDocument . activeLayer . isBackgroundLayer : docRef = app . activeDocument layerRef = docRef . layers [ 0 ] layerRef . rotate ( 45.0 ) else : print ( \"Operation cannot be performed on background layer\" ) else : print ( \"You must have at least one open document to run this script!\" )","title":"Rotate Layer"},{"location":"examples/#trim","text":"\"\"\"A trim example.\"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () example_file = PSD_FILE [ \"trim.psd\" ] with Session ( example_file , action = \"open\" ) as ps : ps . active_document . trim ( ps . TrimType . TopLeftPixel , True , True , True , True )","title":"Trim"},{"location":"examples/#save-as-pdf","text":"\"\"\"Save current active document as a PDF file.\"\"\" # Import built-in modules import os from tempfile import mkdtemp # Import local modules from photoshop import Session with Session () as ps : option = ps . PDFSaveOptions ( jpegQuality = 12 , layers = True , view = True ) pdf = os . path . join ( mkdtemp (), \"test.pdf\" ) ps . active_document . saveAs ( pdf , option ) with Session () as ps : option = ps . PDFSaveOptions () option . jpegQuality = 12 option . layers = True option . view = True # opens the saved PDF in Acrobat. pdf = os . path . join ( mkdtemp (), \"test.pdf\" ) ps . active_document . saveAs ( pdf , option )","title":"Save As Pdf"},{"location":"examples/#color","text":"# Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document # Add a solid color. textColor = ps . SolidColor () textColor . rgb . red = 255.0 textColor . rgb . green = 197 textColor . rgb . blue = 255 # Create empty layer. new_text_layer = doc . artLayers . add () # Set empty layer type to text layer new_text_layer . kind = ps . LayerKind . TextLayer # Set current text layer contents to \"Hello, World!\". new_text_layer . textItem . contents = \"Hello, World!\" # Change current text layer position. new_text_layer . textItem . position = [ 160 , 167 ] # Change current text layer text size. new_text_layer . textItem . size = 36 # Change current text layer color. new_text_layer . textItem . color = textColor assert new_text_layer . textItem . color . rgb . red == textColor . rgb . red","title":"Color"},{"location":"examples/#operate-channels","text":"\"\"\"A examples to show you how to operate active document channels.\"\"\" # Import local modules from photoshop import Session with Session () as ps : doc = ps . active_document print ( len ( doc . channels )) doc . channels . add () doc . channels . removeAll () channel = doc . channels . getByName ( \"Red\" ) print ( channel . name ) channel . remove ()","title":"Operate Channels"},{"location":"examples/#enable-generator","text":"\"\"\"Enable Generator features.\"\"\" # Import local modules from photoshop import Session with Session () as ps : plugin_name = \"generator-assets-dummy-menu\" generatorDesc = ps . ActionDescriptor generatorDesc . putString ( ps . app . stringIDToTypeID ( \"name\" ), plugin_name ) ps . app . executeAction ( ps . app . stringIDToTypeID ( \"generateAssets\" ), generatorDesc )","title":"Enable Generator"},{"location":"examples/#copy-and-paste","text":"\"\"\" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/CopyAndPaste.py \"\"\" # Import local modules import photoshop.api as ps app = ps . Application () startRulerUnits = app . preferences . rulerUnits app . preferences . rulerUnits = ps . Units . Inches doc = app . documents . add ( 7 , 5 , 72 , None , ps . NewDocumentMode . NewRGB , ps . DocumentFill . White ) # Make sure the active layer is not a text layer, which cannot be copied to the # clipboard. if doc . activeLayer . kind != ps . LayerKind . TextLayer : # Select the left half of the document. Selections are always expressed # in pixels regardless of the current ruler unit type, so we're computing # the selection corner points based on the inch unit width and height # of the document x2 = ( doc . width * doc . resolution ) / 2 y2 = doc . height * doc . resolution sel_area = (( 0 , 0 ), ( x2 , 0 ), ( x2 , y2 ), ( 0 , y2 )) doc . selection . select ( sel_area , ps . SelectionType . ReplaceSelection , 0 , False ) doc . selection . copy () # The new doc is created # need to change ruler units to pixels because x2 and y2 are pixel units. app . preferences . rulerUnits = ps . Units . Pixels pasteDoc = app . documents . add ( x2 , y2 , doc . resolution , \"Paste Target\" ) pasteDoc . paste () else : print ( \"You cannot copy from a text layer\" ) if startRulerUnits != app . preferences . rulerUnits : app . preferences . rulerUnits = startRulerUnits","title":"Copy And Paste"},{"location":"examples/#apply-crystallize-filter-action","text":"\"\"\" This script demonstrates how you can use the action manager to execute the Crystallize filter. In order to find all the IDs, see https://helpx.adobe.com/photoshop/kb/downloadable-plugins-and-content.html#ScriptingListenerplugin # noqa: E501 This blog here explains what a script listener is http://blogs.adobe.com/crawlspace/2006/05/installing_and_1.html References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ApplyCrystallizeFilterAction.py \"\"\" # Import third-party modules import examples._psd_files as psd # Import from examples. # Import local modules from photoshop import Session PSD_FILE = psd . get_psd_files () with Session ( PSD_FILE [ \"layer_comps.psd\" ], \"open\" ) as ps : active_document = ps . active_document nLayerSets = active_document . layerSets print ( f \"The total amount of current layerSet (Group) is \" f \" { len ( nLayerSets ) } .\" ) nArtLayers = active_document . layerSets . item ( len ( nLayerSets )) . artLayers # get the last layer in LayerSets active_document . activeLayer = active_document . layerSets . item ( len ( nLayerSets )) . artLayers . item ( len ( nArtLayers )) def applyCrystallize ( cellSize ): cellSizeID = ps . app . CharIDToTypeID ( \"ClSz\" ) eventCrystallizeID = ps . app . CharIDToTypeID ( \"Crst\" ) filterDescriptor = ps . ActionDescriptor filterDescriptor . putInteger ( cellSizeID , cellSize ) ps . app . executeAction ( eventCrystallizeID , filterDescriptor ) applyCrystallize ( 25 ) print ( \"Apply crystallize done.\" )","title":"Apply Crystallize Filter Action"},{"location":"examples/#eval-javascript","text":"# Import local modules import photoshop.api as ps app = ps . Application () jsx = r \"\"\" var doc = app.activeDocument; var orig_name = doc.name; alert(orig_name); \"\"\" app . doJavaScript ( jsx ) # Print name of current active document. print ( app . doJavaScript ( \"app.activeDocument.name\" ))","title":"Eval Javascript"},{"location":"examples/#do-photoshop-action","text":"\"\"\"Do a photoshop action.\"\"\" # Import local modules from photoshop import Session with Session () as api : api . app . doAction ( action = \"Frame Channel - 50 pixel\" )","title":"Do Photoshop Action"},{"location":"reference/SUMMARY/","text":"photoshop api active_layer artlayer artlayers channel channels core document documentinfo documents layerComp layerComps layerSet layerSets layers measurement_log notifier notifiers preferences selection text_fonts action_descriptor action_list action_reference application batch_options colors cmyk gray hsb lab rgb constants enumerations errors event_id open_options eps save_options bmp eps gif jpg pdf png psd tag tif solid_color text_font text_item session","title":"SUMMARY"},{"location":"reference/photoshop/session/","text":"Provides a public session class for Photoshop api. Usually we only need to manipulate the currently active document of photoshop. So as follows: from photoshop import Session with Session ( action = \"new_document\" ) as ps : doc = ps . active_document text_color = ps . SolidColor () text_color . rgb . green = 255 new_text_layer = doc . artLayers . add () new_text_layer . kind = ps . LayerKind . TextLayer new_text_layer . textItem . contents = 'Hello, World!' new_text_layer . textItem . position = [ 160 , 167 ] new_text_layer . textItem . size = 40 new_text_layer . textItem . color = text_color options = ps . JPEGSaveOptions ( quality = 5 ) jpg = 'd:/hello_world.jpg' doc . saveAs ( jpg , options , asCopy = True ) ps . app . doJavaScript ( f 'alert(\"save to jpg: { jpg } \")' ) Session Session of photoshop. We can control active documents in this Session. Attributes: Name Type Description app Application Application of Photoshop. ActionReference ActionReference ActionDescriptor ActionDescriptor Source code in photoshop/session.py 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 class Session : \"\"\"Session of photoshop. We can control active documents in this Session. Attributes: app: Application of Photoshop. ActionReference: ActionDescriptor: \"\"\" def __init__ ( self , file_path : str = None , action : str = None , callback : Any = None , auto_close : bool = False , ps_version : str = None , ): \"\"\"Session of Photoshop. Examples: ```python from photoshop import Session with Session(\"your/psd/or/psb/file_path.psd\", action=\"open\") as ps: ps.echo(ps.active_document.name) ``` Args: file_path: The absolute path of the file. This path can be used together with action. If the path is an existing ``psd` or image path, use ``open`` action to open this file in the current session. action: Name of the action. .e.g: - open Open the file from the option `file_path`. - new_document Create a new document. - document_duplicate Duplicate current active document. callback: The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. auto_close: Is it necessary to close the current document when exiting the current context session. The default is ``False`` not to exit current session. ps_version: Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 \"\"\" super () . __init__ () self . path = file_path self . _auto_close = auto_close self . _callback = callback self . _action = action self . _active_document = None self . app : Application = Application ( version = ps_version ) self . ActionReference : ActionReference = ActionReference () self . ActionDescriptor : ActionDescriptor = ActionDescriptor () self . ActionList : ActionList = ActionList () self . EventID = EventID self . SolidColor = SolidColor self . TextItem = TextItem self . BatchOptions = BatchOptions # The save options. self . GIFSaveOptions = GIFSaveOptions self . JPEGSaveOptions = JPEGSaveOptions self . PDFSaveOptions = PDFSaveOptions self . EPSSaveOptions = EPSSaveOptions self . PNGSaveOptions = PNGSaveOptions self . PhotoshopSaveOptions = PhotoshopSaveOptions self . ExportOptionsSaveForWeb = ExportOptionsSaveForWeb self . BMPSaveOptions = BMPSaveOptions self . TiffSaveOptions = TiffSaveOptions self . TargaSaveOptions = TargaSaveOptions # The colors. self . LabColor = LabColor self . HSBColor = HSBColor self . CMYKColor = CMYKColor self . RGBColor = RGBColor self . GrayColor = GrayColor # From enumerations self . LensType = enumerations . LensType self . AdjustmentReference = enumerations . AdjustmentReference self . AnchorPosition = enumerations . AnchorPosition self . AntiAlias = enumerations . AntiAlias self . AutoKernType = enumerations . AutoKernType self . BMPDepthType = enumerations . BMPDepthType self . BatchDestinationType = enumerations . BatchDestinationType self . BitmapConversionType = enumerations . BitmapConversionType self . BitmapHalfToneType = enumerations . BitmapHalfToneType self . BitsPerChannelType = enumerations . BitsPerChannelType self . BlendMode = enumerations . BlendMode self . ByteOrderType = enumerations . ByteOrderType self . CameraRAWSettingsType = enumerations . CameraRAWSettingsType self . CameraRAWSize = enumerations . CameraRAWSize self . Case = enumerations . Case self . ChangeMode = enumerations . ChangeMode self . ChannelType = enumerations . ChannelType self . ColorBlendMode = enumerations . ColorBlendMode self . ColorModel = enumerations . ColorModel self . ColorPicker = enumerations . ColorPicker self . ColorProfileType = enumerations . ColorProfileType self . ColorReductionType = enumerations . ColorReductionType self . ColorSpaceType = enumerations . ColorSpaceType self . CopyrightedType = enumerations . CopyrightedType self . CreateFields = enumerations . CreateFields self . CropToType = enumerations . CropToType self . DCSType = enumerations . DCSType self . DepthMaource = enumerations . DepthMaource self . DescValueType = enumerations . DescValueType self . DialogModes = enumerations . DialogModes self . Direction = enumerations . Direction self . DisplacementMapType = enumerations . DisplacementMapType self . DitherType = enumerations . DitherType self . DocumentFill = enumerations . DocumentFill self . DocumentMode = enumerations . DocumentMode self . EditLogItemsType = enumerations . EditLogItemsType self . ElementPlacement = enumerations . ElementPlacement self . EliminateFields = enumerations . EliminateFields self . ExportType = enumerations . ExportType self . ExtensionType = enumerations . ExtensionType self . FileNamingType = enumerations . FileNamingType self . FontPreviewType = enumerations . FontPreviewType self . ForcedColors = enumerations . ForcedColors self . FormatOptionsType = enumerations . FormatOptionsType self . GalleryConstrainType = enumerations . GalleryConstrainType self . GalleryFontType = enumerations . GalleryFontType self . GallerySecurityTextColorType = enumerations . GallerySecurityTextColorType self . GallerySecurityTextPositionType = enumerations . GallerySecurityTextPositionType self . GallerySecurityTextRotateType = enumerations . GallerySecurityTextRotateType self . GallerySecurityType = enumerations . GallerySecurityType self . GalleryThumbSizeType = enumerations . GalleryThumbSizeType self . Geometry = enumerations . Geometry self . GridLineStyle = enumerations . GridLineStyle self . GridSize = enumerations . GridSize self . GuideLineStyle = enumerations . GuideLineStyle self . IllustratorPathType = enumerations . IllustratorPathType self . Intent = enumerations . Intent self . JavaScriptExecutionMode = enumerations . JavaScriptExecutionMode self . Justification = enumerations . Justification self . Language = enumerations . Language self . LayerCompressionType = enumerations . LayerCompressionType self . LayerKind = enumerations . LayerKind self . LayerType = enumerations . LayerType self . MagnificationType = enumerations . MagnificationType self . MatteType = enumerations . MatteType self . MeasurementRange = enumerations . MeasurementRange self . MeasurementSource = enumerations . MeasurementSource self . NewDocumentMode = enumerations . NewDocumentMode self . NoiseDistribution = enumerations . NoiseDistribution self . OffsetUndefinedAreas = enumerations . OffsetUndefinedAreas self . OpenDocumentMode = enumerations . OpenDocumentMode self . OpenDocumentType = enumerations . OpenDocumentType self . OperatingSystem = enumerations . OperatingSystem self . Orientation = enumerations . Orientation self . OtherPaintingCursors = enumerations . OtherPaintingCursors self . PDFCompatibilityType = enumerations . PDFCompatibilityType self . PDFEncodingType = enumerations . PDFEncodingType self . PDFResampleType = enumerations . PDFResampleType self . PDFStandardType = enumerations . PDFStandardType self . PICTBitsPerPixel = enumerations . PICTBitsPerPixel self . PICTCompression = enumerations . PICTCompression self . PaintingCursors = enumerations . PaintingCursors self . PaletteType = enumerations . PaletteType self . PathKind = enumerations . PathKind self . PhotoCDColorSpace = enumerations . PhotoCDColorSpace self . PhotoCDSize = enumerations . PhotoCDSize self . PicturePackageTextType = enumerations . PicturePackageTextType self . PointKind = enumerations . PointKind self . PointType = enumerations . PointType self . PolarConversionType = enumerations . PolarConversionType self . PreviewType = enumerations . PreviewType self . PurgeTarget = enumerations . PurgeTarget self . QueryStateType = enumerations . QueryStateType self . RadialBlurMethod = enumerations . RadialBlurMethod self . RadialBlurBest = enumerations . RadialBlurBest self . RasterizeType = enumerations . RasterizeType self . ReferenceFormType = enumerations . ReferenceFormType self . ResampleMethod = enumerations . ResampleMethod self . ResetTarget = enumerations . ResetTarget self . RippleSize = enumerations . RippleSize self . SaveBehavior = enumerations . SaveBehavior self . SaveDocumentType = enumerations . SaveDocumentType self . SaveEncoding = enumerations . SaveEncoding self . SaveLogItemsType = enumerations . SaveLogItemsType self . SaveOptions = enumerations . SaveOptions self . SelectionType = enumerations . SelectionType self . ShapeOperation = enumerations . ShapeOperation self . SmartBlurMode = enumerations . SmartBlurMode self . SmartBlurQuality = enumerations . SmartBlurQuality self . SourceSpaceType = enumerations . SourceSpaceType self . SpherizeMode = enumerations . SpherizeMode self . StrikeThruType = enumerations . StrikeThruType self . StrokeLocation = enumerations . StrokeLocation self . TargaBitsPerPixels = enumerations . TargaBitsPerPixels self . TextComposer = enumerations . TextComposer self . TextType = enumerations . TextType self . TextureType = enumerations . TextureType self . TiffEncodingType = enumerations . TiffEncodingType self . ToolType = enumerations . ToolType self . TransitionType = enumerations . TransitionType self . TrimType = enumerations . TrimType self . TypeUnits = enumerations . TypeUnits self . UndefinedAreas = enumerations . UndefinedAreas self . UnderlineType = enumerations . UnderlineType self . Units = enumerations . Units self . Urgency = enumerations . Urgency self . Wartyle = enumerations . Wartyle self . WaveType = enumerations . WaveType self . WhiteBalanceType = enumerations . WhiteBalanceType self . ZigZagType = enumerations . ZigZagType @property def active_document ( self ): \"\"\"Get current active document. Raises: - PhotoshopPythonAPICOMError: No active document available. \"\"\" try : if not self . _active_document : return self . app . activeDocument return self . _active_document except errors . PhotoshopPythonAPICOMError : raise errors . PhotoshopPythonAPIError ( \"No active document available.\" ) @staticmethod def echo ( * args , ** kwargs ): \"\"\"Print message.\"\"\" print ( * args , ** kwargs ) def alert ( self , text : str ): \"\"\"Alert message box in photoshop. Args: text (str): The text will pop up in photoshop. \"\"\" self . app . doJavaScript ( f \"alert(' { text } ')\" ) @active_document . setter def active_document ( self , active_document ): \"\"\"Set active document.\"\"\" self . _active_document = active_document def _action_open ( self ): self . active_document = self . app . open ( self . path ) def _action_new_document ( self ): self . active_document = self . app . documents . add () def _action_document_duplicate ( self ): self . active_document = self . active_document . duplicate () def run_action ( self ): try : _action = getattr ( self , f \"_action_ { self . _action } \" ) _action () except AttributeError : pass def close ( self ): \"\"\"closing current session.\"\"\" if self . _auto_close : self . active_document . close () def __enter__ ( self ): self . run_action () return self def __exit__ ( self , exc_type , exc_val , exc_tb ): try : if self . _callback : self . _callback ( self ) except Exception as err : raise errors . PhotoshopPythonAPIError ( err ) finally : self . close () active_document property writable Get current active document. Raises: Type Description - PhotoshopPythonAPICOMError No active document available. __init__ ( file_path = None , action = None , callback = None , auto_close = False , ps_version = None ) Session of Photoshop. Examples: from photoshop import Session with Session ( \"your/psd/or/psb/file_path.psd\" , action = \"open\" ) as ps : ps . echo ( ps . active_document . name ) Parameters: Name Type Description Default file_path str The absolute path of the file. This path can be used together with action. If the path is an existing psd` or image path, use open`` action to open this file in the current session. None action str Name of the action. .e.g: - open Open the file from the option file_path . - new_document Create a new document. - document_duplicate Duplicate current active document. None callback Any The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. None auto_close bool Is it necessary to close the current document when exiting the current context session. The default is False not to exit current session. False ps_version str Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 None Source code in photoshop/session.py 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 def __init__ ( self , file_path : str = None , action : str = None , callback : Any = None , auto_close : bool = False , ps_version : str = None , ): \"\"\"Session of Photoshop. Examples: ```python from photoshop import Session with Session(\"your/psd/or/psb/file_path.psd\", action=\"open\") as ps: ps.echo(ps.active_document.name) ``` Args: file_path: The absolute path of the file. This path can be used together with action. If the path is an existing ``psd` or image path, use ``open`` action to open this file in the current session. action: Name of the action. .e.g: - open Open the file from the option `file_path`. - new_document Create a new document. - document_duplicate Duplicate current active document. callback: The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. auto_close: Is it necessary to close the current document when exiting the current context session. The default is ``False`` not to exit current session. ps_version: Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 \"\"\" super () . __init__ () self . path = file_path self . _auto_close = auto_close self . _callback = callback self . _action = action self . _active_document = None self . app : Application = Application ( version = ps_version ) self . ActionReference : ActionReference = ActionReference () self . ActionDescriptor : ActionDescriptor = ActionDescriptor () self . ActionList : ActionList = ActionList () self . EventID = EventID self . SolidColor = SolidColor self . TextItem = TextItem self . BatchOptions = BatchOptions # The save options. self . GIFSaveOptions = GIFSaveOptions self . JPEGSaveOptions = JPEGSaveOptions self . PDFSaveOptions = PDFSaveOptions self . EPSSaveOptions = EPSSaveOptions self . PNGSaveOptions = PNGSaveOptions self . PhotoshopSaveOptions = PhotoshopSaveOptions self . ExportOptionsSaveForWeb = ExportOptionsSaveForWeb self . BMPSaveOptions = BMPSaveOptions self . TiffSaveOptions = TiffSaveOptions self . TargaSaveOptions = TargaSaveOptions # The colors. self . LabColor = LabColor self . HSBColor = HSBColor self . CMYKColor = CMYKColor self . RGBColor = RGBColor self . GrayColor = GrayColor # From enumerations self . LensType = enumerations . LensType self . AdjustmentReference = enumerations . AdjustmentReference self . AnchorPosition = enumerations . AnchorPosition self . AntiAlias = enumerations . AntiAlias self . AutoKernType = enumerations . AutoKernType self . BMPDepthType = enumerations . BMPDepthType self . BatchDestinationType = enumerations . BatchDestinationType self . BitmapConversionType = enumerations . BitmapConversionType self . BitmapHalfToneType = enumerations . BitmapHalfToneType self . BitsPerChannelType = enumerations . BitsPerChannelType self . BlendMode = enumerations . BlendMode self . ByteOrderType = enumerations . ByteOrderType self . CameraRAWSettingsType = enumerations . CameraRAWSettingsType self . CameraRAWSize = enumerations . CameraRAWSize self . Case = enumerations . Case self . ChangeMode = enumerations . ChangeMode self . ChannelType = enumerations . ChannelType self . ColorBlendMode = enumerations . ColorBlendMode self . ColorModel = enumerations . ColorModel self . ColorPicker = enumerations . ColorPicker self . ColorProfileType = enumerations . ColorProfileType self . ColorReductionType = enumerations . ColorReductionType self . ColorSpaceType = enumerations . ColorSpaceType self . CopyrightedType = enumerations . CopyrightedType self . CreateFields = enumerations . CreateFields self . CropToType = enumerations . CropToType self . DCSType = enumerations . DCSType self . DepthMaource = enumerations . DepthMaource self . DescValueType = enumerations . DescValueType self . DialogModes = enumerations . DialogModes self . Direction = enumerations . Direction self . DisplacementMapType = enumerations . DisplacementMapType self . DitherType = enumerations . DitherType self . DocumentFill = enumerations . DocumentFill self . DocumentMode = enumerations . DocumentMode self . EditLogItemsType = enumerations . EditLogItemsType self . ElementPlacement = enumerations . ElementPlacement self . EliminateFields = enumerations . EliminateFields self . ExportType = enumerations . ExportType self . ExtensionType = enumerations . ExtensionType self . FileNamingType = enumerations . FileNamingType self . FontPreviewType = enumerations . FontPreviewType self . ForcedColors = enumerations . ForcedColors self . FormatOptionsType = enumerations . FormatOptionsType self . GalleryConstrainType = enumerations . GalleryConstrainType self . GalleryFontType = enumerations . GalleryFontType self . GallerySecurityTextColorType = enumerations . GallerySecurityTextColorType self . GallerySecurityTextPositionType = enumerations . GallerySecurityTextPositionType self . GallerySecurityTextRotateType = enumerations . GallerySecurityTextRotateType self . GallerySecurityType = enumerations . GallerySecurityType self . GalleryThumbSizeType = enumerations . GalleryThumbSizeType self . Geometry = enumerations . Geometry self . GridLineStyle = enumerations . GridLineStyle self . GridSize = enumerations . GridSize self . GuideLineStyle = enumerations . GuideLineStyle self . IllustratorPathType = enumerations . IllustratorPathType self . Intent = enumerations . Intent self . JavaScriptExecutionMode = enumerations . JavaScriptExecutionMode self . Justification = enumerations . Justification self . Language = enumerations . Language self . LayerCompressionType = enumerations . LayerCompressionType self . LayerKind = enumerations . LayerKind self . LayerType = enumerations . LayerType self . MagnificationType = enumerations . MagnificationType self . MatteType = enumerations . MatteType self . MeasurementRange = enumerations . MeasurementRange self . MeasurementSource = enumerations . MeasurementSource self . NewDocumentMode = enumerations . NewDocumentMode self . NoiseDistribution = enumerations . NoiseDistribution self . OffsetUndefinedAreas = enumerations . OffsetUndefinedAreas self . OpenDocumentMode = enumerations . OpenDocumentMode self . OpenDocumentType = enumerations . OpenDocumentType self . OperatingSystem = enumerations . OperatingSystem self . Orientation = enumerations . Orientation self . OtherPaintingCursors = enumerations . OtherPaintingCursors self . PDFCompatibilityType = enumerations . PDFCompatibilityType self . PDFEncodingType = enumerations . PDFEncodingType self . PDFResampleType = enumerations . PDFResampleType self . PDFStandardType = enumerations . PDFStandardType self . PICTBitsPerPixel = enumerations . PICTBitsPerPixel self . PICTCompression = enumerations . PICTCompression self . PaintingCursors = enumerations . PaintingCursors self . PaletteType = enumerations . PaletteType self . PathKind = enumerations . PathKind self . PhotoCDColorSpace = enumerations . PhotoCDColorSpace self . PhotoCDSize = enumerations . PhotoCDSize self . PicturePackageTextType = enumerations . PicturePackageTextType self . PointKind = enumerations . PointKind self . PointType = enumerations . PointType self . PolarConversionType = enumerations . PolarConversionType self . PreviewType = enumerations . PreviewType self . PurgeTarget = enumerations . PurgeTarget self . QueryStateType = enumerations . QueryStateType self . RadialBlurMethod = enumerations . RadialBlurMethod self . RadialBlurBest = enumerations . RadialBlurBest self . RasterizeType = enumerations . RasterizeType self . ReferenceFormType = enumerations . ReferenceFormType self . ResampleMethod = enumerations . ResampleMethod self . ResetTarget = enumerations . ResetTarget self . RippleSize = enumerations . RippleSize self . SaveBehavior = enumerations . SaveBehavior self . SaveDocumentType = enumerations . SaveDocumentType self . SaveEncoding = enumerations . SaveEncoding self . SaveLogItemsType = enumerations . SaveLogItemsType self . SaveOptions = enumerations . SaveOptions self . SelectionType = enumerations . SelectionType self . ShapeOperation = enumerations . ShapeOperation self . SmartBlurMode = enumerations . SmartBlurMode self . SmartBlurQuality = enumerations . SmartBlurQuality self . SourceSpaceType = enumerations . SourceSpaceType self . SpherizeMode = enumerations . SpherizeMode self . StrikeThruType = enumerations . StrikeThruType self . StrokeLocation = enumerations . StrokeLocation self . TargaBitsPerPixels = enumerations . TargaBitsPerPixels self . TextComposer = enumerations . TextComposer self . TextType = enumerations . TextType self . TextureType = enumerations . TextureType self . TiffEncodingType = enumerations . TiffEncodingType self . ToolType = enumerations . ToolType self . TransitionType = enumerations . TransitionType self . TrimType = enumerations . TrimType self . TypeUnits = enumerations . TypeUnits self . UndefinedAreas = enumerations . UndefinedAreas self . UnderlineType = enumerations . UnderlineType self . Units = enumerations . Units self . Urgency = enumerations . Urgency self . Wartyle = enumerations . Wartyle self . WaveType = enumerations . WaveType self . WhiteBalanceType = enumerations . WhiteBalanceType self . ZigZagType = enumerations . ZigZagType alert ( text ) Alert message box in photoshop. Parameters: Name Type Description Default text str The text will pop up in photoshop. required Source code in photoshop/session.py 305 306 307 308 309 310 311 312 def alert ( self , text : str ): \"\"\"Alert message box in photoshop. Args: text (str): The text will pop up in photoshop. \"\"\" self . app . doJavaScript ( f \"alert(' { text } ')\" ) close () closing current session. Source code in photoshop/session.py 335 336 337 338 def close ( self ): \"\"\"closing current session.\"\"\" if self . _auto_close : self . active_document . close () echo ( * args , ** kwargs ) staticmethod Print message. Source code in photoshop/session.py 300 301 302 303 @staticmethod def echo ( * args , ** kwargs ): \"\"\"Print message.\"\"\" print ( * args , ** kwargs )","title":"session"},{"location":"reference/photoshop/session/#photoshop.session.Session","text":"Session of photoshop. We can control active documents in this Session. Attributes: Name Type Description app Application Application of Photoshop. ActionReference ActionReference ActionDescriptor ActionDescriptor Source code in photoshop/session.py 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 class Session : \"\"\"Session of photoshop. We can control active documents in this Session. Attributes: app: Application of Photoshop. ActionReference: ActionDescriptor: \"\"\" def __init__ ( self , file_path : str = None , action : str = None , callback : Any = None , auto_close : bool = False , ps_version : str = None , ): \"\"\"Session of Photoshop. Examples: ```python from photoshop import Session with Session(\"your/psd/or/psb/file_path.psd\", action=\"open\") as ps: ps.echo(ps.active_document.name) ``` Args: file_path: The absolute path of the file. This path can be used together with action. If the path is an existing ``psd` or image path, use ``open`` action to open this file in the current session. action: Name of the action. .e.g: - open Open the file from the option `file_path`. - new_document Create a new document. - document_duplicate Duplicate current active document. callback: The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. auto_close: Is it necessary to close the current document when exiting the current context session. The default is ``False`` not to exit current session. ps_version: Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 \"\"\" super () . __init__ () self . path = file_path self . _auto_close = auto_close self . _callback = callback self . _action = action self . _active_document = None self . app : Application = Application ( version = ps_version ) self . ActionReference : ActionReference = ActionReference () self . ActionDescriptor : ActionDescriptor = ActionDescriptor () self . ActionList : ActionList = ActionList () self . EventID = EventID self . SolidColor = SolidColor self . TextItem = TextItem self . BatchOptions = BatchOptions # The save options. self . GIFSaveOptions = GIFSaveOptions self . JPEGSaveOptions = JPEGSaveOptions self . PDFSaveOptions = PDFSaveOptions self . EPSSaveOptions = EPSSaveOptions self . PNGSaveOptions = PNGSaveOptions self . PhotoshopSaveOptions = PhotoshopSaveOptions self . ExportOptionsSaveForWeb = ExportOptionsSaveForWeb self . BMPSaveOptions = BMPSaveOptions self . TiffSaveOptions = TiffSaveOptions self . TargaSaveOptions = TargaSaveOptions # The colors. self . LabColor = LabColor self . HSBColor = HSBColor self . CMYKColor = CMYKColor self . RGBColor = RGBColor self . GrayColor = GrayColor # From enumerations self . LensType = enumerations . LensType self . AdjustmentReference = enumerations . AdjustmentReference self . AnchorPosition = enumerations . AnchorPosition self . AntiAlias = enumerations . AntiAlias self . AutoKernType = enumerations . AutoKernType self . BMPDepthType = enumerations . BMPDepthType self . BatchDestinationType = enumerations . BatchDestinationType self . BitmapConversionType = enumerations . BitmapConversionType self . BitmapHalfToneType = enumerations . BitmapHalfToneType self . BitsPerChannelType = enumerations . BitsPerChannelType self . BlendMode = enumerations . BlendMode self . ByteOrderType = enumerations . ByteOrderType self . CameraRAWSettingsType = enumerations . CameraRAWSettingsType self . CameraRAWSize = enumerations . CameraRAWSize self . Case = enumerations . Case self . ChangeMode = enumerations . ChangeMode self . ChannelType = enumerations . ChannelType self . ColorBlendMode = enumerations . ColorBlendMode self . ColorModel = enumerations . ColorModel self . ColorPicker = enumerations . ColorPicker self . ColorProfileType = enumerations . ColorProfileType self . ColorReductionType = enumerations . ColorReductionType self . ColorSpaceType = enumerations . ColorSpaceType self . CopyrightedType = enumerations . CopyrightedType self . CreateFields = enumerations . CreateFields self . CropToType = enumerations . CropToType self . DCSType = enumerations . DCSType self . DepthMaource = enumerations . DepthMaource self . DescValueType = enumerations . DescValueType self . DialogModes = enumerations . DialogModes self . Direction = enumerations . Direction self . DisplacementMapType = enumerations . DisplacementMapType self . DitherType = enumerations . DitherType self . DocumentFill = enumerations . DocumentFill self . DocumentMode = enumerations . DocumentMode self . EditLogItemsType = enumerations . EditLogItemsType self . ElementPlacement = enumerations . ElementPlacement self . EliminateFields = enumerations . EliminateFields self . ExportType = enumerations . ExportType self . ExtensionType = enumerations . ExtensionType self . FileNamingType = enumerations . FileNamingType self . FontPreviewType = enumerations . FontPreviewType self . ForcedColors = enumerations . ForcedColors self . FormatOptionsType = enumerations . FormatOptionsType self . GalleryConstrainType = enumerations . GalleryConstrainType self . GalleryFontType = enumerations . GalleryFontType self . GallerySecurityTextColorType = enumerations . GallerySecurityTextColorType self . GallerySecurityTextPositionType = enumerations . GallerySecurityTextPositionType self . GallerySecurityTextRotateType = enumerations . GallerySecurityTextRotateType self . GallerySecurityType = enumerations . GallerySecurityType self . GalleryThumbSizeType = enumerations . GalleryThumbSizeType self . Geometry = enumerations . Geometry self . GridLineStyle = enumerations . GridLineStyle self . GridSize = enumerations . GridSize self . GuideLineStyle = enumerations . GuideLineStyle self . IllustratorPathType = enumerations . IllustratorPathType self . Intent = enumerations . Intent self . JavaScriptExecutionMode = enumerations . JavaScriptExecutionMode self . Justification = enumerations . Justification self . Language = enumerations . Language self . LayerCompressionType = enumerations . LayerCompressionType self . LayerKind = enumerations . LayerKind self . LayerType = enumerations . LayerType self . MagnificationType = enumerations . MagnificationType self . MatteType = enumerations . MatteType self . MeasurementRange = enumerations . MeasurementRange self . MeasurementSource = enumerations . MeasurementSource self . NewDocumentMode = enumerations . NewDocumentMode self . NoiseDistribution = enumerations . NoiseDistribution self . OffsetUndefinedAreas = enumerations . OffsetUndefinedAreas self . OpenDocumentMode = enumerations . OpenDocumentMode self . OpenDocumentType = enumerations . OpenDocumentType self . OperatingSystem = enumerations . OperatingSystem self . Orientation = enumerations . Orientation self . OtherPaintingCursors = enumerations . OtherPaintingCursors self . PDFCompatibilityType = enumerations . PDFCompatibilityType self . PDFEncodingType = enumerations . PDFEncodingType self . PDFResampleType = enumerations . PDFResampleType self . PDFStandardType = enumerations . PDFStandardType self . PICTBitsPerPixel = enumerations . PICTBitsPerPixel self . PICTCompression = enumerations . PICTCompression self . PaintingCursors = enumerations . PaintingCursors self . PaletteType = enumerations . PaletteType self . PathKind = enumerations . PathKind self . PhotoCDColorSpace = enumerations . PhotoCDColorSpace self . PhotoCDSize = enumerations . PhotoCDSize self . PicturePackageTextType = enumerations . PicturePackageTextType self . PointKind = enumerations . PointKind self . PointType = enumerations . PointType self . PolarConversionType = enumerations . PolarConversionType self . PreviewType = enumerations . PreviewType self . PurgeTarget = enumerations . PurgeTarget self . QueryStateType = enumerations . QueryStateType self . RadialBlurMethod = enumerations . RadialBlurMethod self . RadialBlurBest = enumerations . RadialBlurBest self . RasterizeType = enumerations . RasterizeType self . ReferenceFormType = enumerations . ReferenceFormType self . ResampleMethod = enumerations . ResampleMethod self . ResetTarget = enumerations . ResetTarget self . RippleSize = enumerations . RippleSize self . SaveBehavior = enumerations . SaveBehavior self . SaveDocumentType = enumerations . SaveDocumentType self . SaveEncoding = enumerations . SaveEncoding self . SaveLogItemsType = enumerations . SaveLogItemsType self . SaveOptions = enumerations . SaveOptions self . SelectionType = enumerations . SelectionType self . ShapeOperation = enumerations . ShapeOperation self . SmartBlurMode = enumerations . SmartBlurMode self . SmartBlurQuality = enumerations . SmartBlurQuality self . SourceSpaceType = enumerations . SourceSpaceType self . SpherizeMode = enumerations . SpherizeMode self . StrikeThruType = enumerations . StrikeThruType self . StrokeLocation = enumerations . StrokeLocation self . TargaBitsPerPixels = enumerations . TargaBitsPerPixels self . TextComposer = enumerations . TextComposer self . TextType = enumerations . TextType self . TextureType = enumerations . TextureType self . TiffEncodingType = enumerations . TiffEncodingType self . ToolType = enumerations . ToolType self . TransitionType = enumerations . TransitionType self . TrimType = enumerations . TrimType self . TypeUnits = enumerations . TypeUnits self . UndefinedAreas = enumerations . UndefinedAreas self . UnderlineType = enumerations . UnderlineType self . Units = enumerations . Units self . Urgency = enumerations . Urgency self . Wartyle = enumerations . Wartyle self . WaveType = enumerations . WaveType self . WhiteBalanceType = enumerations . WhiteBalanceType self . ZigZagType = enumerations . ZigZagType @property def active_document ( self ): \"\"\"Get current active document. Raises: - PhotoshopPythonAPICOMError: No active document available. \"\"\" try : if not self . _active_document : return self . app . activeDocument return self . _active_document except errors . PhotoshopPythonAPICOMError : raise errors . PhotoshopPythonAPIError ( \"No active document available.\" ) @staticmethod def echo ( * args , ** kwargs ): \"\"\"Print message.\"\"\" print ( * args , ** kwargs ) def alert ( self , text : str ): \"\"\"Alert message box in photoshop. Args: text (str): The text will pop up in photoshop. \"\"\" self . app . doJavaScript ( f \"alert(' { text } ')\" ) @active_document . setter def active_document ( self , active_document ): \"\"\"Set active document.\"\"\" self . _active_document = active_document def _action_open ( self ): self . active_document = self . app . open ( self . path ) def _action_new_document ( self ): self . active_document = self . app . documents . add () def _action_document_duplicate ( self ): self . active_document = self . active_document . duplicate () def run_action ( self ): try : _action = getattr ( self , f \"_action_ { self . _action } \" ) _action () except AttributeError : pass def close ( self ): \"\"\"closing current session.\"\"\" if self . _auto_close : self . active_document . close () def __enter__ ( self ): self . run_action () return self def __exit__ ( self , exc_type , exc_val , exc_tb ): try : if self . _callback : self . _callback ( self ) except Exception as err : raise errors . PhotoshopPythonAPIError ( err ) finally : self . close ()","title":"Session"},{"location":"reference/photoshop/session/#photoshop.session.Session.active_document","text":"Get current active document. Raises: Type Description - PhotoshopPythonAPICOMError No active document available.","title":"active_document"},{"location":"reference/photoshop/session/#photoshop.session.Session.__init__","text":"Session of Photoshop. Examples: from photoshop import Session with Session ( \"your/psd/or/psb/file_path.psd\" , action = \"open\" ) as ps : ps . echo ( ps . active_document . name ) Parameters: Name Type Description Default file_path str The absolute path of the file. This path can be used together with action. If the path is an existing psd` or image path, use open`` action to open this file in the current session. None action str Name of the action. .e.g: - open Open the file from the option file_path . - new_document Create a new document. - document_duplicate Duplicate current active document. None callback Any The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. None auto_close bool Is it necessary to close the current document when exiting the current context session. The default is False not to exit current session. False ps_version str Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 None Source code in photoshop/session.py 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 def __init__ ( self , file_path : str = None , action : str = None , callback : Any = None , auto_close : bool = False , ps_version : str = None , ): \"\"\"Session of Photoshop. Examples: ```python from photoshop import Session with Session(\"your/psd/or/psb/file_path.psd\", action=\"open\") as ps: ps.echo(ps.active_document.name) ``` Args: file_path: The absolute path of the file. This path can be used together with action. If the path is an existing ``psd` or image path, use ``open`` action to open this file in the current session. action: Name of the action. .e.g: - open Open the file from the option `file_path`. - new_document Create a new document. - document_duplicate Duplicate current active document. callback: The callback function for this Photoshop session. The idea behind it is to allow us to pass some custom callback function every time we exit the current Photoshop session. auto_close: Is it necessary to close the current document when exiting the current context session. The default is ``False`` not to exit current session. ps_version: Specify the version number of photoshop. .e.g: - 2022 - 2021 - cs6 \"\"\" super () . __init__ () self . path = file_path self . _auto_close = auto_close self . _callback = callback self . _action = action self . _active_document = None self . app : Application = Application ( version = ps_version ) self . ActionReference : ActionReference = ActionReference () self . ActionDescriptor : ActionDescriptor = ActionDescriptor () self . ActionList : ActionList = ActionList () self . EventID = EventID self . SolidColor = SolidColor self . TextItem = TextItem self . BatchOptions = BatchOptions # The save options. self . GIFSaveOptions = GIFSaveOptions self . JPEGSaveOptions = JPEGSaveOptions self . PDFSaveOptions = PDFSaveOptions self . EPSSaveOptions = EPSSaveOptions self . PNGSaveOptions = PNGSaveOptions self . PhotoshopSaveOptions = PhotoshopSaveOptions self . ExportOptionsSaveForWeb = ExportOptionsSaveForWeb self . BMPSaveOptions = BMPSaveOptions self . TiffSaveOptions = TiffSaveOptions self . TargaSaveOptions = TargaSaveOptions # The colors. self . LabColor = LabColor self . HSBColor = HSBColor self . CMYKColor = CMYKColor self . RGBColor = RGBColor self . GrayColor = GrayColor # From enumerations self . LensType = enumerations . LensType self . AdjustmentReference = enumerations . AdjustmentReference self . AnchorPosition = enumerations . AnchorPosition self . AntiAlias = enumerations . AntiAlias self . AutoKernType = enumerations . AutoKernType self . BMPDepthType = enumerations . BMPDepthType self . BatchDestinationType = enumerations . BatchDestinationType self . BitmapConversionType = enumerations . BitmapConversionType self . BitmapHalfToneType = enumerations . BitmapHalfToneType self . BitsPerChannelType = enumerations . BitsPerChannelType self . BlendMode = enumerations . BlendMode self . ByteOrderType = enumerations . ByteOrderType self . CameraRAWSettingsType = enumerations . CameraRAWSettingsType self . CameraRAWSize = enumerations . CameraRAWSize self . Case = enumerations . Case self . ChangeMode = enumerations . ChangeMode self . ChannelType = enumerations . ChannelType self . ColorBlendMode = enumerations . ColorBlendMode self . ColorModel = enumerations . ColorModel self . ColorPicker = enumerations . ColorPicker self . ColorProfileType = enumerations . ColorProfileType self . ColorReductionType = enumerations . ColorReductionType self . ColorSpaceType = enumerations . ColorSpaceType self . CopyrightedType = enumerations . CopyrightedType self . CreateFields = enumerations . CreateFields self . CropToType = enumerations . CropToType self . DCSType = enumerations . DCSType self . DepthMaource = enumerations . DepthMaource self . DescValueType = enumerations . DescValueType self . DialogModes = enumerations . DialogModes self . Direction = enumerations . Direction self . DisplacementMapType = enumerations . DisplacementMapType self . DitherType = enumerations . DitherType self . DocumentFill = enumerations . DocumentFill self . DocumentMode = enumerations . DocumentMode self . EditLogItemsType = enumerations . EditLogItemsType self . ElementPlacement = enumerations . ElementPlacement self . EliminateFields = enumerations . EliminateFields self . ExportType = enumerations . ExportType self . ExtensionType = enumerations . ExtensionType self . FileNamingType = enumerations . FileNamingType self . FontPreviewType = enumerations . FontPreviewType self . ForcedColors = enumerations . ForcedColors self . FormatOptionsType = enumerations . FormatOptionsType self . GalleryConstrainType = enumerations . GalleryConstrainType self . GalleryFontType = enumerations . GalleryFontType self . GallerySecurityTextColorType = enumerations . GallerySecurityTextColorType self . GallerySecurityTextPositionType = enumerations . GallerySecurityTextPositionType self . GallerySecurityTextRotateType = enumerations . GallerySecurityTextRotateType self . GallerySecurityType = enumerations . GallerySecurityType self . GalleryThumbSizeType = enumerations . GalleryThumbSizeType self . Geometry = enumerations . Geometry self . GridLineStyle = enumerations . GridLineStyle self . GridSize = enumerations . GridSize self . GuideLineStyle = enumerations . GuideLineStyle self . IllustratorPathType = enumerations . IllustratorPathType self . Intent = enumerations . Intent self . JavaScriptExecutionMode = enumerations . JavaScriptExecutionMode self . Justification = enumerations . Justification self . Language = enumerations . Language self . LayerCompressionType = enumerations . LayerCompressionType self . LayerKind = enumerations . LayerKind self . LayerType = enumerations . LayerType self . MagnificationType = enumerations . MagnificationType self . MatteType = enumerations . MatteType self . MeasurementRange = enumerations . MeasurementRange self . MeasurementSource = enumerations . MeasurementSource self . NewDocumentMode = enumerations . NewDocumentMode self . NoiseDistribution = enumerations . NoiseDistribution self . OffsetUndefinedAreas = enumerations . OffsetUndefinedAreas self . OpenDocumentMode = enumerations . OpenDocumentMode self . OpenDocumentType = enumerations . OpenDocumentType self . OperatingSystem = enumerations . OperatingSystem self . Orientation = enumerations . Orientation self . OtherPaintingCursors = enumerations . OtherPaintingCursors self . PDFCompatibilityType = enumerations . PDFCompatibilityType self . PDFEncodingType = enumerations . PDFEncodingType self . PDFResampleType = enumerations . PDFResampleType self . PDFStandardType = enumerations . PDFStandardType self . PICTBitsPerPixel = enumerations . PICTBitsPerPixel self . PICTCompression = enumerations . PICTCompression self . PaintingCursors = enumerations . PaintingCursors self . PaletteType = enumerations . PaletteType self . PathKind = enumerations . PathKind self . PhotoCDColorSpace = enumerations . PhotoCDColorSpace self . PhotoCDSize = enumerations . PhotoCDSize self . PicturePackageTextType = enumerations . PicturePackageTextType self . PointKind = enumerations . PointKind self . PointType = enumerations . PointType self . PolarConversionType = enumerations . PolarConversionType self . PreviewType = enumerations . PreviewType self . PurgeTarget = enumerations . PurgeTarget self . QueryStateType = enumerations . QueryStateType self . RadialBlurMethod = enumerations . RadialBlurMethod self . RadialBlurBest = enumerations . RadialBlurBest self . RasterizeType = enumerations . RasterizeType self . ReferenceFormType = enumerations . ReferenceFormType self . ResampleMethod = enumerations . ResampleMethod self . ResetTarget = enumerations . ResetTarget self . RippleSize = enumerations . RippleSize self . SaveBehavior = enumerations . SaveBehavior self . SaveDocumentType = enumerations . SaveDocumentType self . SaveEncoding = enumerations . SaveEncoding self . SaveLogItemsType = enumerations . SaveLogItemsType self . SaveOptions = enumerations . SaveOptions self . SelectionType = enumerations . SelectionType self . ShapeOperation = enumerations . ShapeOperation self . SmartBlurMode = enumerations . SmartBlurMode self . SmartBlurQuality = enumerations . SmartBlurQuality self . SourceSpaceType = enumerations . SourceSpaceType self . SpherizeMode = enumerations . SpherizeMode self . StrikeThruType = enumerations . StrikeThruType self . StrokeLocation = enumerations . StrokeLocation self . TargaBitsPerPixels = enumerations . TargaBitsPerPixels self . TextComposer = enumerations . TextComposer self . TextType = enumerations . TextType self . TextureType = enumerations . TextureType self . TiffEncodingType = enumerations . TiffEncodingType self . ToolType = enumerations . ToolType self . TransitionType = enumerations . TransitionType self . TrimType = enumerations . TrimType self . TypeUnits = enumerations . TypeUnits self . UndefinedAreas = enumerations . UndefinedAreas self . UnderlineType = enumerations . UnderlineType self . Units = enumerations . Units self . Urgency = enumerations . Urgency self . Wartyle = enumerations . Wartyle self . WaveType = enumerations . WaveType self . WhiteBalanceType = enumerations . WhiteBalanceType self . ZigZagType = enumerations . ZigZagType","title":"__init__()"},{"location":"reference/photoshop/session/#photoshop.session.Session.alert","text":"Alert message box in photoshop. Parameters: Name Type Description Default text str The text will pop up in photoshop. required Source code in photoshop/session.py 305 306 307 308 309 310 311 312 def alert ( self , text : str ): \"\"\"Alert message box in photoshop. Args: text (str): The text will pop up in photoshop. \"\"\" self . app . doJavaScript ( f \"alert(' { text } ')\" )","title":"alert()"},{"location":"reference/photoshop/session/#photoshop.session.Session.close","text":"closing current session. Source code in photoshop/session.py 335 336 337 338 def close ( self ): \"\"\"closing current session.\"\"\" if self . _auto_close : self . active_document . close ()","title":"close()"},{"location":"reference/photoshop/session/#photoshop.session.Session.echo","text":"Print message. Source code in photoshop/session.py 300 301 302 303 @staticmethod def echo ( * args , ** kwargs ): \"\"\"Print message.\"\"\" print ( * args , ** kwargs )","title":"echo()"},{"location":"reference/photoshop/api/_active_layer/","text":"ActiveLayer Bases: Photoshop The selected layer. Source code in photoshop/api/_active_layer.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 class ActiveLayer ( Photoshop ): \"\"\"The selected layer.\"\"\" def __int__ ( self ): super () . __init__ () @property def name ( self ) -> str : \"\"\"The name of the layer.\"\"\" return self . active_layer . Typename def add ( self ): \"\"\"Adds an element.\"\"\" self . app . ActiveDocument . ArtLayers . Add () name : str property The name of the layer. add () Adds an element. Source code in photoshop/api/_active_layer.py 16 17 18 def add ( self ): \"\"\"Adds an element.\"\"\" self . app . ActiveDocument . ArtLayers . Add ()","title":"active_layer"},{"location":"reference/photoshop/api/_active_layer/#photoshop.api._active_layer.ActiveLayer","text":"Bases: Photoshop The selected layer. Source code in photoshop/api/_active_layer.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 class ActiveLayer ( Photoshop ): \"\"\"The selected layer.\"\"\" def __int__ ( self ): super () . __init__ () @property def name ( self ) -> str : \"\"\"The name of the layer.\"\"\" return self . active_layer . Typename def add ( self ): \"\"\"Adds an element.\"\"\" self . app . ActiveDocument . ArtLayers . Add ()","title":"ActiveLayer"},{"location":"reference/photoshop/api/_active_layer/#photoshop.api._active_layer.ActiveLayer.name","text":"The name of the layer.","title":"name"},{"location":"reference/photoshop/api/_active_layer/#photoshop.api._active_layer.ActiveLayer.add","text":"Adds an element. Source code in photoshop/api/_active_layer.py 16 17 18 def add ( self ): \"\"\"Adds an element.\"\"\" self . app . ActiveDocument . ArtLayers . Add ()","title":"add()"},{"location":"reference/photoshop/api/_artlayer/","text":"ArtLayer Bases: Photoshop An object within a document that contains the visual elements of the image (equivalent to a layer in the Adobe Photoshop application). Source code in photoshop/api/_artlayer.py 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 class ArtLayer ( Photoshop ): \"\"\"An object within a document that contains the visual elements of the image (equivalent to a layer in the Adobe Photoshop application). \"\"\" def __init__ ( self , parent : Any = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"adjustBrightnessContrast\" , \"adjustColorBalance\" , \"adjustCurves\" , \"adjustLevels\" , \"applyAddNoise\" , \"applyAverage\" , \"applyBlur\" , \"applyBlurMore\" , \"applyClouds\" , \"applyCustomFilter\" , \"applyDeInterlace\" , \"applyDespeckle\" , \"applyDifferenceClouds\" , \"applyDiffuseGlow\" , \"applyDisplace\" , \"applyDustAndScratches\" , \"applyGaussianBlur\" , \"applyGlassEffect\" , \"applyHighPass\" , \"applyLensBlur\" , \"applyLensFlare\" , \"applyMaximum\" , \"applyMedianNoise\" , \"applyMinimum\" , \"applyMotionBlur\" , \"applyNTSC\" , \"applyOceanRipple\" , \"applyOffset\" , \"applyPinch\" , \"delete\" , \"duplicate\" , \"invert\" , \"link\" , \"merge\" , \"move\" , \"posterize\" , \"rasterize\" , \"unlink\" , ) @property def allLocked ( self ): return self . app . allLocked @allLocked . setter def allLocked ( self , value ): self . app . allLocked = value @property def blendMode ( self ): return self . app . blendMode @blendMode . setter def blendMode ( self , mode ): self . app . blendMode = mode @property def bounds ( self ): \"\"\"The bounding rectangle of the layer.\"\"\" return self . app . bounds @property def linkedLayers ( self ) -> list : \"\"\"Get all layers linked to this layer. Returns: list: Layer objects\"\"\" return [ ArtLayer ( layer ) for layer in self . app . linkedLayers ] @property def name ( self ) -> str : return self . app . name @name . setter def name ( self , text : str ): self . app . name = text @property def fillOpacity ( self ): \"\"\"The interior opacity of the layer. Range: 0.0 to 100.0.\"\"\" return self . app . fillOpacity @fillOpacity . setter def fillOpacity ( self , value ): \"\"\"The interior opacity of the layer. Range: 0.0 to 100.0.\"\"\" self . app . fillOpacity = value @property def filterMaskDensity ( self ): return self . app . filterMaskDensity @filterMaskDensity . setter def filterMaskDensity ( self , value ): self . app . filterMaskDensity = value @property def filterMaskFeather ( self ): return self . app . filterMaskFeather @filterMaskFeather . setter def filterMaskFeather ( self , value ): self . app . filterMaskFeather = value @property def grouped ( self ) -> bool : \"\"\"If true, the layer is grouped with the layer below.\"\"\" return self . app . grouped @grouped . setter def grouped ( self , value ): self . app . grouped = value @property def isBackgroundLayer ( self ): \"\"\"bool: If true, the layer is a background layer.\"\"\" return self . app . isBackgroundLayer @isBackgroundLayer . setter def isBackgroundLayer ( self , value ): self . app . isBackgroundLayer = value @property def kind ( self ): \"\"\"Sets the layer kind (such as \u2018text layer\u2019) for an empty layer. Valid only when the layer is empty and when `isBackgroundLayer` is false. You can use the \u2018kind \u2018 property to make a background layer a normal layer; however, to make a layer a background layer, you must set `isBackgroundLayer` to true. \"\"\" return LayerKind ( self . app . kind ) @kind . setter def kind ( self , layer_type ): \"\"\"set the layer kind.\"\"\" self . app . kind = layer_type @property def layerMaskDensity ( self ): \"\"\"The density of the layer mask (between 0.0 and 100.0).\"\"\" return self . app . layerMaskDensity @layerMaskDensity . setter def layerMaskDensity ( self , value ): self . app . layerMaskDensity = value @property def layerMaskFeather ( self ): \"\"\"The feather of the layer mask (between 0.0 and 250.0).\"\"\" return self . app . layerMaskFeather @layerMaskFeather . setter def layerMaskFeather ( self , value ): self . app . layerMaskFeather = value @property def opacity ( self ): \"\"\"The master opacity of the layer.\"\"\" return round ( self . app . opacity ) @opacity . setter def opacity ( self , value ): self . app . opacity = value @property def parent ( self ): \"\"\"The object\u2019s container.\"\"\" return self . app . parent @parent . setter def parent ( self , value ): \"\"\"Set the object\u2019s container.\"\"\" self . app . parent = value @property def pixelsLocked ( self ): \"\"\"If true, the pixels in the layer\u2019s image cannot be edited.\"\"\" return self . app . pixelsLocked @pixelsLocked . setter def pixelsLocked ( self , value ): self . app . pixelsLocked = value @property def positionLocked ( self ): \"\"\"bool: If true, the pixels in the layer\u2019s image cannot be moved within the layer.\"\"\" return self . app . positionLocked @positionLocked . setter def positionLocked ( self , value ): self . app . positionLocked = value @property def textItem ( self ) -> TextItem : \"\"\"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. returns: TextItem: \"\"\" return TextItem ( self . app . textItem ) @textItem . setter def textItem ( self , value ): self . app . textItem = value @property def transparentPixelsLocked ( self ): return self . app . transparentPixelsLocked @transparentPixelsLocked . setter def transparentPixelsLocked ( self , value ): self . app . transparentPixelsLocked = value @property def vectorMaskDensity ( self ): return self . app . vectorMaskDensity @vectorMaskDensity . setter def vectorMaskDensity ( self , value ): self . app . vectorMaskDensity = value @property def vectorMaskFeather ( self ): return self . app . vectorMaskFeather @vectorMaskFeather . setter def vectorMaskFeather ( self , value ): self . app . vectorMaskFeather = value @property def visible ( self ): return self . app . visible @visible . setter def visible ( self , value ): self . app . visible = value @property def length ( self ): return len ( list ( self . app )) def add ( self ): return self . app . add () def adjustBrightnessContrast ( self , brightness , contrast ): \"\"\"Adjusts the brightness and contrast. Args: brightness (int): The brightness amount. Range: -100 to 100. contrast (int): The contrast amount. Range: -100 to 100. \"\"\" return self . app . adjustBrightnessContrast ( brightness , contrast ) def adjustColorBalance ( self , shadows , midtones , highlights , preserveLuminosity , ): \"\"\"Adjusts the color balance of the layer\u2019s component channels. Args: shadows: The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. midtones: The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. highlights: The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. preserveLuminosity: If true, luminosity is preserved. \"\"\" return self . app . adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity , ) def adjustCurves ( self , curveShape ): \"\"\"Adjusts the tonal range of the selected channel using up to fourteen points. Args: curveShape: The curve points. The number of points must be between 2 and 14. Returns: \"\"\" return self . app . adjustCurves ( curveShape ) def adjustLevels ( self , inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ): \"\"\"Adjusts levels of the selected channels. Args: inputRangeStart: inputRangeEnd: inputRangeGamma: outputRangeStart: outputRangeEnd: Returns: \"\"\" return self . app . adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ) def applyAddNoise ( self , amount , distribution , monochromatic ): return self . app . applyAddNoise ( amount , distribution , monochromatic ) def applyDiffuseGlow ( self , graininess , amount , clear_amount ): \"\"\"Applies the diffuse glow filter. Args: graininess: The amount of graininess. Range: 0 to 10. amount: The glow amount. Range: 0 to 20. clear_amount: The clear amount. Range: 0 to 20. Returns: \"\"\" return self . app . applyDiffuseGlow ( graininess , amount , clear_amount ) def applyAverage ( self ): \"\"\"Applies the average filter.\"\"\" return self . app . applyAverage () def applyBlur ( self ): \"\"\"Applies the blur filter.\"\"\" return self . app . applyBlur () def applyBlurMore ( self ): \"\"\"Applies the blur more filter.\"\"\" return self . app . applyBlurMore () def applyClouds ( self ): \"\"\"Applies the clouds filter.\"\"\" return self . app . applyClouds () def applyCustomFilter ( self , characteristics , scale , offset ): \"\"\"Applies the custom filter.\"\"\" return self . app . applyCustomFilter ( characteristics , scale , offset ) def applyDeInterlace ( self , eliminateFields , createFields ): \"\"\"Applies the de-interlace filter.\"\"\" return self . app . applyDeInterlace ( eliminateFields , createFields ) def applyDespeckle ( self ): return self . app . applyDespeckle () def applyDifferenceClouds ( self ): \"\"\"Applies the difference clouds filter.\"\"\" return self . app . applyDifferenceClouds () def applyDisplace ( self , horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ): \"\"\"Applies the displace filter.\"\"\" return self . app . applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ) def applyDustAndScratches ( self , radius , threshold ): \"\"\"Applies the dust and scratches filter.\"\"\" return self . app . applyDustAndScratches ( radius , threshold ) def applyGaussianBlur ( self , radius ): \"\"\"Applies the gaussian blur filter.\"\"\" return self . app . applyGaussianBlur ( radius ) def applyGlassEffect ( self , distortion , smoothness , scaling , invert , texture , textureFile , ): return self . app . applyGlassEffect ( distortion , smoothness , scaling , invert , texture , textureFile , ) def applyHighPass ( self , radius ): \"\"\"Applies the high pass filter.\"\"\" return self . app . applyHighPass ( radius ) def applyLensBlur ( self , source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ): \"\"\"Apply the lens blur filter.\"\"\" return self . app . applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ) def applyLensFlare ( self , brightness , flareCenter , lensType ): return self . app . applyLensFlare ( brightness , flareCenter , lensType ) def applyMaximum ( self , radius ): self . app . applyMaximum ( radius ) def applyMedianNoise ( self , radius ): self . app . applyMedianNoise ( radius ) def applyMinimum ( self , radius ): self . app . applyMinimum ( radius ) def applyMotionBlur ( self , angle , radius ): self . app . applyMotionBlur ( angle , radius ) def applyNTSC ( self ): self . app . applyNTSC () def applyOceanRipple ( self , size , magnitude ): self . app . applyOceanRipple ( size , magnitude ) def applyOffset ( self , horizontal , vertical , undefinedAreas ): self . app . applyOffset ( horizontal , vertical , undefinedAreas ) def applyPinch ( self , amount ): self . app . applyPinch ( amount ) def remove ( self ): \"\"\"Removes this layer from the document.\"\"\" self . app . delete () def rasterize ( self , target : RasterizeType ): self . app . rasterize ( target ) def posterize ( self , levels ): self . app . posterize ( levels ) def move ( self , relativeObject , insertionLocation ): self . app . move ( relativeObject , insertionLocation ) def merge ( self ): return ArtLayer ( self . app . merge ()) def link ( self , with_layer ): self . app . link ( with_layer ) def unlink ( self ): \"\"\"Unlink this layer from any linked layers.\"\"\" self . app . unlink () def invert ( self ): self . app . invert () def duplicate ( self , relativeObject = None , insertionLocation = None ): return ArtLayer ( self . app . duplicate ( relativeObject , insertionLocation )) bounds property The bounding rectangle of the layer. fillOpacity property writable The interior opacity of the layer. Range: 0.0 to 100.0. grouped : bool property writable If true, the layer is grouped with the layer below. isBackgroundLayer property writable kind property writable Sets the layer kind (such as \u2018text layer\u2019) for an empty layer. Valid only when the layer is empty and when isBackgroundLayer is false. You can use the \u2018kind \u2018 property to make a background layer a normal layer; however, to make a layer a background layer, you must set isBackgroundLayer to true. layerMaskDensity property writable The density of the layer mask (between 0.0 and 100.0). layerMaskFeather property writable The feather of the layer mask (between 0.0 and 250.0). linkedLayers : list property Get all layers linked to this layer. Returns: Name Type Description list list Layer objects opacity property writable The master opacity of the layer. parent property writable The object\u2019s container. pixelsLocked property writable If true, the pixels in the layer\u2019s image cannot be edited. positionLocked property writable within the layer. textItem : TextItem property writable The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. Returns: Name Type Description TextItem TextItem adjustBrightnessContrast ( brightness , contrast ) Adjusts the brightness and contrast. Parameters: Name Type Description Default brightness int The brightness amount. Range: -100 to 100. required contrast int The contrast amount. Range: -100 to 100. required Source code in photoshop/api/_artlayer.py 270 271 272 273 274 275 276 277 278 def adjustBrightnessContrast ( self , brightness , contrast ): \"\"\"Adjusts the brightness and contrast. Args: brightness (int): The brightness amount. Range: -100 to 100. contrast (int): The contrast amount. Range: -100 to 100. \"\"\" return self . app . adjustBrightnessContrast ( brightness , contrast ) adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity ) Adjusts the color balance of the layer\u2019s component channels. Parameters: Name Type Description Default shadows The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required midtones The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required highlights The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required preserveLuminosity If true, luminosity is preserved. required Source code in photoshop/api/_artlayer.py 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 def adjustColorBalance ( self , shadows , midtones , highlights , preserveLuminosity , ): \"\"\"Adjusts the color balance of the layer\u2019s component channels. Args: shadows: The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. midtones: The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. highlights: The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. preserveLuminosity: If true, luminosity is preserved. \"\"\" return self . app . adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity , ) adjustCurves ( curveShape ) Adjusts the tonal range of the selected channel using up to fourteen points. Parameters: Name Type Description Default curveShape The curve points. The number of points must be between 2 and 14. required Source code in photoshop/api/_artlayer.py 312 313 314 315 316 317 318 319 320 321 322 323 324 325 def adjustCurves ( self , curveShape ): \"\"\"Adjusts the tonal range of the selected channel using up to fourteen points. Args: curveShape: The curve points. The number of points must be between 2 and 14. Returns: \"\"\" return self . app . adjustCurves ( curveShape ) adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd ) Adjusts levels of the selected channels. Parameters: Name Type Description Default inputRangeStart required inputRangeEnd required inputRangeGamma required outputRangeStart required outputRangeEnd required Source code in photoshop/api/_artlayer.py 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 def adjustLevels ( self , inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ): \"\"\"Adjusts levels of the selected channels. Args: inputRangeStart: inputRangeEnd: inputRangeGamma: outputRangeStart: outputRangeEnd: Returns: \"\"\" return self . app . adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ) applyAverage () Applies the average filter. Source code in photoshop/api/_artlayer.py 371 372 373 def applyAverage ( self ): \"\"\"Applies the average filter.\"\"\" return self . app . applyAverage () applyBlur () Applies the blur filter. Source code in photoshop/api/_artlayer.py 375 376 377 def applyBlur ( self ): \"\"\"Applies the blur filter.\"\"\" return self . app . applyBlur () applyBlurMore () Applies the blur more filter. Source code in photoshop/api/_artlayer.py 379 380 381 def applyBlurMore ( self ): \"\"\"Applies the blur more filter.\"\"\" return self . app . applyBlurMore () applyClouds () Applies the clouds filter. Source code in photoshop/api/_artlayer.py 383 384 385 def applyClouds ( self ): \"\"\"Applies the clouds filter.\"\"\" return self . app . applyClouds () applyCustomFilter ( characteristics , scale , offset ) Applies the custom filter. Source code in photoshop/api/_artlayer.py 387 388 389 def applyCustomFilter ( self , characteristics , scale , offset ): \"\"\"Applies the custom filter.\"\"\" return self . app . applyCustomFilter ( characteristics , scale , offset ) applyDeInterlace ( eliminateFields , createFields ) Applies the de-interlace filter. Source code in photoshop/api/_artlayer.py 391 392 393 def applyDeInterlace ( self , eliminateFields , createFields ): \"\"\"Applies the de-interlace filter.\"\"\" return self . app . applyDeInterlace ( eliminateFields , createFields ) applyDifferenceClouds () Applies the difference clouds filter. Source code in photoshop/api/_artlayer.py 398 399 400 def applyDifferenceClouds ( self ): \"\"\"Applies the difference clouds filter.\"\"\" return self . app . applyDifferenceClouds () applyDiffuseGlow ( graininess , amount , clear_amount ) Applies the diffuse glow filter. Parameters: Name Type Description Default graininess The amount of graininess. Range: 0 to 10. required amount The glow amount. Range: 0 to 20. required clear_amount The clear amount. Range: 0 to 20. required Source code in photoshop/api/_artlayer.py 358 359 360 361 362 363 364 365 366 367 368 369 def applyDiffuseGlow ( self , graininess , amount , clear_amount ): \"\"\"Applies the diffuse glow filter. Args: graininess: The amount of graininess. Range: 0 to 10. amount: The glow amount. Range: 0 to 20. clear_amount: The clear amount. Range: 0 to 20. Returns: \"\"\" return self . app . applyDiffuseGlow ( graininess , amount , clear_amount ) applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile ) Applies the displace filter. Source code in photoshop/api/_artlayer.py 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 def applyDisplace ( self , horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ): \"\"\"Applies the displace filter.\"\"\" return self . app . applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ) applyDustAndScratches ( radius , threshold ) Applies the dust and scratches filter. Source code in photoshop/api/_artlayer.py 419 420 421 def applyDustAndScratches ( self , radius , threshold ): \"\"\"Applies the dust and scratches filter.\"\"\" return self . app . applyDustAndScratches ( radius , threshold ) applyGaussianBlur ( radius ) Applies the gaussian blur filter. Source code in photoshop/api/_artlayer.py 423 424 425 def applyGaussianBlur ( self , radius ): \"\"\"Applies the gaussian blur filter.\"\"\" return self . app . applyGaussianBlur ( radius ) applyHighPass ( radius ) Applies the high pass filter. Source code in photoshop/api/_artlayer.py 445 446 447 def applyHighPass ( self , radius ): \"\"\"Applies the high pass filter.\"\"\" return self . app . applyHighPass ( radius ) applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic ) Apply the lens blur filter. Source code in photoshop/api/_artlayer.py 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 def applyLensBlur ( self , source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ): \"\"\"Apply the lens blur filter.\"\"\" return self . app . applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ) remove () Removes this layer from the document. Source code in photoshop/api/_artlayer.py 507 508 509 def remove ( self ): \"\"\"Removes this layer from the document.\"\"\" self . app . delete () unlink () Unlink this layer from any linked layers. Source code in photoshop/api/_artlayer.py 526 527 528 def unlink ( self ): \"\"\"Unlink this layer from any linked layers.\"\"\" self . app . unlink ()","title":"artlayer"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer","text":"Bases: Photoshop An object within a document that contains the visual elements of the image (equivalent to a layer in the Adobe Photoshop application). Source code in photoshop/api/_artlayer.py 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 class ArtLayer ( Photoshop ): \"\"\"An object within a document that contains the visual elements of the image (equivalent to a layer in the Adobe Photoshop application). \"\"\" def __init__ ( self , parent : Any = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"adjustBrightnessContrast\" , \"adjustColorBalance\" , \"adjustCurves\" , \"adjustLevels\" , \"applyAddNoise\" , \"applyAverage\" , \"applyBlur\" , \"applyBlurMore\" , \"applyClouds\" , \"applyCustomFilter\" , \"applyDeInterlace\" , \"applyDespeckle\" , \"applyDifferenceClouds\" , \"applyDiffuseGlow\" , \"applyDisplace\" , \"applyDustAndScratches\" , \"applyGaussianBlur\" , \"applyGlassEffect\" , \"applyHighPass\" , \"applyLensBlur\" , \"applyLensFlare\" , \"applyMaximum\" , \"applyMedianNoise\" , \"applyMinimum\" , \"applyMotionBlur\" , \"applyNTSC\" , \"applyOceanRipple\" , \"applyOffset\" , \"applyPinch\" , \"delete\" , \"duplicate\" , \"invert\" , \"link\" , \"merge\" , \"move\" , \"posterize\" , \"rasterize\" , \"unlink\" , ) @property def allLocked ( self ): return self . app . allLocked @allLocked . setter def allLocked ( self , value ): self . app . allLocked = value @property def blendMode ( self ): return self . app . blendMode @blendMode . setter def blendMode ( self , mode ): self . app . blendMode = mode @property def bounds ( self ): \"\"\"The bounding rectangle of the layer.\"\"\" return self . app . bounds @property def linkedLayers ( self ) -> list : \"\"\"Get all layers linked to this layer. Returns: list: Layer objects\"\"\" return [ ArtLayer ( layer ) for layer in self . app . linkedLayers ] @property def name ( self ) -> str : return self . app . name @name . setter def name ( self , text : str ): self . app . name = text @property def fillOpacity ( self ): \"\"\"The interior opacity of the layer. Range: 0.0 to 100.0.\"\"\" return self . app . fillOpacity @fillOpacity . setter def fillOpacity ( self , value ): \"\"\"The interior opacity of the layer. Range: 0.0 to 100.0.\"\"\" self . app . fillOpacity = value @property def filterMaskDensity ( self ): return self . app . filterMaskDensity @filterMaskDensity . setter def filterMaskDensity ( self , value ): self . app . filterMaskDensity = value @property def filterMaskFeather ( self ): return self . app . filterMaskFeather @filterMaskFeather . setter def filterMaskFeather ( self , value ): self . app . filterMaskFeather = value @property def grouped ( self ) -> bool : \"\"\"If true, the layer is grouped with the layer below.\"\"\" return self . app . grouped @grouped . setter def grouped ( self , value ): self . app . grouped = value @property def isBackgroundLayer ( self ): \"\"\"bool: If true, the layer is a background layer.\"\"\" return self . app . isBackgroundLayer @isBackgroundLayer . setter def isBackgroundLayer ( self , value ): self . app . isBackgroundLayer = value @property def kind ( self ): \"\"\"Sets the layer kind (such as \u2018text layer\u2019) for an empty layer. Valid only when the layer is empty and when `isBackgroundLayer` is false. You can use the \u2018kind \u2018 property to make a background layer a normal layer; however, to make a layer a background layer, you must set `isBackgroundLayer` to true. \"\"\" return LayerKind ( self . app . kind ) @kind . setter def kind ( self , layer_type ): \"\"\"set the layer kind.\"\"\" self . app . kind = layer_type @property def layerMaskDensity ( self ): \"\"\"The density of the layer mask (between 0.0 and 100.0).\"\"\" return self . app . layerMaskDensity @layerMaskDensity . setter def layerMaskDensity ( self , value ): self . app . layerMaskDensity = value @property def layerMaskFeather ( self ): \"\"\"The feather of the layer mask (between 0.0 and 250.0).\"\"\" return self . app . layerMaskFeather @layerMaskFeather . setter def layerMaskFeather ( self , value ): self . app . layerMaskFeather = value @property def opacity ( self ): \"\"\"The master opacity of the layer.\"\"\" return round ( self . app . opacity ) @opacity . setter def opacity ( self , value ): self . app . opacity = value @property def parent ( self ): \"\"\"The object\u2019s container.\"\"\" return self . app . parent @parent . setter def parent ( self , value ): \"\"\"Set the object\u2019s container.\"\"\" self . app . parent = value @property def pixelsLocked ( self ): \"\"\"If true, the pixels in the layer\u2019s image cannot be edited.\"\"\" return self . app . pixelsLocked @pixelsLocked . setter def pixelsLocked ( self , value ): self . app . pixelsLocked = value @property def positionLocked ( self ): \"\"\"bool: If true, the pixels in the layer\u2019s image cannot be moved within the layer.\"\"\" return self . app . positionLocked @positionLocked . setter def positionLocked ( self , value ): self . app . positionLocked = value @property def textItem ( self ) -> TextItem : \"\"\"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. returns: TextItem: \"\"\" return TextItem ( self . app . textItem ) @textItem . setter def textItem ( self , value ): self . app . textItem = value @property def transparentPixelsLocked ( self ): return self . app . transparentPixelsLocked @transparentPixelsLocked . setter def transparentPixelsLocked ( self , value ): self . app . transparentPixelsLocked = value @property def vectorMaskDensity ( self ): return self . app . vectorMaskDensity @vectorMaskDensity . setter def vectorMaskDensity ( self , value ): self . app . vectorMaskDensity = value @property def vectorMaskFeather ( self ): return self . app . vectorMaskFeather @vectorMaskFeather . setter def vectorMaskFeather ( self , value ): self . app . vectorMaskFeather = value @property def visible ( self ): return self . app . visible @visible . setter def visible ( self , value ): self . app . visible = value @property def length ( self ): return len ( list ( self . app )) def add ( self ): return self . app . add () def adjustBrightnessContrast ( self , brightness , contrast ): \"\"\"Adjusts the brightness and contrast. Args: brightness (int): The brightness amount. Range: -100 to 100. contrast (int): The contrast amount. Range: -100 to 100. \"\"\" return self . app . adjustBrightnessContrast ( brightness , contrast ) def adjustColorBalance ( self , shadows , midtones , highlights , preserveLuminosity , ): \"\"\"Adjusts the color balance of the layer\u2019s component channels. Args: shadows: The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. midtones: The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. highlights: The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. preserveLuminosity: If true, luminosity is preserved. \"\"\" return self . app . adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity , ) def adjustCurves ( self , curveShape ): \"\"\"Adjusts the tonal range of the selected channel using up to fourteen points. Args: curveShape: The curve points. The number of points must be between 2 and 14. Returns: \"\"\" return self . app . adjustCurves ( curveShape ) def adjustLevels ( self , inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ): \"\"\"Adjusts levels of the selected channels. Args: inputRangeStart: inputRangeEnd: inputRangeGamma: outputRangeStart: outputRangeEnd: Returns: \"\"\" return self . app . adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ) def applyAddNoise ( self , amount , distribution , monochromatic ): return self . app . applyAddNoise ( amount , distribution , monochromatic ) def applyDiffuseGlow ( self , graininess , amount , clear_amount ): \"\"\"Applies the diffuse glow filter. Args: graininess: The amount of graininess. Range: 0 to 10. amount: The glow amount. Range: 0 to 20. clear_amount: The clear amount. Range: 0 to 20. Returns: \"\"\" return self . app . applyDiffuseGlow ( graininess , amount , clear_amount ) def applyAverage ( self ): \"\"\"Applies the average filter.\"\"\" return self . app . applyAverage () def applyBlur ( self ): \"\"\"Applies the blur filter.\"\"\" return self . app . applyBlur () def applyBlurMore ( self ): \"\"\"Applies the blur more filter.\"\"\" return self . app . applyBlurMore () def applyClouds ( self ): \"\"\"Applies the clouds filter.\"\"\" return self . app . applyClouds () def applyCustomFilter ( self , characteristics , scale , offset ): \"\"\"Applies the custom filter.\"\"\" return self . app . applyCustomFilter ( characteristics , scale , offset ) def applyDeInterlace ( self , eliminateFields , createFields ): \"\"\"Applies the de-interlace filter.\"\"\" return self . app . applyDeInterlace ( eliminateFields , createFields ) def applyDespeckle ( self ): return self . app . applyDespeckle () def applyDifferenceClouds ( self ): \"\"\"Applies the difference clouds filter.\"\"\" return self . app . applyDifferenceClouds () def applyDisplace ( self , horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ): \"\"\"Applies the displace filter.\"\"\" return self . app . applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ) def applyDustAndScratches ( self , radius , threshold ): \"\"\"Applies the dust and scratches filter.\"\"\" return self . app . applyDustAndScratches ( radius , threshold ) def applyGaussianBlur ( self , radius ): \"\"\"Applies the gaussian blur filter.\"\"\" return self . app . applyGaussianBlur ( radius ) def applyGlassEffect ( self , distortion , smoothness , scaling , invert , texture , textureFile , ): return self . app . applyGlassEffect ( distortion , smoothness , scaling , invert , texture , textureFile , ) def applyHighPass ( self , radius ): \"\"\"Applies the high pass filter.\"\"\" return self . app . applyHighPass ( radius ) def applyLensBlur ( self , source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ): \"\"\"Apply the lens blur filter.\"\"\" return self . app . applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ) def applyLensFlare ( self , brightness , flareCenter , lensType ): return self . app . applyLensFlare ( brightness , flareCenter , lensType ) def applyMaximum ( self , radius ): self . app . applyMaximum ( radius ) def applyMedianNoise ( self , radius ): self . app . applyMedianNoise ( radius ) def applyMinimum ( self , radius ): self . app . applyMinimum ( radius ) def applyMotionBlur ( self , angle , radius ): self . app . applyMotionBlur ( angle , radius ) def applyNTSC ( self ): self . app . applyNTSC () def applyOceanRipple ( self , size , magnitude ): self . app . applyOceanRipple ( size , magnitude ) def applyOffset ( self , horizontal , vertical , undefinedAreas ): self . app . applyOffset ( horizontal , vertical , undefinedAreas ) def applyPinch ( self , amount ): self . app . applyPinch ( amount ) def remove ( self ): \"\"\"Removes this layer from the document.\"\"\" self . app . delete () def rasterize ( self , target : RasterizeType ): self . app . rasterize ( target ) def posterize ( self , levels ): self . app . posterize ( levels ) def move ( self , relativeObject , insertionLocation ): self . app . move ( relativeObject , insertionLocation ) def merge ( self ): return ArtLayer ( self . app . merge ()) def link ( self , with_layer ): self . app . link ( with_layer ) def unlink ( self ): \"\"\"Unlink this layer from any linked layers.\"\"\" self . app . unlink () def invert ( self ): self . app . invert () def duplicate ( self , relativeObject = None , insertionLocation = None ): return ArtLayer ( self . app . duplicate ( relativeObject , insertionLocation ))","title":"ArtLayer"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.bounds","text":"The bounding rectangle of the layer.","title":"bounds"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.fillOpacity","text":"The interior opacity of the layer. Range: 0.0 to 100.0.","title":"fillOpacity"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.grouped","text":"If true, the layer is grouped with the layer below.","title":"grouped"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.isBackgroundLayer","text":"","title":"isBackgroundLayer"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.kind","text":"Sets the layer kind (such as \u2018text layer\u2019) for an empty layer. Valid only when the layer is empty and when isBackgroundLayer is false. You can use the \u2018kind \u2018 property to make a background layer a normal layer; however, to make a layer a background layer, you must set isBackgroundLayer to true.","title":"kind"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.layerMaskDensity","text":"The density of the layer mask (between 0.0 and 100.0).","title":"layerMaskDensity"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.layerMaskFeather","text":"The feather of the layer mask (between 0.0 and 250.0).","title":"layerMaskFeather"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.linkedLayers","text":"Get all layers linked to this layer. Returns: Name Type Description list list Layer objects","title":"linkedLayers"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.opacity","text":"The master opacity of the layer.","title":"opacity"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.parent","text":"The object\u2019s container.","title":"parent"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.pixelsLocked","text":"If true, the pixels in the layer\u2019s image cannot be edited.","title":"pixelsLocked"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.positionLocked","text":"within the layer.","title":"positionLocked"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.textItem","text":"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. Returns: Name Type Description TextItem TextItem","title":"textItem"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.adjustBrightnessContrast","text":"Adjusts the brightness and contrast. Parameters: Name Type Description Default brightness int The brightness amount. Range: -100 to 100. required contrast int The contrast amount. Range: -100 to 100. required Source code in photoshop/api/_artlayer.py 270 271 272 273 274 275 276 277 278 def adjustBrightnessContrast ( self , brightness , contrast ): \"\"\"Adjusts the brightness and contrast. Args: brightness (int): The brightness amount. Range: -100 to 100. contrast (int): The contrast amount. Range: -100 to 100. \"\"\" return self . app . adjustBrightnessContrast ( brightness , contrast )","title":"adjustBrightnessContrast()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.adjustColorBalance","text":"Adjusts the color balance of the layer\u2019s component channels. Parameters: Name Type Description Default shadows The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required midtones The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required highlights The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. required preserveLuminosity If true, luminosity is preserved. required Source code in photoshop/api/_artlayer.py 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 def adjustColorBalance ( self , shadows , midtones , highlights , preserveLuminosity , ): \"\"\"Adjusts the color balance of the layer\u2019s component channels. Args: shadows: The adjustments for the shadows. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. midtones: The adjustments for the midtones. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. highlights: The adjustments for the highlights. The array must include three values (in the range -100 to 100), which represent cyan or red, magenta or green, and yellow or blue, when the document mode is CMYK or RGB. preserveLuminosity: If true, luminosity is preserved. \"\"\" return self . app . adjustColorBalance ( shadows , midtones , highlights , preserveLuminosity , )","title":"adjustColorBalance()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.adjustCurves","text":"Adjusts the tonal range of the selected channel using up to fourteen points. Parameters: Name Type Description Default curveShape The curve points. The number of points must be between 2 and 14. required Source code in photoshop/api/_artlayer.py 312 313 314 315 316 317 318 319 320 321 322 323 324 325 def adjustCurves ( self , curveShape ): \"\"\"Adjusts the tonal range of the selected channel using up to fourteen points. Args: curveShape: The curve points. The number of points must be between 2 and 14. Returns: \"\"\" return self . app . adjustCurves ( curveShape )","title":"adjustCurves()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.adjustLevels","text":"Adjusts levels of the selected channels. Parameters: Name Type Description Default inputRangeStart required inputRangeEnd required inputRangeGamma required outputRangeStart required outputRangeEnd required Source code in photoshop/api/_artlayer.py 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 def adjustLevels ( self , inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , ): \"\"\"Adjusts levels of the selected channels. Args: inputRangeStart: inputRangeEnd: inputRangeGamma: outputRangeStart: outputRangeEnd: Returns: \"\"\" return self . app . adjustLevels ( inputRangeStart , inputRangeEnd , inputRangeGamma , outputRangeStart , outputRangeEnd , )","title":"adjustLevels()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyAverage","text":"Applies the average filter. Source code in photoshop/api/_artlayer.py 371 372 373 def applyAverage ( self ): \"\"\"Applies the average filter.\"\"\" return self . app . applyAverage ()","title":"applyAverage()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyBlur","text":"Applies the blur filter. Source code in photoshop/api/_artlayer.py 375 376 377 def applyBlur ( self ): \"\"\"Applies the blur filter.\"\"\" return self . app . applyBlur ()","title":"applyBlur()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyBlurMore","text":"Applies the blur more filter. Source code in photoshop/api/_artlayer.py 379 380 381 def applyBlurMore ( self ): \"\"\"Applies the blur more filter.\"\"\" return self . app . applyBlurMore ()","title":"applyBlurMore()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyClouds","text":"Applies the clouds filter. Source code in photoshop/api/_artlayer.py 383 384 385 def applyClouds ( self ): \"\"\"Applies the clouds filter.\"\"\" return self . app . applyClouds ()","title":"applyClouds()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyCustomFilter","text":"Applies the custom filter. Source code in photoshop/api/_artlayer.py 387 388 389 def applyCustomFilter ( self , characteristics , scale , offset ): \"\"\"Applies the custom filter.\"\"\" return self . app . applyCustomFilter ( characteristics , scale , offset )","title":"applyCustomFilter()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDeInterlace","text":"Applies the de-interlace filter. Source code in photoshop/api/_artlayer.py 391 392 393 def applyDeInterlace ( self , eliminateFields , createFields ): \"\"\"Applies the de-interlace filter.\"\"\" return self . app . applyDeInterlace ( eliminateFields , createFields )","title":"applyDeInterlace()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDifferenceClouds","text":"Applies the difference clouds filter. Source code in photoshop/api/_artlayer.py 398 399 400 def applyDifferenceClouds ( self ): \"\"\"Applies the difference clouds filter.\"\"\" return self . app . applyDifferenceClouds ()","title":"applyDifferenceClouds()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDiffuseGlow","text":"Applies the diffuse glow filter. Parameters: Name Type Description Default graininess The amount of graininess. Range: 0 to 10. required amount The glow amount. Range: 0 to 20. required clear_amount The clear amount. Range: 0 to 20. required Source code in photoshop/api/_artlayer.py 358 359 360 361 362 363 364 365 366 367 368 369 def applyDiffuseGlow ( self , graininess , amount , clear_amount ): \"\"\"Applies the diffuse glow filter. Args: graininess: The amount of graininess. Range: 0 to 10. amount: The glow amount. Range: 0 to 20. clear_amount: The clear amount. Range: 0 to 20. Returns: \"\"\" return self . app . applyDiffuseGlow ( graininess , amount , clear_amount )","title":"applyDiffuseGlow()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDisplace","text":"Applies the displace filter. Source code in photoshop/api/_artlayer.py 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 def applyDisplace ( self , horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , ): \"\"\"Applies the displace filter.\"\"\" return self . app . applyDisplace ( horizontalScale , verticalScale , displacementType , undefinedAreas , displacementMapFile , )","title":"applyDisplace()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyDustAndScratches","text":"Applies the dust and scratches filter. Source code in photoshop/api/_artlayer.py 419 420 421 def applyDustAndScratches ( self , radius , threshold ): \"\"\"Applies the dust and scratches filter.\"\"\" return self . app . applyDustAndScratches ( radius , threshold )","title":"applyDustAndScratches()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyGaussianBlur","text":"Applies the gaussian blur filter. Source code in photoshop/api/_artlayer.py 423 424 425 def applyGaussianBlur ( self , radius ): \"\"\"Applies the gaussian blur filter.\"\"\" return self . app . applyGaussianBlur ( radius )","title":"applyGaussianBlur()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyHighPass","text":"Applies the high pass filter. Source code in photoshop/api/_artlayer.py 445 446 447 def applyHighPass ( self , radius ): \"\"\"Applies the high pass filter.\"\"\" return self . app . applyHighPass ( radius )","title":"applyHighPass()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.applyLensBlur","text":"Apply the lens blur filter. Source code in photoshop/api/_artlayer.py 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 def applyLensBlur ( self , source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , ): \"\"\"Apply the lens blur filter.\"\"\" return self . app . applyLensBlur ( source , focalDistance , invertDepthMap , shape , radius , bladeCurvature , rotation , brightness , threshold , amount , distribution , monochromatic , )","title":"applyLensBlur()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.remove","text":"Removes this layer from the document. Source code in photoshop/api/_artlayer.py 507 508 509 def remove ( self ): \"\"\"Removes this layer from the document.\"\"\" self . app . delete ()","title":"remove()"},{"location":"reference/photoshop/api/_artlayer/#photoshop.api._artlayer.ArtLayer.unlink","text":"Unlink this layer from any linked layers. Source code in photoshop/api/_artlayer.py 526 527 528 def unlink ( self ): \"\"\"Unlink this layer from any linked layers.\"\"\" self . app . unlink ()","title":"unlink()"},{"location":"reference/photoshop/api/_artlayers/","text":"ArtLayers Bases: Photoshop The collection of art layer objects in the document. Source code in photoshop/api/_artlayers.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 class ArtLayers ( Photoshop ): \"\"\"The collection of art layer objects in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , ) @property def _layers ( self ): return list ( self . app ) def __len__ ( self ): return self . length def __iter__ ( self ): for layer in self . app : yield layer def __getitem__ ( self , key : str ): \"\"\"Access a given ArtLayer using dictionary key lookup.\"\"\" try : return ArtLayer ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { key } \"' ) @property def length ( self ): return len ( self . _layers ) @property def parent ( self ): return self . app . parent @property def typename ( self ): return self . app . typename def add ( self ): \"\"\"Adds an element.\"\"\" return ArtLayer ( self . app . add ()) def getByIndex ( self , index : int ): \"\"\"Access ArtLayer using list index lookup.\"\"\" return ArtLayer ( self . _layers [ index ]) def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name. Raises: PhotoshopPythonAPIError: Could not find a artLayer. \"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { name } \"' ) def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove () __getitem__ ( key ) Access a given ArtLayer using dictionary key lookup. Source code in photoshop/api/_artlayers.py 31 32 33 34 35 36 def __getitem__ ( self , key : str ): \"\"\"Access a given ArtLayer using dictionary key lookup.\"\"\" try : return ArtLayer ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { key } \"' ) add () Adds an element. Source code in photoshop/api/_artlayers.py 50 51 52 def add ( self ): \"\"\"Adds an element.\"\"\" return ArtLayer ( self . app . add ()) getByIndex ( index ) Access ArtLayer using list index lookup. Source code in photoshop/api/_artlayers.py 54 55 56 def getByIndex ( self , index : int ): \"\"\"Access ArtLayer using list index lookup.\"\"\" return ArtLayer ( self . _layers [ index ]) getByName ( name ) Get the first element in the collection with the provided name. Raises: Type Description PhotoshopPythonAPIError Could not find a artLayer. Source code in photoshop/api/_artlayers.py 58 59 60 61 62 63 64 65 66 67 def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name. Raises: PhotoshopPythonAPIError: Could not find a artLayer. \"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { name } \"' ) removeAll () Deletes all elements. Source code in photoshop/api/_artlayers.py 69 70 71 72 def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"artlayers"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers","text":"Bases: Photoshop The collection of art layer objects in the document. Source code in photoshop/api/_artlayers.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 class ArtLayers ( Photoshop ): \"\"\"The collection of art layer objects in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , ) @property def _layers ( self ): return list ( self . app ) def __len__ ( self ): return self . length def __iter__ ( self ): for layer in self . app : yield layer def __getitem__ ( self , key : str ): \"\"\"Access a given ArtLayer using dictionary key lookup.\"\"\" try : return ArtLayer ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { key } \"' ) @property def length ( self ): return len ( self . _layers ) @property def parent ( self ): return self . app . parent @property def typename ( self ): return self . app . typename def add ( self ): \"\"\"Adds an element.\"\"\" return ArtLayer ( self . app . add ()) def getByIndex ( self , index : int ): \"\"\"Access ArtLayer using list index lookup.\"\"\" return ArtLayer ( self . _layers [ index ]) def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name. Raises: PhotoshopPythonAPIError: Could not find a artLayer. \"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { name } \"' ) def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"ArtLayers"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.__getitem__","text":"Access a given ArtLayer using dictionary key lookup. Source code in photoshop/api/_artlayers.py 31 32 33 34 35 36 def __getitem__ ( self , key : str ): \"\"\"Access a given ArtLayer using dictionary key lookup.\"\"\" try : return ArtLayer ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { key } \"' )","title":"__getitem__()"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.add","text":"Adds an element. Source code in photoshop/api/_artlayers.py 50 51 52 def add ( self ): \"\"\"Adds an element.\"\"\" return ArtLayer ( self . app . add ())","title":"add()"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.getByIndex","text":"Access ArtLayer using list index lookup. Source code in photoshop/api/_artlayers.py 54 55 56 def getByIndex ( self , index : int ): \"\"\"Access ArtLayer using list index lookup.\"\"\" return ArtLayer ( self . _layers [ index ])","title":"getByIndex()"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.getByName","text":"Get the first element in the collection with the provided name. Raises: Type Description PhotoshopPythonAPIError Could not find a artLayer. Source code in photoshop/api/_artlayers.py 58 59 60 61 62 63 64 65 66 67 def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name. Raises: PhotoshopPythonAPIError: Could not find a artLayer. \"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find an artLayer named \" { name } \"' )","title":"getByName()"},{"location":"reference/photoshop/api/_artlayers/#photoshop.api._artlayers.ArtLayers.removeAll","text":"Deletes all elements. Source code in photoshop/api/_artlayers.py 69 70 71 72 def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"removeAll()"},{"location":"reference/photoshop/api/_channel/","text":"","title":"channel"},{"location":"reference/photoshop/api/_channels/","text":"","title":"channels"},{"location":"reference/photoshop/api/_core/","text":"This class provides all photoshop API core functions. Photoshop Core API for all photoshop objects. Source code in photoshop/api/_core.py 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 class Photoshop : \"\"\"Core API for all photoshop objects.\"\"\" _root = \"Photoshop\" _reg_path = \"SOFTWARE \\\\ Adobe \\\\ Photoshop\" object_name : str = \"Application\" def __init__ ( self , ps_version : Optional [ str ] = None , parent : Any = None ): \"\"\" Initialize the Photoshop core object. Args: ps_version: Optional, Photoshop version to look for explicitly in registry. parent: Optional, parent instance to use as app object. \"\"\" # Establish the initial app and program ID ps_version = os . getenv ( \"PS_VERSION\" , ps_version ) self . _app_id = PHOTOSHOP_VERSION_MAPPINGS . get ( ps_version , \"\" ) self . _has_parent , self . adobe , self . app = False , None , None # Store current photoshop version if ps_version : os . environ [ \"PS_VERSION\" ] = ps_version # Establish the application object using provided version ID if self . app_id : self . app = self . _get_application_object ([ self . app_id ]) if not self . app : # Attempt unsuccessful self . _logger . debug ( f \"Unable to retrieve Photoshop object ' { self . typename } ' using version ' { ps_version } '.\" ) # Look for version ID in registry data if not self . app : versions = self . _get_photoshop_versions () self . app = self . _get_application_object ( versions ) if not self . app : # All attempts exhausted raise PhotoshopPythonAPIError ( \"Please check if you have Photoshop installed correctly.\" ) # Add the parent app object if parent : self . adobe = self . app self . app = parent self . _has_parent = True def __repr__ ( self ): return self def __call__ ( self , * args , ** kwargs ): return self . app def __str__ ( self ): return f \" { self . __class__ . __name__ } < { self . program_name } >\" def __getattribute__ ( self , item ): try : return super () . __getattribute__ ( item ) except AttributeError : return getattr ( self . app , item ) \"\"\" * Debug Logger \"\"\" @cached_property def _debug ( self ) -> bool : \"\"\"bool: Enable DEBUG level in logger if PS_DEBUG environment variable is truthy.\"\"\" return bool ( os . getenv ( \"PS_DEBUG\" , \"False\" ) . lower () in [ \"y\" , \"t\" , \"on\" , \"yes\" , \"true\" ]) @cached_property def _logger ( self ) -> Logger : \"\"\"Logger: Logging object for warning output.\"\"\" logr = getLogger ( \"photoshop\" ) logr . setLevel ( DEBUG if self . _debug else CRITICAL ) return logr \"\"\" * Properties \"\"\" @property def typename ( self ) -> str : \"\"\"str: Current typename.\"\"\" return self . __class__ . __name__ @property def program_name ( self ) -> str : \"\"\"str: Formatted program name found in the Windows Classes registry, e.g. Photoshop.Application.140. Examples: - Photoshop.ActionDescriptor - Photoshop.ActionDescriptor.140 - Photoshop.ActionList - Photoshop.ActionList.140 - Photoshop.ActionReference - Photoshop.ActionReference.140 - Photoshop.Application - Photoshop.Application.140 - Photoshop.BatchOptions - Photoshop.BatchOptions.140 - Photoshop.BitmapConversionOptions - Photoshop.BMPSaveOptions - Photoshop.BMPSaveOptions.140 - Photoshop.CameraRAWOpenOptions - Photoshop.CameraRAWOpenOptions.140 \"\"\" if self . app_id : return f \" { self . _root } . { self . object_name } . { self . app_id } \" return f \" { self . _root } . { self . object_name } \" @property def app_id ( self ) -> str : \"\"\"str: Photoshop version ID from Windows registry, e.g. 180.\"\"\" return self . _app_id @app_id . setter def app_id ( self , value : str ): self . _app_id = value \"\"\" * Private Methods \"\"\" def _flag_as_method ( self , * names : str ): \"\"\" * This is a hack for Photoshop's broken COM implementation. * Photoshop does not implement 'IDispatch::GetTypeInfo', so when getting a field from the COM object, comtypes will first try to fetch it as a property, then treat it as a method if it fails. * In this case, Photoshop does not return the proper error code, since it blindly treats the property getter as a method call. * Fortunately, comtypes provides a way to explicitly flag methods. \"\"\" if isinstance ( self . app , FullyDynamicDispatch ): self . app . _FlagAsMethod ( * names ) def _get_photoshop_versions ( self ) -> List [ str ]: \"\"\"Retrieve a list of Photoshop version ID's from registry.\"\"\" with suppress ( OSError , IndexError ): key = self . _open_key ( self . _reg_path ) key_count = winreg . QueryInfoKey ( key )[ 0 ] versions = [ winreg . EnumKey ( key , i ) . split ( \".\" )[ 0 ] for i in range ( key_count )] # Sort from latest version to oldest, use blank version as a fallback return [ * sorted ( versions , reverse = True ), \"\" ] self . _logger . debug ( \"Unable to find Photoshop version number in HKEY_LOCAL_MACHINE registry!\" ) return [] def _get_application_object ( self , versions : List [ str ] = None ) -> Optional [ Dispatch ]: \"\"\" Try each version string until a valid Photoshop application Dispatch object is returned. Args: versions: List of Photoshop version ID's found in registry. Returns: Photoshop application Dispatch object. Raises: OSError: If a Dispatch object wasn't resolved. \"\"\" for v in versions : self . app_id = v with suppress ( OSError ): return CreateObject ( self . program_name , dynamic = True ) return \"\"\" * Public Methods \"\"\" def get_application_path ( self ) -> str : \"\"\"str: The absolute path of Photoshop installed location.\"\"\" key = self . open_key ( f \" { self . _reg_path } \\\\ { self . program_id } \" ) return winreg . QueryValueEx ( key , \"ApplicationPath\" )[ 0 ] def get_plugin_path ( self ) -> str : \"\"\"str: The absolute plugin path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Plug-ins\" ) def get_presets_path ( self ) -> str : \"\"\"str: The absolute presets path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Presets\" ) def get_script_path ( self ) -> str : \"\"\"str: The absolute scripts path of Photoshop.\"\"\" return os . path . join ( self . presets_path , \"Scripts\" ) def eval_javascript ( self , javascript : str , Arguments : Any = None , ExecutionMode : Any = None ) -> str : \"\"\"Instruct the application to execute javascript code.\"\"\" executor = self . adobe if self . _has_parent else self . app return executor . doJavaScript ( javascript , Arguments , ExecutionMode ) \"\"\" * Private Static Methods \"\"\" @staticmethod def _open_key ( key : str ) -> winreg . HKEYType : \"\"\"Open the register key. Args: key: Photoshop application key path. Returns: The handle to the specified key. Raises: OSError: if registry key cannot be read. \"\"\" machine_type = platform . machine () mappings = { \"AMD64\" : winreg . KEY_WOW64_64KEY } access = winreg . KEY_READ | mappings . get ( machine_type , winreg . KEY_WOW64_32KEY ) try : return winreg . OpenKey ( key = winreg . HKEY_LOCAL_MACHINE , sub_key = key , access = access ) except FileNotFoundError as err : raise OSError ( \"Failed to read the registration: < {path} > \\n \" \"Please check if you have Photoshop installed correctly.\" . format ( path = f \"HKEY_LOCAL_MACHINE \\\\ { key } \" ) ) from err app_id : str property writable program_name : str property Examples: Photoshop.ActionDescriptor Photoshop.ActionDescriptor.140 Photoshop.ActionList Photoshop.ActionList.140 Photoshop.ActionReference Photoshop.ActionReference.140 Photoshop.Application Photoshop.Application.140 Photoshop.BatchOptions Photoshop.BatchOptions.140 Photoshop.BitmapConversionOptions Photoshop.BMPSaveOptions Photoshop.BMPSaveOptions.140 Photoshop.CameraRAWOpenOptions Photoshop.CameraRAWOpenOptions.140 typename : str property __init__ ( ps_version = None , parent = None ) Initialize the Photoshop core object. Parameters: Name Type Description Default ps_version Optional [ str ] Optional, Photoshop version to look for explicitly in registry. None parent Any Optional, parent instance to use as app object. None Source code in photoshop/api/_core.py 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 def __init__ ( self , ps_version : Optional [ str ] = None , parent : Any = None ): \"\"\" Initialize the Photoshop core object. Args: ps_version: Optional, Photoshop version to look for explicitly in registry. parent: Optional, parent instance to use as app object. \"\"\" # Establish the initial app and program ID ps_version = os . getenv ( \"PS_VERSION\" , ps_version ) self . _app_id = PHOTOSHOP_VERSION_MAPPINGS . get ( ps_version , \"\" ) self . _has_parent , self . adobe , self . app = False , None , None # Store current photoshop version if ps_version : os . environ [ \"PS_VERSION\" ] = ps_version # Establish the application object using provided version ID if self . app_id : self . app = self . _get_application_object ([ self . app_id ]) if not self . app : # Attempt unsuccessful self . _logger . debug ( f \"Unable to retrieve Photoshop object ' { self . typename } ' using version ' { ps_version } '.\" ) # Look for version ID in registry data if not self . app : versions = self . _get_photoshop_versions () self . app = self . _get_application_object ( versions ) if not self . app : # All attempts exhausted raise PhotoshopPythonAPIError ( \"Please check if you have Photoshop installed correctly.\" ) # Add the parent app object if parent : self . adobe = self . app self . app = parent self . _has_parent = True eval_javascript ( javascript , Arguments = None , ExecutionMode = None ) Instruct the application to execute javascript code. Source code in photoshop/api/_core.py 215 216 217 218 def eval_javascript ( self , javascript : str , Arguments : Any = None , ExecutionMode : Any = None ) -> str : \"\"\"Instruct the application to execute javascript code.\"\"\" executor = self . adobe if self . _has_parent else self . app return executor . doJavaScript ( javascript , Arguments , ExecutionMode ) get_application_path () Source code in photoshop/api/_core.py 198 199 200 201 def get_application_path ( self ) -> str : \"\"\"str: The absolute path of Photoshop installed location.\"\"\" key = self . open_key ( f \" { self . _reg_path } \\\\ { self . program_id } \" ) return winreg . QueryValueEx ( key , \"ApplicationPath\" )[ 0 ] get_plugin_path () Source code in photoshop/api/_core.py 203 204 205 def get_plugin_path ( self ) -> str : \"\"\"str: The absolute plugin path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Plug-ins\" ) get_presets_path () Source code in photoshop/api/_core.py 207 208 209 def get_presets_path ( self ) -> str : \"\"\"str: The absolute presets path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Presets\" ) get_script_path () Source code in photoshop/api/_core.py 211 212 213 def get_script_path ( self ) -> str : \"\"\"str: The absolute scripts path of Photoshop.\"\"\" return os . path . join ( self . presets_path , \"Scripts\" )","title":"core"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop","text":"Core API for all photoshop objects. Source code in photoshop/api/_core.py 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 class Photoshop : \"\"\"Core API for all photoshop objects.\"\"\" _root = \"Photoshop\" _reg_path = \"SOFTWARE \\\\ Adobe \\\\ Photoshop\" object_name : str = \"Application\" def __init__ ( self , ps_version : Optional [ str ] = None , parent : Any = None ): \"\"\" Initialize the Photoshop core object. Args: ps_version: Optional, Photoshop version to look for explicitly in registry. parent: Optional, parent instance to use as app object. \"\"\" # Establish the initial app and program ID ps_version = os . getenv ( \"PS_VERSION\" , ps_version ) self . _app_id = PHOTOSHOP_VERSION_MAPPINGS . get ( ps_version , \"\" ) self . _has_parent , self . adobe , self . app = False , None , None # Store current photoshop version if ps_version : os . environ [ \"PS_VERSION\" ] = ps_version # Establish the application object using provided version ID if self . app_id : self . app = self . _get_application_object ([ self . app_id ]) if not self . app : # Attempt unsuccessful self . _logger . debug ( f \"Unable to retrieve Photoshop object ' { self . typename } ' using version ' { ps_version } '.\" ) # Look for version ID in registry data if not self . app : versions = self . _get_photoshop_versions () self . app = self . _get_application_object ( versions ) if not self . app : # All attempts exhausted raise PhotoshopPythonAPIError ( \"Please check if you have Photoshop installed correctly.\" ) # Add the parent app object if parent : self . adobe = self . app self . app = parent self . _has_parent = True def __repr__ ( self ): return self def __call__ ( self , * args , ** kwargs ): return self . app def __str__ ( self ): return f \" { self . __class__ . __name__ } < { self . program_name } >\" def __getattribute__ ( self , item ): try : return super () . __getattribute__ ( item ) except AttributeError : return getattr ( self . app , item ) \"\"\" * Debug Logger \"\"\" @cached_property def _debug ( self ) -> bool : \"\"\"bool: Enable DEBUG level in logger if PS_DEBUG environment variable is truthy.\"\"\" return bool ( os . getenv ( \"PS_DEBUG\" , \"False\" ) . lower () in [ \"y\" , \"t\" , \"on\" , \"yes\" , \"true\" ]) @cached_property def _logger ( self ) -> Logger : \"\"\"Logger: Logging object for warning output.\"\"\" logr = getLogger ( \"photoshop\" ) logr . setLevel ( DEBUG if self . _debug else CRITICAL ) return logr \"\"\" * Properties \"\"\" @property def typename ( self ) -> str : \"\"\"str: Current typename.\"\"\" return self . __class__ . __name__ @property def program_name ( self ) -> str : \"\"\"str: Formatted program name found in the Windows Classes registry, e.g. Photoshop.Application.140. Examples: - Photoshop.ActionDescriptor - Photoshop.ActionDescriptor.140 - Photoshop.ActionList - Photoshop.ActionList.140 - Photoshop.ActionReference - Photoshop.ActionReference.140 - Photoshop.Application - Photoshop.Application.140 - Photoshop.BatchOptions - Photoshop.BatchOptions.140 - Photoshop.BitmapConversionOptions - Photoshop.BMPSaveOptions - Photoshop.BMPSaveOptions.140 - Photoshop.CameraRAWOpenOptions - Photoshop.CameraRAWOpenOptions.140 \"\"\" if self . app_id : return f \" { self . _root } . { self . object_name } . { self . app_id } \" return f \" { self . _root } . { self . object_name } \" @property def app_id ( self ) -> str : \"\"\"str: Photoshop version ID from Windows registry, e.g. 180.\"\"\" return self . _app_id @app_id . setter def app_id ( self , value : str ): self . _app_id = value \"\"\" * Private Methods \"\"\" def _flag_as_method ( self , * names : str ): \"\"\" * This is a hack for Photoshop's broken COM implementation. * Photoshop does not implement 'IDispatch::GetTypeInfo', so when getting a field from the COM object, comtypes will first try to fetch it as a property, then treat it as a method if it fails. * In this case, Photoshop does not return the proper error code, since it blindly treats the property getter as a method call. * Fortunately, comtypes provides a way to explicitly flag methods. \"\"\" if isinstance ( self . app , FullyDynamicDispatch ): self . app . _FlagAsMethod ( * names ) def _get_photoshop_versions ( self ) -> List [ str ]: \"\"\"Retrieve a list of Photoshop version ID's from registry.\"\"\" with suppress ( OSError , IndexError ): key = self . _open_key ( self . _reg_path ) key_count = winreg . QueryInfoKey ( key )[ 0 ] versions = [ winreg . EnumKey ( key , i ) . split ( \".\" )[ 0 ] for i in range ( key_count )] # Sort from latest version to oldest, use blank version as a fallback return [ * sorted ( versions , reverse = True ), \"\" ] self . _logger . debug ( \"Unable to find Photoshop version number in HKEY_LOCAL_MACHINE registry!\" ) return [] def _get_application_object ( self , versions : List [ str ] = None ) -> Optional [ Dispatch ]: \"\"\" Try each version string until a valid Photoshop application Dispatch object is returned. Args: versions: List of Photoshop version ID's found in registry. Returns: Photoshop application Dispatch object. Raises: OSError: If a Dispatch object wasn't resolved. \"\"\" for v in versions : self . app_id = v with suppress ( OSError ): return CreateObject ( self . program_name , dynamic = True ) return \"\"\" * Public Methods \"\"\" def get_application_path ( self ) -> str : \"\"\"str: The absolute path of Photoshop installed location.\"\"\" key = self . open_key ( f \" { self . _reg_path } \\\\ { self . program_id } \" ) return winreg . QueryValueEx ( key , \"ApplicationPath\" )[ 0 ] def get_plugin_path ( self ) -> str : \"\"\"str: The absolute plugin path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Plug-ins\" ) def get_presets_path ( self ) -> str : \"\"\"str: The absolute presets path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Presets\" ) def get_script_path ( self ) -> str : \"\"\"str: The absolute scripts path of Photoshop.\"\"\" return os . path . join ( self . presets_path , \"Scripts\" ) def eval_javascript ( self , javascript : str , Arguments : Any = None , ExecutionMode : Any = None ) -> str : \"\"\"Instruct the application to execute javascript code.\"\"\" executor = self . adobe if self . _has_parent else self . app return executor . doJavaScript ( javascript , Arguments , ExecutionMode ) \"\"\" * Private Static Methods \"\"\" @staticmethod def _open_key ( key : str ) -> winreg . HKEYType : \"\"\"Open the register key. Args: key: Photoshop application key path. Returns: The handle to the specified key. Raises: OSError: if registry key cannot be read. \"\"\" machine_type = platform . machine () mappings = { \"AMD64\" : winreg . KEY_WOW64_64KEY } access = winreg . KEY_READ | mappings . get ( machine_type , winreg . KEY_WOW64_32KEY ) try : return winreg . OpenKey ( key = winreg . HKEY_LOCAL_MACHINE , sub_key = key , access = access ) except FileNotFoundError as err : raise OSError ( \"Failed to read the registration: < {path} > \\n \" \"Please check if you have Photoshop installed correctly.\" . format ( path = f \"HKEY_LOCAL_MACHINE \\\\ { key } \" ) ) from err","title":"Photoshop"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.app_id","text":"","title":"app_id"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.program_name","text":"Examples: Photoshop.ActionDescriptor Photoshop.ActionDescriptor.140 Photoshop.ActionList Photoshop.ActionList.140 Photoshop.ActionReference Photoshop.ActionReference.140 Photoshop.Application Photoshop.Application.140 Photoshop.BatchOptions Photoshop.BatchOptions.140 Photoshop.BitmapConversionOptions Photoshop.BMPSaveOptions Photoshop.BMPSaveOptions.140 Photoshop.CameraRAWOpenOptions Photoshop.CameraRAWOpenOptions.140","title":"program_name"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.typename","text":"","title":"typename"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.__init__","text":"Initialize the Photoshop core object. Parameters: Name Type Description Default ps_version Optional [ str ] Optional, Photoshop version to look for explicitly in registry. None parent Any Optional, parent instance to use as app object. None Source code in photoshop/api/_core.py 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 def __init__ ( self , ps_version : Optional [ str ] = None , parent : Any = None ): \"\"\" Initialize the Photoshop core object. Args: ps_version: Optional, Photoshop version to look for explicitly in registry. parent: Optional, parent instance to use as app object. \"\"\" # Establish the initial app and program ID ps_version = os . getenv ( \"PS_VERSION\" , ps_version ) self . _app_id = PHOTOSHOP_VERSION_MAPPINGS . get ( ps_version , \"\" ) self . _has_parent , self . adobe , self . app = False , None , None # Store current photoshop version if ps_version : os . environ [ \"PS_VERSION\" ] = ps_version # Establish the application object using provided version ID if self . app_id : self . app = self . _get_application_object ([ self . app_id ]) if not self . app : # Attempt unsuccessful self . _logger . debug ( f \"Unable to retrieve Photoshop object ' { self . typename } ' using version ' { ps_version } '.\" ) # Look for version ID in registry data if not self . app : versions = self . _get_photoshop_versions () self . app = self . _get_application_object ( versions ) if not self . app : # All attempts exhausted raise PhotoshopPythonAPIError ( \"Please check if you have Photoshop installed correctly.\" ) # Add the parent app object if parent : self . adobe = self . app self . app = parent self . _has_parent = True","title":"__init__()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.eval_javascript","text":"Instruct the application to execute javascript code. Source code in photoshop/api/_core.py 215 216 217 218 def eval_javascript ( self , javascript : str , Arguments : Any = None , ExecutionMode : Any = None ) -> str : \"\"\"Instruct the application to execute javascript code.\"\"\" executor = self . adobe if self . _has_parent else self . app return executor . doJavaScript ( javascript , Arguments , ExecutionMode )","title":"eval_javascript()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.get_application_path","text":"Source code in photoshop/api/_core.py 198 199 200 201 def get_application_path ( self ) -> str : \"\"\"str: The absolute path of Photoshop installed location.\"\"\" key = self . open_key ( f \" { self . _reg_path } \\\\ { self . program_id } \" ) return winreg . QueryValueEx ( key , \"ApplicationPath\" )[ 0 ]","title":"get_application_path()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.get_plugin_path","text":"Source code in photoshop/api/_core.py 203 204 205 def get_plugin_path ( self ) -> str : \"\"\"str: The absolute plugin path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Plug-ins\" )","title":"get_plugin_path()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.get_presets_path","text":"Source code in photoshop/api/_core.py 207 208 209 def get_presets_path ( self ) -> str : \"\"\"str: The absolute presets path of Photoshop.\"\"\" return os . path . join ( self . application_path , \"Presets\" )","title":"get_presets_path()"},{"location":"reference/photoshop/api/_core/#photoshop.api._core.Photoshop.get_script_path","text":"Source code in photoshop/api/_core.py 211 212 213 def get_script_path ( self ) -> str : \"\"\"str: The absolute scripts path of Photoshop.\"\"\" return os . path . join ( self . presets_path , \"Scripts\" )","title":"get_script_path()"},{"location":"reference/photoshop/api/_document/","text":"The active containment object for layers and all other objects. The basic canvas for the file. Access the object for the currently active document through Application.activeDocument. You can access other documents or iterate through all open documents using in the Application.documents collection. You can access individual documents in the list by index, or use Documents.getByName() to retrieve them by name. Create documents programmatically using the Documents.add() method. Document Bases: Photoshop The active containment object for the layers and all other objects in the script. the basic canvas for the file. Source code in photoshop/api/_document.py 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 class Document ( Photoshop ): \"\"\"The active containment object for the layers and all other objects in the script. the basic canvas for the file. \"\"\" # noqa: E501 object_name = \"Application\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"autoCount\" , \"changeMode\" , \"close\" , \"convertProfile\" , \"Flatten\" , \"mergeVisibleLayers\" , \"crop\" , \"export\" , \"duplicate\" , \"printOneCopy\" , \"rasterizeAllLayers\" , \"recordMeasurements\" , \"revealAll\" , \"save\" , \"saveAs\" , \"splitChannels\" , \"trap\" , \"trim\" , \"resizeImage\" , ) @property def artLayers ( self ) -> ArtLayers : return ArtLayers ( self . app . artLayers ) @property def activeLayer ( self ) -> PS_Layer : \"\"\"The selected layer.\"\"\" type_ = self . eval_javascript ( \"app.activeDocument.activeLayer.typename\" ) mappings = { \"LayerSet\" : LayerSet , \"ArtLayer\" : ArtLayer } func = mappings [ type_ ] return func ( self . app . activeLayer ) @activeLayer . setter def activeLayer ( self , layer ) -> NoReturn : \"\"\"Sets the select layer as active layer. Args: layer (._artlayer.ArtLayer or ._layerSet.LayerSet): The artLayer. \"\"\" self . app . activeLayer = layer @property def activeChannels ( self ): \"\"\"The selected channels.\"\"\" return self . app . activeChannels @activeChannels . setter def activeChannels ( self , channels ): self . app . activeChannels = channels @property def activeHistoryBrushSource ( self ): \"\"\"The history state to use with the history brush.\"\"\" return self . app . activeHistoryBrushSource @property def activeHistoryState ( self ): \"\"\"The current history state for this document.\"\"\" return self . app . activeHistoryState @activeHistoryState . setter def activeHistoryState ( self , state ): self . app . activeHistoryState = state @property def backgroundLayer ( self ): \"\"\"The background layer for the Document.\"\"\" return self . app . backgroundLayer @property def bitsPerChannel ( self ): \"\"\"The number of bits per channel.\"\"\" return self . app . bitsPerChannel @bitsPerChannel . setter def bitsPerChannel ( self , value ): self . app . bitsPerChannel = value @property def channels ( self ): return Channels ( self . app . channels ) @property def colorProfileName ( self ): \"\"\"The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile).\"\"\" return self . app . colorProfileName @colorProfileName . setter def colorProfileName ( self , name ): self . app . colorProfileName = name @property def colorProfileType ( self ): \"\"\"The type of color model that defines the working space of the Document.\"\"\" return self . app . colorProfileType @colorProfileType . setter def colorProfileType ( self , profile_type ): self . app . colorProfileType = profile_type @property def colorSamplers ( self ): \"\"\"The current color samplers associated with the Document.\"\"\" return self . app . colorSamplers @property def componentChannels ( self ): \"\"\"The color component channels for this Document.\"\"\" return self . app . componentChannels @property def countItems ( self ): \"\"\"The current count items in the Document.\"\"\" return self . app . countItems @property def fullName ( self ): \"\"\"The full path name of the Document.\"\"\" try : return Path ( self . app . fullName ) except COMError : self . eval_javascript ( 'alert (\"Please save your Document first!\",' '\" {} \")' . format ( self . name ), ) @property def height ( self ): \"\"\"The height of the Document.\"\"\" return self . app . Height @property def histogram ( self ): \"\"\"A histogram showing the number of pixels at each color intensity level for the composite channel.\"\"\" return self . app . Histogram @property def history_states ( self ): \"\"\"The history states collection in this Document.\"\"\" return self . app . HistoryStates @property def id ( self ): \"\"\"The unique ID of this Document.\"\"\" return self . app . Id @property def info ( self ): \"\"\"Metadata about the Document.\"\"\" return DocumentInfo ( self . app . info ) @property def layerComps ( self ): \"\"\"The layer comps collection in this Document.\"\"\" return LayerComps ( self . app . layerComps ) @property def layers ( self ): \"\"\"The layers collection in the Document.\"\"\" return Layers ( self . app . Layers ) @property def layerSets ( self ): \"\"\"The layer sets collection in the Document.\"\"\" return LayerSets ( self . app . layerSets ) @property def managed ( self ): \"\"\"If true, the Document is a workgroup Document.\"\"\" return self . app . Managed @property def measurement_scale ( self ): \"\"\"The measurement scale of the Document.\"\"\" return self . app . MeasurementScale @property def mode ( self ): \"\"\"The color profile.\"\"\" return self . app . Mode @property def name ( self ) -> str : \"\"\"The Document name.\"\"\" return self . app . name @property def parent ( self ): \"\"\"The object's container.\"\"\" return self . app . Parent @property def path ( self ) -> str : \"\"\"The path to the Document.\"\"\" try : return Path ( self . app . path ) except COMError : self . eval_javascript ( 'alert (\"Please save your Document first!\",' '\" {} \")' . format ( self . name ), ) @path . setter def path ( self , path : str ) -> NoReturn : self . app . fullName = path @property def pathItems ( self ): return self . app . pathItems @property def pixelAspectRatio ( self ): \"\"\"The (custom) pixel aspect ratio of the Document. Range: 0.100 to 10.000. \"\"\" return self . app . pixelAspectRatio @property def printSettings ( self ): \"\"\"Document print settings.\"\"\" return self . app . printSettings @property def quickMaskMode ( self ): \"\"\"If true, the document is in Quick Mask mode.\"\"\" return self . app . quickMaskMode @property def saved ( self ): \"\"\"If true, the Document been saved since the last change.\"\"\" return self . app . Saved @property def resolution ( self ): \"\"\"The resolution of the Document (in pixels per inch)\"\"\" return self . app . resolution @property def selection ( self ): \"\"\"The selected area of the Document.\"\"\" return Selection ( self . app . selection ) @property def typename ( self ): \"\"\"The class name of the object.\"\"\" return self . app . typename @property def cloudDocument ( self ): \"\"\"This document is in the cloud.\"\"\" return self . app . cloudDocument @property def cloudWorkAreaDirectory ( self ): \"\"\"Local directory for this cloud document.\"\"\" return self . app . cloudWorkAreaDirectory @property def width ( self ): return self . app . Width @property def xmpMetadata ( self ): \"\"\"The XMP properties of the Document. The Camera RAW settings are stored here.\"\"\" return self . app . xmpMetadata # Methods def autoCount ( self , * args , ** kwargs ): \"\"\"Counts the objects in the Document.\"\"\" return self . app . autoCount ( * args , ** kwargs ) def changeMode ( self , * args , ** kwargs ): \"\"\"Changes the mode of the Document.\"\"\" return self . app . changeMode ( * args , ** kwargs ) def close ( self , saving = SaveOptions . DoNotSaveChanges ): return self . app . close ( saving ) def convertProfile ( self ): return self . app . convertProfile () def flatten ( self ): \"\"\"Flattens all layers.\"\"\" return self . app . Flatten () def mergeVisibleLayers ( self ): \"\"\"Flattens all visible layers in the Document.\"\"\" return self . app . mergeVisibleLayers () def crop ( self , bounds : List [ int ], angle : Optional [ float ] = None , width : Optional [ int ] = None , height : Optional [ int ] = None , ): \"\"\"Crops the document. Args: bounds: Four coordinates for the region remaining after cropping. angle: The angle of cropping bounds. width: The width of the resulting document. height: The height of the resulting document. \"\"\" return self . app . crop ( bounds , angle , width , height ) def exportDocument ( self , file_path : str , exportAs : ExportType , options : Union [ ExportOptionsSaveForWeb ]): \"\"\"Exports the Document. Note: This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References: - https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working \"\"\" file_path = file_path . replace ( \" \\\\ \" , \"/\" ) self . app . export ( file_path , exportAs , options ) def duplicate ( self , name = None , merge_layers_only = False ): return Document ( self . app . duplicate ( name , merge_layers_only )) def paste ( self ): \"\"\"Pastes contents of the clipboard into the Document.\"\"\" self . eval_javascript ( \"app.activeDocument.paste()\" ) return self . activeLayer def print ( self ): \"\"\"Prints the document.\"\"\" return self . app . print () def printOneCopy ( self ): self . app . printOneCopy () def rasterizeAllLayers ( self ): return self . app . rasterizeAllLayers () def recordMeasurements ( self , source , dataPoints ): \"\"\"Records the measurements of document.\"\"\" self . app . recordMeasurements ( source , dataPoints ) def reveal_all ( self ): \"\"\"Expands the Document to show clipped sections.\"\"\" return self . app . revealAll () def save ( self ): \"\"\"Saves the Document.\"\"\" return self . app . save () def saveAs ( self , file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ): \"\"\"Saves the documents with the specified save options. Args: file_path (str): Absolute path of psd file. options (JPEGSaveOptions): Save options. asCopy (bool): \"\"\" return self . app . saveAs ( file_path , options , asCopy , extensionType ) def splitChannels ( self ): \"\"\"Splits the channels of the document.\"\"\" self . app . splitChannels () def suspendHistory ( self , historyString , javaScriptString ): \"\"\"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. \"\"\" self . eval_javascript ( f \"app.activeDocument.suspendHistory(' { historyString } ', ' { javaScriptString } ')\" ) def trap ( self , width : int ): \"\"\" Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. \"\"\" self . app . trap ( width ) def trim ( self , trim_type : TrimType , top : Optional [ bool ] = True , left : Optional [ bool ] = True , bottom : Optional [ bool ] = True , right : Optional [ bool ] = True , ): \"\"\"Trims the transparent area around the image on the specified sides of the canvas. Args: trim_type: The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels top: If true, trims away the top of the document. left: If true, trims away the left of the document. bottom: If true, trims away the bottom of the document. right: If true, trims away the right of the document. \"\"\" return self . app . trim ( trim_type , top , left , bottom , right ) def resizeImage ( self , width : int , height : int , resolution : int = 72 , automatic : int = 8 ): \"\"\"Changes the size of the image. Args: width: The desired width of the image. height: The desired height of the image. resolution: The resolution (in pixels per inch) automatic: Value for automatic. \"\"\" return self . app . resizeImage ( width , height , resolution , automatic ) activeChannels property writable The selected channels. activeHistoryBrushSource property The history state to use with the history brush. activeHistoryState property writable The current history state for this document. activeLayer : PS_Layer property writable The selected layer. backgroundLayer property The background layer for the Document. bitsPerChannel property writable The number of bits per channel. cloudDocument property This document is in the cloud. cloudWorkAreaDirectory property Local directory for this cloud document. colorProfileName property writable The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile). colorProfileType property writable The type of color model that defines the working space of the Document. colorSamplers property The current color samplers associated with the Document. componentChannels property The color component channels for this Document. countItems property The current count items in the Document. fullName property The full path name of the Document. height property The height of the Document. histogram property A histogram showing the number of pixels at each color intensity level for the composite channel. history_states property The history states collection in this Document. id property The unique ID of this Document. info property Metadata about the Document. layerComps property The layer comps collection in this Document. layerSets property The layer sets collection in the Document. layers property The layers collection in the Document. managed property If true, the Document is a workgroup Document. measurement_scale property The measurement scale of the Document. mode property The color profile. name : str property The Document name. parent property The object's container. path : str property writable The path to the Document. pixelAspectRatio property The (custom) pixel aspect ratio of the Document. Range: 0.100 to 10.000. printSettings property Document print settings. quickMaskMode property If true, the document is in Quick Mask mode. resolution property The resolution of the Document (in pixels per inch) saved property If true, the Document been saved since the last change. selection property The selected area of the Document. typename property The class name of the object. xmpMetadata property The XMP properties of the Document. The Camera RAW settings are stored here. autoCount ( * args , ** kwargs ) Counts the objects in the Document. Source code in photoshop/api/_document.py 336 337 338 def autoCount ( self , * args , ** kwargs ): \"\"\"Counts the objects in the Document.\"\"\" return self . app . autoCount ( * args , ** kwargs ) changeMode ( * args , ** kwargs ) Changes the mode of the Document. Source code in photoshop/api/_document.py 340 341 342 def changeMode ( self , * args , ** kwargs ): \"\"\"Changes the mode of the Document.\"\"\" return self . app . changeMode ( * args , ** kwargs ) crop ( bounds , angle = None , width = None , height = None ) Crops the document. Parameters: Name Type Description Default bounds List [ int ] Four coordinates for the region remaining after cropping. required angle Optional [ float ] The angle of cropping bounds. None width Optional [ int ] The width of the resulting document. None height Optional [ int ] The height of the resulting document. None Source code in photoshop/api/_document.py 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 def crop ( self , bounds : List [ int ], angle : Optional [ float ] = None , width : Optional [ int ] = None , height : Optional [ int ] = None , ): \"\"\"Crops the document. Args: bounds: Four coordinates for the region remaining after cropping. angle: The angle of cropping bounds. width: The width of the resulting document. height: The height of the resulting document. \"\"\" return self . app . crop ( bounds , angle , width , height ) exportDocument ( file_path , exportAs , options ) Exports the Document. Note This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working Source code in photoshop/api/_document.py 376 377 378 379 380 381 382 383 384 385 386 387 388 def exportDocument ( self , file_path : str , exportAs : ExportType , options : Union [ ExportOptionsSaveForWeb ]): \"\"\"Exports the Document. Note: This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References: - https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working \"\"\" file_path = file_path . replace ( \" \\\\ \" , \"/\" ) self . app . export ( file_path , exportAs , options ) flatten () Flattens all layers. Source code in photoshop/api/_document.py 350 351 352 def flatten ( self ): \"\"\"Flattens all layers.\"\"\" return self . app . Flatten () mergeVisibleLayers () Flattens all visible layers in the Document. Source code in photoshop/api/_document.py 354 355 356 def mergeVisibleLayers ( self ): \"\"\"Flattens all visible layers in the Document.\"\"\" return self . app . mergeVisibleLayers () paste () Pastes contents of the clipboard into the Document. Source code in photoshop/api/_document.py 393 394 395 396 def paste ( self ): \"\"\"Pastes contents of the clipboard into the Document.\"\"\" self . eval_javascript ( \"app.activeDocument.paste()\" ) return self . activeLayer print () Prints the document. Source code in photoshop/api/_document.py 398 399 400 def print ( self ): \"\"\"Prints the document.\"\"\" return self . app . print () recordMeasurements ( source , dataPoints ) Records the measurements of document. Source code in photoshop/api/_document.py 408 409 410 def recordMeasurements ( self , source , dataPoints ): \"\"\"Records the measurements of document.\"\"\" self . app . recordMeasurements ( source , dataPoints ) resizeImage ( width , height , resolution = 72 , automatic = 8 ) Changes the size of the image. Parameters: Name Type Description Default width int The desired width of the image. required height int The desired height of the image. required resolution int The resolution (in pixels per inch) 72 automatic int Value for automatic. 8 Source code in photoshop/api/_document.py 476 477 478 479 480 481 482 483 484 485 486 def resizeImage ( self , width : int , height : int , resolution : int = 72 , automatic : int = 8 ): \"\"\"Changes the size of the image. Args: width: The desired width of the image. height: The desired height of the image. resolution: The resolution (in pixels per inch) automatic: Value for automatic. \"\"\" return self . app . resizeImage ( width , height , resolution , automatic ) reveal_all () Expands the Document to show clipped sections. Source code in photoshop/api/_document.py 412 413 414 def reveal_all ( self ): \"\"\"Expands the Document to show clipped sections.\"\"\" return self . app . revealAll () save () Saves the Document. Source code in photoshop/api/_document.py 416 417 418 def save ( self ): \"\"\"Saves the Document.\"\"\" return self . app . save () saveAs ( file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ) Saves the documents with the specified save options. Parameters: Name Type Description Default file_path str Absolute path of psd file. required options JPEGSaveOptions Save options. required asCopy bool True Source code in photoshop/api/_document.py 420 421 422 423 424 425 426 427 428 def saveAs ( self , file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ): \"\"\"Saves the documents with the specified save options. Args: file_path (str): Absolute path of psd file. options (JPEGSaveOptions): Save options. asCopy (bool): \"\"\" return self . app . saveAs ( file_path , options , asCopy , extensionType ) splitChannels () Splits the channels of the document. Source code in photoshop/api/_document.py 430 431 432 def splitChannels ( self ): \"\"\"Splits the channels of the document.\"\"\" self . app . splitChannels () suspendHistory ( historyString , javaScriptString ) Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. Source code in photoshop/api/_document.py 434 435 436 437 438 439 440 def suspendHistory ( self , historyString , javaScriptString ): \"\"\"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. \"\"\" self . eval_javascript ( f \"app.activeDocument.suspendHistory(' { historyString } ', ' { javaScriptString } ')\" ) trap ( width ) Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. Source code in photoshop/api/_document.py 442 443 444 445 446 447 448 def trap ( self , width : int ): \"\"\" Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. \"\"\" self . app . trap ( width ) trim ( trim_type , top = True , left = True , bottom = True , right = True ) Trims the transparent area around the image on the specified sides of the canvas. Parameters: Name Type Description Default trim_type TrimType The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels required top Optional [ bool ] If true, trims away the top of the document. True left Optional [ bool ] If true, trims away the left of the document. True bottom Optional [ bool ] If true, trims away the bottom of the document. True right Optional [ bool ] If true, trims away the right of the document. True Source code in photoshop/api/_document.py 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 def trim ( self , trim_type : TrimType , top : Optional [ bool ] = True , left : Optional [ bool ] = True , bottom : Optional [ bool ] = True , right : Optional [ bool ] = True , ): \"\"\"Trims the transparent area around the image on the specified sides of the canvas. Args: trim_type: The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels top: If true, trims away the top of the document. left: If true, trims away the left of the document. bottom: If true, trims away the bottom of the document. right: If true, trims away the right of the document. \"\"\" return self . app . trim ( trim_type , top , left , bottom , right )","title":"document"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document","text":"Bases: Photoshop The active containment object for the layers and all other objects in the script. the basic canvas for the file. Source code in photoshop/api/_document.py 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 class Document ( Photoshop ): \"\"\"The active containment object for the layers and all other objects in the script. the basic canvas for the file. \"\"\" # noqa: E501 object_name = \"Application\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"autoCount\" , \"changeMode\" , \"close\" , \"convertProfile\" , \"Flatten\" , \"mergeVisibleLayers\" , \"crop\" , \"export\" , \"duplicate\" , \"printOneCopy\" , \"rasterizeAllLayers\" , \"recordMeasurements\" , \"revealAll\" , \"save\" , \"saveAs\" , \"splitChannels\" , \"trap\" , \"trim\" , \"resizeImage\" , ) @property def artLayers ( self ) -> ArtLayers : return ArtLayers ( self . app . artLayers ) @property def activeLayer ( self ) -> PS_Layer : \"\"\"The selected layer.\"\"\" type_ = self . eval_javascript ( \"app.activeDocument.activeLayer.typename\" ) mappings = { \"LayerSet\" : LayerSet , \"ArtLayer\" : ArtLayer } func = mappings [ type_ ] return func ( self . app . activeLayer ) @activeLayer . setter def activeLayer ( self , layer ) -> NoReturn : \"\"\"Sets the select layer as active layer. Args: layer (._artlayer.ArtLayer or ._layerSet.LayerSet): The artLayer. \"\"\" self . app . activeLayer = layer @property def activeChannels ( self ): \"\"\"The selected channels.\"\"\" return self . app . activeChannels @activeChannels . setter def activeChannels ( self , channels ): self . app . activeChannels = channels @property def activeHistoryBrushSource ( self ): \"\"\"The history state to use with the history brush.\"\"\" return self . app . activeHistoryBrushSource @property def activeHistoryState ( self ): \"\"\"The current history state for this document.\"\"\" return self . app . activeHistoryState @activeHistoryState . setter def activeHistoryState ( self , state ): self . app . activeHistoryState = state @property def backgroundLayer ( self ): \"\"\"The background layer for the Document.\"\"\" return self . app . backgroundLayer @property def bitsPerChannel ( self ): \"\"\"The number of bits per channel.\"\"\" return self . app . bitsPerChannel @bitsPerChannel . setter def bitsPerChannel ( self , value ): self . app . bitsPerChannel = value @property def channels ( self ): return Channels ( self . app . channels ) @property def colorProfileName ( self ): \"\"\"The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile).\"\"\" return self . app . colorProfileName @colorProfileName . setter def colorProfileName ( self , name ): self . app . colorProfileName = name @property def colorProfileType ( self ): \"\"\"The type of color model that defines the working space of the Document.\"\"\" return self . app . colorProfileType @colorProfileType . setter def colorProfileType ( self , profile_type ): self . app . colorProfileType = profile_type @property def colorSamplers ( self ): \"\"\"The current color samplers associated with the Document.\"\"\" return self . app . colorSamplers @property def componentChannels ( self ): \"\"\"The color component channels for this Document.\"\"\" return self . app . componentChannels @property def countItems ( self ): \"\"\"The current count items in the Document.\"\"\" return self . app . countItems @property def fullName ( self ): \"\"\"The full path name of the Document.\"\"\" try : return Path ( self . app . fullName ) except COMError : self . eval_javascript ( 'alert (\"Please save your Document first!\",' '\" {} \")' . format ( self . name ), ) @property def height ( self ): \"\"\"The height of the Document.\"\"\" return self . app . Height @property def histogram ( self ): \"\"\"A histogram showing the number of pixels at each color intensity level for the composite channel.\"\"\" return self . app . Histogram @property def history_states ( self ): \"\"\"The history states collection in this Document.\"\"\" return self . app . HistoryStates @property def id ( self ): \"\"\"The unique ID of this Document.\"\"\" return self . app . Id @property def info ( self ): \"\"\"Metadata about the Document.\"\"\" return DocumentInfo ( self . app . info ) @property def layerComps ( self ): \"\"\"The layer comps collection in this Document.\"\"\" return LayerComps ( self . app . layerComps ) @property def layers ( self ): \"\"\"The layers collection in the Document.\"\"\" return Layers ( self . app . Layers ) @property def layerSets ( self ): \"\"\"The layer sets collection in the Document.\"\"\" return LayerSets ( self . app . layerSets ) @property def managed ( self ): \"\"\"If true, the Document is a workgroup Document.\"\"\" return self . app . Managed @property def measurement_scale ( self ): \"\"\"The measurement scale of the Document.\"\"\" return self . app . MeasurementScale @property def mode ( self ): \"\"\"The color profile.\"\"\" return self . app . Mode @property def name ( self ) -> str : \"\"\"The Document name.\"\"\" return self . app . name @property def parent ( self ): \"\"\"The object's container.\"\"\" return self . app . Parent @property def path ( self ) -> str : \"\"\"The path to the Document.\"\"\" try : return Path ( self . app . path ) except COMError : self . eval_javascript ( 'alert (\"Please save your Document first!\",' '\" {} \")' . format ( self . name ), ) @path . setter def path ( self , path : str ) -> NoReturn : self . app . fullName = path @property def pathItems ( self ): return self . app . pathItems @property def pixelAspectRatio ( self ): \"\"\"The (custom) pixel aspect ratio of the Document. Range: 0.100 to 10.000. \"\"\" return self . app . pixelAspectRatio @property def printSettings ( self ): \"\"\"Document print settings.\"\"\" return self . app . printSettings @property def quickMaskMode ( self ): \"\"\"If true, the document is in Quick Mask mode.\"\"\" return self . app . quickMaskMode @property def saved ( self ): \"\"\"If true, the Document been saved since the last change.\"\"\" return self . app . Saved @property def resolution ( self ): \"\"\"The resolution of the Document (in pixels per inch)\"\"\" return self . app . resolution @property def selection ( self ): \"\"\"The selected area of the Document.\"\"\" return Selection ( self . app . selection ) @property def typename ( self ): \"\"\"The class name of the object.\"\"\" return self . app . typename @property def cloudDocument ( self ): \"\"\"This document is in the cloud.\"\"\" return self . app . cloudDocument @property def cloudWorkAreaDirectory ( self ): \"\"\"Local directory for this cloud document.\"\"\" return self . app . cloudWorkAreaDirectory @property def width ( self ): return self . app . Width @property def xmpMetadata ( self ): \"\"\"The XMP properties of the Document. The Camera RAW settings are stored here.\"\"\" return self . app . xmpMetadata # Methods def autoCount ( self , * args , ** kwargs ): \"\"\"Counts the objects in the Document.\"\"\" return self . app . autoCount ( * args , ** kwargs ) def changeMode ( self , * args , ** kwargs ): \"\"\"Changes the mode of the Document.\"\"\" return self . app . changeMode ( * args , ** kwargs ) def close ( self , saving = SaveOptions . DoNotSaveChanges ): return self . app . close ( saving ) def convertProfile ( self ): return self . app . convertProfile () def flatten ( self ): \"\"\"Flattens all layers.\"\"\" return self . app . Flatten () def mergeVisibleLayers ( self ): \"\"\"Flattens all visible layers in the Document.\"\"\" return self . app . mergeVisibleLayers () def crop ( self , bounds : List [ int ], angle : Optional [ float ] = None , width : Optional [ int ] = None , height : Optional [ int ] = None , ): \"\"\"Crops the document. Args: bounds: Four coordinates for the region remaining after cropping. angle: The angle of cropping bounds. width: The width of the resulting document. height: The height of the resulting document. \"\"\" return self . app . crop ( bounds , angle , width , height ) def exportDocument ( self , file_path : str , exportAs : ExportType , options : Union [ ExportOptionsSaveForWeb ]): \"\"\"Exports the Document. Note: This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References: - https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working \"\"\" file_path = file_path . replace ( \" \\\\ \" , \"/\" ) self . app . export ( file_path , exportAs , options ) def duplicate ( self , name = None , merge_layers_only = False ): return Document ( self . app . duplicate ( name , merge_layers_only )) def paste ( self ): \"\"\"Pastes contents of the clipboard into the Document.\"\"\" self . eval_javascript ( \"app.activeDocument.paste()\" ) return self . activeLayer def print ( self ): \"\"\"Prints the document.\"\"\" return self . app . print () def printOneCopy ( self ): self . app . printOneCopy () def rasterizeAllLayers ( self ): return self . app . rasterizeAllLayers () def recordMeasurements ( self , source , dataPoints ): \"\"\"Records the measurements of document.\"\"\" self . app . recordMeasurements ( source , dataPoints ) def reveal_all ( self ): \"\"\"Expands the Document to show clipped sections.\"\"\" return self . app . revealAll () def save ( self ): \"\"\"Saves the Document.\"\"\" return self . app . save () def saveAs ( self , file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ): \"\"\"Saves the documents with the specified save options. Args: file_path (str): Absolute path of psd file. options (JPEGSaveOptions): Save options. asCopy (bool): \"\"\" return self . app . saveAs ( file_path , options , asCopy , extensionType ) def splitChannels ( self ): \"\"\"Splits the channels of the document.\"\"\" self . app . splitChannels () def suspendHistory ( self , historyString , javaScriptString ): \"\"\"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. \"\"\" self . eval_javascript ( f \"app.activeDocument.suspendHistory(' { historyString } ', ' { javaScriptString } ')\" ) def trap ( self , width : int ): \"\"\" Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. \"\"\" self . app . trap ( width ) def trim ( self , trim_type : TrimType , top : Optional [ bool ] = True , left : Optional [ bool ] = True , bottom : Optional [ bool ] = True , right : Optional [ bool ] = True , ): \"\"\"Trims the transparent area around the image on the specified sides of the canvas. Args: trim_type: The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels top: If true, trims away the top of the document. left: If true, trims away the left of the document. bottom: If true, trims away the bottom of the document. right: If true, trims away the right of the document. \"\"\" return self . app . trim ( trim_type , top , left , bottom , right ) def resizeImage ( self , width : int , height : int , resolution : int = 72 , automatic : int = 8 ): \"\"\"Changes the size of the image. Args: width: The desired width of the image. height: The desired height of the image. resolution: The resolution (in pixels per inch) automatic: Value for automatic. \"\"\" return self . app . resizeImage ( width , height , resolution , automatic )","title":"Document"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.activeChannels","text":"The selected channels.","title":"activeChannels"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.activeHistoryBrushSource","text":"The history state to use with the history brush.","title":"activeHistoryBrushSource"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.activeHistoryState","text":"The current history state for this document.","title":"activeHistoryState"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.activeLayer","text":"The selected layer.","title":"activeLayer"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.backgroundLayer","text":"The background layer for the Document.","title":"backgroundLayer"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.bitsPerChannel","text":"The number of bits per channel.","title":"bitsPerChannel"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.cloudDocument","text":"This document is in the cloud.","title":"cloudDocument"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.cloudWorkAreaDirectory","text":"Local directory for this cloud document.","title":"cloudWorkAreaDirectory"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.colorProfileName","text":"The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile).","title":"colorProfileName"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.colorProfileType","text":"The type of color model that defines the working space of the Document.","title":"colorProfileType"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.colorSamplers","text":"The current color samplers associated with the Document.","title":"colorSamplers"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.componentChannels","text":"The color component channels for this Document.","title":"componentChannels"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.countItems","text":"The current count items in the Document.","title":"countItems"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.fullName","text":"The full path name of the Document.","title":"fullName"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.height","text":"The height of the Document.","title":"height"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.histogram","text":"A histogram showing the number of pixels at each color intensity level for the composite channel.","title":"histogram"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.history_states","text":"The history states collection in this Document.","title":"history_states"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.id","text":"The unique ID of this Document.","title":"id"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.info","text":"Metadata about the Document.","title":"info"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.layerComps","text":"The layer comps collection in this Document.","title":"layerComps"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.layerSets","text":"The layer sets collection in the Document.","title":"layerSets"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.layers","text":"The layers collection in the Document.","title":"layers"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.managed","text":"If true, the Document is a workgroup Document.","title":"managed"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.measurement_scale","text":"The measurement scale of the Document.","title":"measurement_scale"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.mode","text":"The color profile.","title":"mode"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.name","text":"The Document name.","title":"name"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.parent","text":"The object's container.","title":"parent"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.path","text":"The path to the Document.","title":"path"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.pixelAspectRatio","text":"The (custom) pixel aspect ratio of the Document. Range: 0.100 to 10.000.","title":"pixelAspectRatio"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.printSettings","text":"Document print settings.","title":"printSettings"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.quickMaskMode","text":"If true, the document is in Quick Mask mode.","title":"quickMaskMode"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.resolution","text":"The resolution of the Document (in pixels per inch)","title":"resolution"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.saved","text":"If true, the Document been saved since the last change.","title":"saved"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.selection","text":"The selected area of the Document.","title":"selection"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.typename","text":"The class name of the object.","title":"typename"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.xmpMetadata","text":"The XMP properties of the Document. The Camera RAW settings are stored here.","title":"xmpMetadata"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.autoCount","text":"Counts the objects in the Document. Source code in photoshop/api/_document.py 336 337 338 def autoCount ( self , * args , ** kwargs ): \"\"\"Counts the objects in the Document.\"\"\" return self . app . autoCount ( * args , ** kwargs )","title":"autoCount()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.changeMode","text":"Changes the mode of the Document. Source code in photoshop/api/_document.py 340 341 342 def changeMode ( self , * args , ** kwargs ): \"\"\"Changes the mode of the Document.\"\"\" return self . app . changeMode ( * args , ** kwargs )","title":"changeMode()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.crop","text":"Crops the document. Parameters: Name Type Description Default bounds List [ int ] Four coordinates for the region remaining after cropping. required angle Optional [ float ] The angle of cropping bounds. None width Optional [ int ] The width of the resulting document. None height Optional [ int ] The height of the resulting document. None Source code in photoshop/api/_document.py 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 def crop ( self , bounds : List [ int ], angle : Optional [ float ] = None , width : Optional [ int ] = None , height : Optional [ int ] = None , ): \"\"\"Crops the document. Args: bounds: Four coordinates for the region remaining after cropping. angle: The angle of cropping bounds. width: The width of the resulting document. height: The height of the resulting document. \"\"\" return self . app . crop ( bounds , angle , width , height )","title":"crop()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.exportDocument","text":"Exports the Document. Note This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working Source code in photoshop/api/_document.py 376 377 378 379 380 381 382 383 384 385 386 387 388 def exportDocument ( self , file_path : str , exportAs : ExportType , options : Union [ ExportOptionsSaveForWeb ]): \"\"\"Exports the Document. Note: This is a patched version, Due to the problem of dynamic binding, we cannot call it directly, so this command is executed by javascript. References: - https://stackoverflow.com/questions/12286761/saving-a-png-with-photoshop-script-not-working \"\"\" file_path = file_path . replace ( \" \\\\ \" , \"/\" ) self . app . export ( file_path , exportAs , options )","title":"exportDocument()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.flatten","text":"Flattens all layers. Source code in photoshop/api/_document.py 350 351 352 def flatten ( self ): \"\"\"Flattens all layers.\"\"\" return self . app . Flatten ()","title":"flatten()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.mergeVisibleLayers","text":"Flattens all visible layers in the Document. Source code in photoshop/api/_document.py 354 355 356 def mergeVisibleLayers ( self ): \"\"\"Flattens all visible layers in the Document.\"\"\" return self . app . mergeVisibleLayers ()","title":"mergeVisibleLayers()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.paste","text":"Pastes contents of the clipboard into the Document. Source code in photoshop/api/_document.py 393 394 395 396 def paste ( self ): \"\"\"Pastes contents of the clipboard into the Document.\"\"\" self . eval_javascript ( \"app.activeDocument.paste()\" ) return self . activeLayer","title":"paste()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.print","text":"Prints the document. Source code in photoshop/api/_document.py 398 399 400 def print ( self ): \"\"\"Prints the document.\"\"\" return self . app . print ()","title":"print()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.recordMeasurements","text":"Records the measurements of document. Source code in photoshop/api/_document.py 408 409 410 def recordMeasurements ( self , source , dataPoints ): \"\"\"Records the measurements of document.\"\"\" self . app . recordMeasurements ( source , dataPoints )","title":"recordMeasurements()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.resizeImage","text":"Changes the size of the image. Parameters: Name Type Description Default width int The desired width of the image. required height int The desired height of the image. required resolution int The resolution (in pixels per inch) 72 automatic int Value for automatic. 8 Source code in photoshop/api/_document.py 476 477 478 479 480 481 482 483 484 485 486 def resizeImage ( self , width : int , height : int , resolution : int = 72 , automatic : int = 8 ): \"\"\"Changes the size of the image. Args: width: The desired width of the image. height: The desired height of the image. resolution: The resolution (in pixels per inch) automatic: Value for automatic. \"\"\" return self . app . resizeImage ( width , height , resolution , automatic )","title":"resizeImage()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.reveal_all","text":"Expands the Document to show clipped sections. Source code in photoshop/api/_document.py 412 413 414 def reveal_all ( self ): \"\"\"Expands the Document to show clipped sections.\"\"\" return self . app . revealAll ()","title":"reveal_all()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.save","text":"Saves the Document. Source code in photoshop/api/_document.py 416 417 418 def save ( self ): \"\"\"Saves the Document.\"\"\" return self . app . save ()","title":"save()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.saveAs","text":"Saves the documents with the specified save options. Parameters: Name Type Description Default file_path str Absolute path of psd file. required options JPEGSaveOptions Save options. required asCopy bool True Source code in photoshop/api/_document.py 420 421 422 423 424 425 426 427 428 def saveAs ( self , file_path , options , asCopy = True , extensionType = ExtensionType . Lowercase ): \"\"\"Saves the documents with the specified save options. Args: file_path (str): Absolute path of psd file. options (JPEGSaveOptions): Save options. asCopy (bool): \"\"\" return self . app . saveAs ( file_path , options , asCopy , extensionType )","title":"saveAs()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.splitChannels","text":"Splits the channels of the document. Source code in photoshop/api/_document.py 430 431 432 def splitChannels ( self ): \"\"\"Splits the channels of the document.\"\"\" self . app . splitChannels ()","title":"splitChannels()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.suspendHistory","text":"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. Source code in photoshop/api/_document.py 434 435 436 437 438 439 440 def suspendHistory ( self , historyString , javaScriptString ): \"\"\"Provides a single history state for the entire script. Allows a single undo for all actions taken in the script. \"\"\" self . eval_javascript ( f \"app.activeDocument.suspendHistory(' { historyString } ', ' { javaScriptString } ')\" )","title":"suspendHistory()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.trap","text":"Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. Source code in photoshop/api/_document.py 442 443 444 445 446 447 448 def trap ( self , width : int ): \"\"\" Applies trapping to a CMYK document. Valid only when \u2018mode\u2019 = CMYK. \"\"\" self . app . trap ( width )","title":"trap()"},{"location":"reference/photoshop/api/_document/#photoshop.api._document.Document.trim","text":"Trims the transparent area around the image on the specified sides of the canvas. Parameters: Name Type Description Default trim_type TrimType The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels required top Optional [ bool ] If true, trims away the top of the document. True left Optional [ bool ] If true, trims away the left of the document. True bottom Optional [ bool ] If true, trims away the bottom of the document. True right Optional [ bool ] If true, trims away the right of the document. True Source code in photoshop/api/_document.py 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 def trim ( self , trim_type : TrimType , top : Optional [ bool ] = True , left : Optional [ bool ] = True , bottom : Optional [ bool ] = True , right : Optional [ bool ] = True , ): \"\"\"Trims the transparent area around the image on the specified sides of the canvas. Args: trim_type: The color or type of pixels to base the trim on. Examples: - TrimType.BottomRightPixel - TrimType.TopLeftPixel - TrimType.TransparentPixels top: If true, trims away the top of the document. left: If true, trims away the left of the document. bottom: If true, trims away the bottom of the document. right: If true, trims away the right of the document. \"\"\" return self . app . trim ( trim_type , top , left , bottom , right )","title":"trim()"},{"location":"reference/photoshop/api/_documentinfo/","text":"Metadata about a document object. These values can be set by selecting File > File Info in the Adobe Photoshop application. DocumentInfo Bases: Photoshop Metadata about a document object. Source code in photoshop/api/_documentinfo.py 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 class DocumentInfo ( Photoshop ): \"\"\"Metadata about a document object.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) def __str__ ( self ): return pformat ( { \"author\" : self . author , \"authorPosition\" : self . authorPosition , \"caption\" : self . caption , \"captionWriter\" : self . captionWriter , \"category\" : self . category , \"city\" : self . city , \"country\" : self . country , \"copyrightNotice\" : self . copyrightNotice , \"copyrighted\" : self . copyrighted , \"creationDate\" : self . creationDate , \"credit\" : self . credit , \"exif\" : self . exif , \"headline\" : self . headline , \"instructions\" : self . instructions , \"jobName\" : self . jobName , \"keywords\" : self . keywords , \"provinceState\" : self . provinceState , \"source\" : self . source , \"ownerUrl\" : self . ownerUrl , \"supplementalCategories\" : self . supplementalCategories , \"title\" : self . title , \"transmissionReference\" : self . transmissionReference , \"urgency\" : self . urgency , } ) @property def author ( self ): \"\"\"str: The author.\"\"\" return self . app . author @author . setter def author ( self , name ): self . app . author = name @property def authorPosition ( self ): \"\"\"str:The author\u2019s position.\"\"\" return self . app . authorPosition @authorPosition . setter def authorPosition ( self , name ): self . app . authorPosition = name @property def caption ( self ): return self . app . caption @caption . setter def caption ( self , name ): self . app . caption = name @property def captionWriter ( self ): return self . app . captionWriter @captionWriter . setter def captionWriter ( self , name ): self . app . captionWriter = name @property def category ( self ): \"\"\"str: The document category.\"\"\" return self . app . category @category . setter def category ( self , name ): self . app . category = name @property def city ( self ): return self . app . city @city . setter def city ( self , city_name ): self . app . city = city_name @property def copyrightNotice ( self ): \"\"\"str: The copyright notice.\"\"\" return self . app . copyrightNotice @copyrightNotice . setter def copyrightNotice ( self , name ): self . app . copyrightNotice = name @property def copyrighted ( self ): \"\"\"str: The copyright status.\"\"\" return self . app . copyrighted @copyrighted . setter def copyrighted ( self , info ): self . app . copyrighted = info @property def country ( self ): return self . app . country @country . setter def country ( self , name ): self . app . country = name @property def creationDate ( self ): return self . app . creationDate @creationDate . setter def creationDate ( self , name ): self . app . creationDate = name @property def credit ( self ): \"\"\"str: The author credit.\"\"\" return self . app . credit @credit . setter def credit ( self , value ): self . app . credit = value @property def exif ( self ): return self . app . exif @exif . setter def exif ( self , info ): self . app . exif = info @property def headline ( self ): return self . app . headline @headline . setter def headline ( self , value ): self . app . headline = value @property def instructions ( self ): return self . app . instructions @instructions . setter def instructions ( self , value ): self . app . instructions = value @property def jobName ( self ): return self . app . jobName @jobName . setter def jobName ( self , job ): self . app . jobName = job @property def keywords ( self ): return self . app . keywords @keywords . setter def keywords ( self , words ): self . app . keywords = words @property def ownerUrl ( self ): return self . app . ownerUrl @ownerUrl . setter def ownerUrl ( self , url ): self . app . ownerUrl = url @property def provinceState ( self ): \"\"\"str: The state or province.\"\"\" return self . app . provinceState @provinceState . setter def provinceState ( self , state_name ): self . app . provinceState = state_name @property def source ( self ): return self . app . source @source . setter def source ( self , source_name ): self . app . source = source_name @property def supplementalCategories ( self ): \"\"\"str: Other categories.\"\"\" return self . app . supplementalCategories @supplementalCategories . setter def supplementalCategories ( self , info ): self . app . supplementalCategories = info @property def title ( self ): return self . app . title @title . setter def title ( self , name ): self . app . title = name @property def transmissionReference ( self ): \"\"\"str: The transmission reference.\"\"\" return self . app . transmissionReference @transmissionReference . setter def transmissionReference ( self , reference ): self . app . transmissionReference = reference @property def urgency ( self ): \"\"\"The document urgency.\"\"\" return self . app . urgency @urgency . setter def urgency ( self , status ): self . app . urgency = status author property writable authorPosition property writable category property writable copyrightNotice property writable copyrighted property writable credit property writable provinceState property writable supplementalCategories property writable transmissionReference property writable urgency property writable The document urgency.","title":"documentinfo"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo","text":"Bases: Photoshop Metadata about a document object. Source code in photoshop/api/_documentinfo.py 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 class DocumentInfo ( Photoshop ): \"\"\"Metadata about a document object.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) def __str__ ( self ): return pformat ( { \"author\" : self . author , \"authorPosition\" : self . authorPosition , \"caption\" : self . caption , \"captionWriter\" : self . captionWriter , \"category\" : self . category , \"city\" : self . city , \"country\" : self . country , \"copyrightNotice\" : self . copyrightNotice , \"copyrighted\" : self . copyrighted , \"creationDate\" : self . creationDate , \"credit\" : self . credit , \"exif\" : self . exif , \"headline\" : self . headline , \"instructions\" : self . instructions , \"jobName\" : self . jobName , \"keywords\" : self . keywords , \"provinceState\" : self . provinceState , \"source\" : self . source , \"ownerUrl\" : self . ownerUrl , \"supplementalCategories\" : self . supplementalCategories , \"title\" : self . title , \"transmissionReference\" : self . transmissionReference , \"urgency\" : self . urgency , } ) @property def author ( self ): \"\"\"str: The author.\"\"\" return self . app . author @author . setter def author ( self , name ): self . app . author = name @property def authorPosition ( self ): \"\"\"str:The author\u2019s position.\"\"\" return self . app . authorPosition @authorPosition . setter def authorPosition ( self , name ): self . app . authorPosition = name @property def caption ( self ): return self . app . caption @caption . setter def caption ( self , name ): self . app . caption = name @property def captionWriter ( self ): return self . app . captionWriter @captionWriter . setter def captionWriter ( self , name ): self . app . captionWriter = name @property def category ( self ): \"\"\"str: The document category.\"\"\" return self . app . category @category . setter def category ( self , name ): self . app . category = name @property def city ( self ): return self . app . city @city . setter def city ( self , city_name ): self . app . city = city_name @property def copyrightNotice ( self ): \"\"\"str: The copyright notice.\"\"\" return self . app . copyrightNotice @copyrightNotice . setter def copyrightNotice ( self , name ): self . app . copyrightNotice = name @property def copyrighted ( self ): \"\"\"str: The copyright status.\"\"\" return self . app . copyrighted @copyrighted . setter def copyrighted ( self , info ): self . app . copyrighted = info @property def country ( self ): return self . app . country @country . setter def country ( self , name ): self . app . country = name @property def creationDate ( self ): return self . app . creationDate @creationDate . setter def creationDate ( self , name ): self . app . creationDate = name @property def credit ( self ): \"\"\"str: The author credit.\"\"\" return self . app . credit @credit . setter def credit ( self , value ): self . app . credit = value @property def exif ( self ): return self . app . exif @exif . setter def exif ( self , info ): self . app . exif = info @property def headline ( self ): return self . app . headline @headline . setter def headline ( self , value ): self . app . headline = value @property def instructions ( self ): return self . app . instructions @instructions . setter def instructions ( self , value ): self . app . instructions = value @property def jobName ( self ): return self . app . jobName @jobName . setter def jobName ( self , job ): self . app . jobName = job @property def keywords ( self ): return self . app . keywords @keywords . setter def keywords ( self , words ): self . app . keywords = words @property def ownerUrl ( self ): return self . app . ownerUrl @ownerUrl . setter def ownerUrl ( self , url ): self . app . ownerUrl = url @property def provinceState ( self ): \"\"\"str: The state or province.\"\"\" return self . app . provinceState @provinceState . setter def provinceState ( self , state_name ): self . app . provinceState = state_name @property def source ( self ): return self . app . source @source . setter def source ( self , source_name ): self . app . source = source_name @property def supplementalCategories ( self ): \"\"\"str: Other categories.\"\"\" return self . app . supplementalCategories @supplementalCategories . setter def supplementalCategories ( self , info ): self . app . supplementalCategories = info @property def title ( self ): return self . app . title @title . setter def title ( self , name ): self . app . title = name @property def transmissionReference ( self ): \"\"\"str: The transmission reference.\"\"\" return self . app . transmissionReference @transmissionReference . setter def transmissionReference ( self , reference ): self . app . transmissionReference = reference @property def urgency ( self ): \"\"\"The document urgency.\"\"\" return self . app . urgency @urgency . setter def urgency ( self , status ): self . app . urgency = status","title":"DocumentInfo"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.author","text":"","title":"author"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.authorPosition","text":"","title":"authorPosition"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.category","text":"","title":"category"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.copyrightNotice","text":"","title":"copyrightNotice"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.copyrighted","text":"","title":"copyrighted"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.credit","text":"","title":"credit"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.provinceState","text":"","title":"provinceState"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.supplementalCategories","text":"","title":"supplementalCategories"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.transmissionReference","text":"","title":"transmissionReference"},{"location":"reference/photoshop/api/_documentinfo/#photoshop.api._documentinfo.DocumentInfo.urgency","text":"The document urgency.","title":"urgency"},{"location":"reference/photoshop/api/_documents/","text":"Documents Bases: Photoshop The collection of open documents. Source code in photoshop/api/_documents.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 class Documents ( Photoshop ): \"\"\"The collection of open documents.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" ) def __len__ ( self ) -> int : return self . length def add ( self , width : int = 960 , height : int = 540 , resolution : float = 72.0 , name : str = None , mode : int = NewDocumentMode . NewRGB , initialFill : int = DocumentFill . White , pixelAspectRatio : float = 1.0 , bitsPerChannel : int = BitsPerChannelType . Document8Bits , colorProfileName : str = None , ) -> Document : \"\"\"Creates a new document object and adds it to this collections. Args: width (int): The width of the document. height (int): The height of the document. resolution (int): The resolution of the document (in pixels per inch) name (str): The name of the document. mode (): The document mode. initialFill : The initial fill of the document. pixelAspectRatio: The initial pixel aspect ratio of the document. Default is `1.0`, the range is `0.1-10.00`. bitsPerChannel: The number of bits per channel. colorProfileName: The name of color profile for document. Returns: .Document: Document instance. \"\"\" return Document ( self . app . add ( width , height , resolution , name , mode , initialFill , pixelAspectRatio , bitsPerChannel , colorProfileName , ) ) def __iter__ ( self ) -> Document : for doc in self . app : self . adobe . activeDocument = doc yield Document ( doc ) def __getitem__ ( self , item ) -> Document : try : return Document ( self . app [ item ]) except IndexError : raise PhotoshopPythonAPIError ( \"Currently Photoshop did not find Documents.\" ) @property def length ( self ) -> int : return len ( list ( self . app )) def getByName ( self , document_name : str ) -> Document : \"\"\"Get document by given document name.\"\"\" for doc in self . app : if doc . name == document_name : return Document ( doc ) raise PhotoshopPythonAPIError ( f 'Could not find a document named \" { document_name } \"' ) add ( width = 960 , height = 540 , resolution = 72.0 , name = None , mode = NewDocumentMode . NewRGB , initialFill = DocumentFill . White , pixelAspectRatio = 1.0 , bitsPerChannel = BitsPerChannelType . Document8Bits , colorProfileName = None ) Creates a new document object and adds it to this collections. Parameters: Name Type Description Default width int The width of the document. 960 height int The height of the document. 540 resolution int The resolution of the document (in pixels per inch) 72.0 name str The name of the document. None mode The document mode. NewRGB initialFill The initial fill of the document. White pixelAspectRatio float The initial pixel aspect ratio of the document. Default is 1.0 , the range is 0.1-10.00 . 1.0 bitsPerChannel int The number of bits per channel. Document8Bits colorProfileName str The name of color profile for document. None Returns: Type Description Document .Document: Document instance. Source code in photoshop/api/_documents.py 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 def add ( self , width : int = 960 , height : int = 540 , resolution : float = 72.0 , name : str = None , mode : int = NewDocumentMode . NewRGB , initialFill : int = DocumentFill . White , pixelAspectRatio : float = 1.0 , bitsPerChannel : int = BitsPerChannelType . Document8Bits , colorProfileName : str = None , ) -> Document : \"\"\"Creates a new document object and adds it to this collections. Args: width (int): The width of the document. height (int): The height of the document. resolution (int): The resolution of the document (in pixels per inch) name (str): The name of the document. mode (): The document mode. initialFill : The initial fill of the document. pixelAspectRatio: The initial pixel aspect ratio of the document. Default is `1.0`, the range is `0.1-10.00`. bitsPerChannel: The number of bits per channel. colorProfileName: The name of color profile for document. Returns: .Document: Document instance. \"\"\" return Document ( self . app . add ( width , height , resolution , name , mode , initialFill , pixelAspectRatio , bitsPerChannel , colorProfileName , ) ) getByName ( document_name ) Get document by given document name. Source code in photoshop/api/_documents.py 80 81 82 83 84 85 def getByName ( self , document_name : str ) -> Document : \"\"\"Get document by given document name.\"\"\" for doc in self . app : if doc . name == document_name : return Document ( doc ) raise PhotoshopPythonAPIError ( f 'Could not find a document named \" { document_name } \"' )","title":"documents"},{"location":"reference/photoshop/api/_documents/#photoshop.api._documents.Documents","text":"Bases: Photoshop The collection of open documents. Source code in photoshop/api/_documents.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 class Documents ( Photoshop ): \"\"\"The collection of open documents.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" ) def __len__ ( self ) -> int : return self . length def add ( self , width : int = 960 , height : int = 540 , resolution : float = 72.0 , name : str = None , mode : int = NewDocumentMode . NewRGB , initialFill : int = DocumentFill . White , pixelAspectRatio : float = 1.0 , bitsPerChannel : int = BitsPerChannelType . Document8Bits , colorProfileName : str = None , ) -> Document : \"\"\"Creates a new document object and adds it to this collections. Args: width (int): The width of the document. height (int): The height of the document. resolution (int): The resolution of the document (in pixels per inch) name (str): The name of the document. mode (): The document mode. initialFill : The initial fill of the document. pixelAspectRatio: The initial pixel aspect ratio of the document. Default is `1.0`, the range is `0.1-10.00`. bitsPerChannel: The number of bits per channel. colorProfileName: The name of color profile for document. Returns: .Document: Document instance. \"\"\" return Document ( self . app . add ( width , height , resolution , name , mode , initialFill , pixelAspectRatio , bitsPerChannel , colorProfileName , ) ) def __iter__ ( self ) -> Document : for doc in self . app : self . adobe . activeDocument = doc yield Document ( doc ) def __getitem__ ( self , item ) -> Document : try : return Document ( self . app [ item ]) except IndexError : raise PhotoshopPythonAPIError ( \"Currently Photoshop did not find Documents.\" ) @property def length ( self ) -> int : return len ( list ( self . app )) def getByName ( self , document_name : str ) -> Document : \"\"\"Get document by given document name.\"\"\" for doc in self . app : if doc . name == document_name : return Document ( doc ) raise PhotoshopPythonAPIError ( f 'Could not find a document named \" { document_name } \"' )","title":"Documents"},{"location":"reference/photoshop/api/_documents/#photoshop.api._documents.Documents.add","text":"Creates a new document object and adds it to this collections. Parameters: Name Type Description Default width int The width of the document. 960 height int The height of the document. 540 resolution int The resolution of the document (in pixels per inch) 72.0 name str The name of the document. None mode The document mode. NewRGB initialFill The initial fill of the document. White pixelAspectRatio float The initial pixel aspect ratio of the document. Default is 1.0 , the range is 0.1-10.00 . 1.0 bitsPerChannel int The number of bits per channel. Document8Bits colorProfileName str The name of color profile for document. None Returns: Type Description Document .Document: Document instance. Source code in photoshop/api/_documents.py 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 def add ( self , width : int = 960 , height : int = 540 , resolution : float = 72.0 , name : str = None , mode : int = NewDocumentMode . NewRGB , initialFill : int = DocumentFill . White , pixelAspectRatio : float = 1.0 , bitsPerChannel : int = BitsPerChannelType . Document8Bits , colorProfileName : str = None , ) -> Document : \"\"\"Creates a new document object and adds it to this collections. Args: width (int): The width of the document. height (int): The height of the document. resolution (int): The resolution of the document (in pixels per inch) name (str): The name of the document. mode (): The document mode. initialFill : The initial fill of the document. pixelAspectRatio: The initial pixel aspect ratio of the document. Default is `1.0`, the range is `0.1-10.00`. bitsPerChannel: The number of bits per channel. colorProfileName: The name of color profile for document. Returns: .Document: Document instance. \"\"\" return Document ( self . app . add ( width , height , resolution , name , mode , initialFill , pixelAspectRatio , bitsPerChannel , colorProfileName , ) )","title":"add()"},{"location":"reference/photoshop/api/_documents/#photoshop.api._documents.Documents.getByName","text":"Get document by given document name. Source code in photoshop/api/_documents.py 80 81 82 83 84 85 def getByName ( self , document_name : str ) -> Document : \"\"\"Get document by given document name.\"\"\" for doc in self . app : if doc . name == document_name : return Document ( doc ) raise PhotoshopPythonAPIError ( f 'Could not find a document named \" { document_name } \"' )","title":"getByName()"},{"location":"reference/photoshop/api/_layerComp/","text":"LayerComp Bases: Photoshop A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions). Source code in photoshop/api/_layerComp.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 class LayerComp ( Photoshop ): \"\"\"A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions).\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"apply\" , \"recapture\" , \"remove\" , \"resetfromComp\" , ) def __len__ ( self ): return self . length @property def appearance ( self ): return self . app . appearance @appearance . setter def appearance ( self , value ): self . app . appearance = value @property def childLayerCompState ( self ): return self . app . childLayerCompState @childLayerCompState . setter def childLayerCompState ( self , value ): self . app . childLayerCompState = value @property def comment ( self ): return self . app . comment @comment . setter def comment ( self , text ): self . app . comment = text @property def name ( self ): return self . app . name @name . setter def name ( self , text ): self . app . name = text @property def parent ( self ): return self . app . parent @property def position ( self ): return self . app . position @position . setter def position ( self , value ): self . app . position = value @property def selected ( self ): \"\"\"True if the layer comp is currently selected.\"\"\" return self . app . selected @selected . setter def selected ( self , value ): self . app . selected = value @property def typename ( self ): return self . app . typename @property def visibility ( self ): \"\"\"True to use layer visibility settings.\"\"\" return self . app . visibility @visibility . setter def visibility ( self , value ): self . app . visibility = value def apply ( self ): \"\"\"Applies the layer comp to the document.\"\"\" self . app . apply () def recapture ( self ): \"\"\"Recaptures the current layer state(s) for this layer comp.\"\"\" self . app . recapture () def remove ( self ): \"\"\"Deletes the layerComp object.\"\"\" self . app . remove () def resetfromComp ( self ): \"\"\"Resets the layer comp state to thedocument state.\"\"\" self . app . resetfromComp () selected property writable True if the layer comp is currently selected. visibility property writable True to use layer visibility settings. apply () Applies the layer comp to the document. Source code in photoshop/api/_layerComp.py 86 87 88 def apply ( self ): \"\"\"Applies the layer comp to the document.\"\"\" self . app . apply () recapture () Recaptures the current layer state(s) for this layer comp. Source code in photoshop/api/_layerComp.py 90 91 92 def recapture ( self ): \"\"\"Recaptures the current layer state(s) for this layer comp.\"\"\" self . app . recapture () remove () Deletes the layerComp object. Source code in photoshop/api/_layerComp.py 94 95 96 def remove ( self ): \"\"\"Deletes the layerComp object.\"\"\" self . app . remove () resetfromComp () Resets the layer comp state to thedocument state. Source code in photoshop/api/_layerComp.py 98 99 100 def resetfromComp ( self ): \"\"\"Resets the layer comp state to thedocument state.\"\"\" self . app . resetfromComp ()","title":"layerComp"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp","text":"Bases: Photoshop A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions). Source code in photoshop/api/_layerComp.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 class LayerComp ( Photoshop ): \"\"\"A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions).\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"apply\" , \"recapture\" , \"remove\" , \"resetfromComp\" , ) def __len__ ( self ): return self . length @property def appearance ( self ): return self . app . appearance @appearance . setter def appearance ( self , value ): self . app . appearance = value @property def childLayerCompState ( self ): return self . app . childLayerCompState @childLayerCompState . setter def childLayerCompState ( self , value ): self . app . childLayerCompState = value @property def comment ( self ): return self . app . comment @comment . setter def comment ( self , text ): self . app . comment = text @property def name ( self ): return self . app . name @name . setter def name ( self , text ): self . app . name = text @property def parent ( self ): return self . app . parent @property def position ( self ): return self . app . position @position . setter def position ( self , value ): self . app . position = value @property def selected ( self ): \"\"\"True if the layer comp is currently selected.\"\"\" return self . app . selected @selected . setter def selected ( self , value ): self . app . selected = value @property def typename ( self ): return self . app . typename @property def visibility ( self ): \"\"\"True to use layer visibility settings.\"\"\" return self . app . visibility @visibility . setter def visibility ( self , value ): self . app . visibility = value def apply ( self ): \"\"\"Applies the layer comp to the document.\"\"\" self . app . apply () def recapture ( self ): \"\"\"Recaptures the current layer state(s) for this layer comp.\"\"\" self . app . recapture () def remove ( self ): \"\"\"Deletes the layerComp object.\"\"\" self . app . remove () def resetfromComp ( self ): \"\"\"Resets the layer comp state to thedocument state.\"\"\" self . app . resetfromComp ()","title":"LayerComp"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.selected","text":"True if the layer comp is currently selected.","title":"selected"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.visibility","text":"True to use layer visibility settings.","title":"visibility"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.apply","text":"Applies the layer comp to the document. Source code in photoshop/api/_layerComp.py 86 87 88 def apply ( self ): \"\"\"Applies the layer comp to the document.\"\"\" self . app . apply ()","title":"apply()"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.recapture","text":"Recaptures the current layer state(s) for this layer comp. Source code in photoshop/api/_layerComp.py 90 91 92 def recapture ( self ): \"\"\"Recaptures the current layer state(s) for this layer comp.\"\"\" self . app . recapture ()","title":"recapture()"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.remove","text":"Deletes the layerComp object. Source code in photoshop/api/_layerComp.py 94 95 96 def remove ( self ): \"\"\"Deletes the layerComp object.\"\"\" self . app . remove ()","title":"remove()"},{"location":"reference/photoshop/api/_layerComp/#photoshop.api._layerComp.LayerComp.resetfromComp","text":"Resets the layer comp state to thedocument state. Source code in photoshop/api/_layerComp.py 98 99 100 def resetfromComp ( self ): \"\"\"Resets the layer comp state to thedocument state.\"\"\" self . app . resetfromComp ()","title":"resetfromComp()"},{"location":"reference/photoshop/api/_layerComps/","text":"LayerComps Bases: Photoshop The layer comps collection in this document. Source code in photoshop/api/_layerComps.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 class LayerComps ( Photoshop ): \"\"\"The layer comps collection in this document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"removeAll\" , ) def __len__ ( self ): return self . length @property def length ( self ): return len ( self . _layers ) @property def _layers ( self ): return list ( self . app ) @property def parent ( self ): return self . app . parent @property def typename ( self ): return self . app . typename def add ( self , name , comment = \"No Comment.\" , appearance = True , position = True , visibility = True , childLayerCompStat = False , ): return LayerComp ( self . app . add ( name , comment , appearance , position , visibility , childLayerCompStat )) def getByName ( self , name ): for layer in self . _layers : if layer . name == name : return LayerComp ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a layer named \" { name } \"' ) def removeAll ( self ): self . app . removeAll () def __iter__ ( self ): for layer in self . _layers : yield LayerComp ( layer )","title":"layerComps"},{"location":"reference/photoshop/api/_layerComps/#photoshop.api._layerComps.LayerComps","text":"Bases: Photoshop The layer comps collection in this document. Source code in photoshop/api/_layerComps.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 class LayerComps ( Photoshop ): \"\"\"The layer comps collection in this document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"removeAll\" , ) def __len__ ( self ): return self . length @property def length ( self ): return len ( self . _layers ) @property def _layers ( self ): return list ( self . app ) @property def parent ( self ): return self . app . parent @property def typename ( self ): return self . app . typename def add ( self , name , comment = \"No Comment.\" , appearance = True , position = True , visibility = True , childLayerCompStat = False , ): return LayerComp ( self . app . add ( name , comment , appearance , position , visibility , childLayerCompStat )) def getByName ( self , name ): for layer in self . _layers : if layer . name == name : return LayerComp ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a layer named \" { name } \"' ) def removeAll ( self ): self . app . removeAll () def __iter__ ( self ): for layer in self . _layers : yield LayerComp ( layer )","title":"LayerComps"},{"location":"reference/photoshop/api/_layerSet/","text":"LayerSet Bases: Photoshop A group of layer objects, which can include art layer objects and other (nested) layer set objects. A single command or set of commands manipulates all layers in a layer set object. Source code in photoshop/api/_layerSet.py 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 class LayerSet ( Photoshop ): \"\"\"A group of layer objects, which can include art layer objects and other (nested) layer set objects. A single command or set of commands manipulates all layers in a layer set object. \"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"merge\" , \"duplicate\" , \"add\" , \"delete\" , \"link\" , \"move\" , \"resize\" , \"rotate\" , \"translate\" , \"unlink\" , ) @property def allLocked ( self ): return self . app . allLocked @allLocked . setter def allLocked ( self , value ): self . app . allLocked = value @property def artLayers ( self ): return ArtLayers ( self . app . artLayers ) @property def blendMode ( self ): return BlendMode ( self . app . blendMode ) @property def bounds ( self ): \"\"\"The bounding rectangle of the layer set.\"\"\" return self . app . bounds @property def enabledChannels ( self ): return self . app . enabledChannels @enabledChannels . setter def enabledChannels ( self , value ): self . app . enabledChannels = value @property def layers ( self ): return Layers ( self . app . layers ) @property def layerSets ( self ): # pylint: disable=import-outside-toplevel from ._layerSets import LayerSets return LayerSets ( self . app . layerSets ) @property def linkedLayers ( self ): \"\"\"The layers linked to this layerSet object.\"\"\" return self . app . linkedLayers or [] @property def name ( self ) -> str : return self . app . name @name . setter def name ( self , value ): \"\"\"The name of this layer set.\"\"\" self . app . name = value @property def opacity ( self ): \"\"\"The master opacity of the set.\"\"\" return round ( self . app . opacity ) @opacity . setter def opacity ( self , value ): self . app . opacity = value @property def parent ( self ): return self . app . parent @property def visible ( self ): return self . app . visible @visible . setter def visible ( self , value ): self . app . visible = value def duplicate ( self , relativeObject = None , insertionLocation = None ): return LayerSet ( self . app . duplicate ( relativeObject , insertionLocation )) def link ( self , with_layer ): self . app . link ( with_layer ) def add ( self ): \"\"\"Adds an element.\"\"\" self . app . add () def merge ( self ) -> ArtLayer : \"\"\"Merges the layer set.\"\"\" return ArtLayer ( self . app . merge ()) def move ( self , relativeObject , insertionLocation ): self . app . move ( relativeObject , insertionLocation ) def remove ( self ): \"\"\"Remove this layer set from the document.\"\"\" self . app . delete () def resize ( self , horizontal = None , vertical = None , anchor : AnchorPosition = None ): self . app . resize ( horizontal , vertical , anchor ) def rotate ( self , angle , anchor = None ): self . app . rotate ( angle , anchor ) def translate ( self , delta_x , delta_y ): \"\"\"Moves the position relative to its current position.\"\"\" self . app . translate ( delta_x , delta_y ) def unlink ( self ): \"\"\"Unlinks the layer set.\"\"\" self . app . unlink () def __iter__ ( self ): for layer in self . app : yield layer bounds property The bounding rectangle of the layer set. linkedLayers property The layers linked to this layerSet object. opacity property writable The master opacity of the set. add () Adds an element. Source code in photoshop/api/_layerSet.py 113 114 115 def add ( self ): \"\"\"Adds an element.\"\"\" self . app . add () merge () Merges the layer set. Source code in photoshop/api/_layerSet.py 117 118 119 def merge ( self ) -> ArtLayer : \"\"\"Merges the layer set.\"\"\" return ArtLayer ( self . app . merge ()) remove () Remove this layer set from the document. Source code in photoshop/api/_layerSet.py 124 125 126 def remove ( self ): \"\"\"Remove this layer set from the document.\"\"\" self . app . delete () translate ( delta_x , delta_y ) Moves the position relative to its current position. Source code in photoshop/api/_layerSet.py 134 135 136 def translate ( self , delta_x , delta_y ): \"\"\"Moves the position relative to its current position.\"\"\" self . app . translate ( delta_x , delta_y ) unlink () Unlinks the layer set. Source code in photoshop/api/_layerSet.py 138 139 140 def unlink ( self ): \"\"\"Unlinks the layer set.\"\"\" self . app . unlink ()","title":"layerSet"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet","text":"Bases: Photoshop A group of layer objects, which can include art layer objects and other (nested) layer set objects. A single command or set of commands manipulates all layers in a layer set object. Source code in photoshop/api/_layerSet.py 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 class LayerSet ( Photoshop ): \"\"\"A group of layer objects, which can include art layer objects and other (nested) layer set objects. A single command or set of commands manipulates all layers in a layer set object. \"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"merge\" , \"duplicate\" , \"add\" , \"delete\" , \"link\" , \"move\" , \"resize\" , \"rotate\" , \"translate\" , \"unlink\" , ) @property def allLocked ( self ): return self . app . allLocked @allLocked . setter def allLocked ( self , value ): self . app . allLocked = value @property def artLayers ( self ): return ArtLayers ( self . app . artLayers ) @property def blendMode ( self ): return BlendMode ( self . app . blendMode ) @property def bounds ( self ): \"\"\"The bounding rectangle of the layer set.\"\"\" return self . app . bounds @property def enabledChannels ( self ): return self . app . enabledChannels @enabledChannels . setter def enabledChannels ( self , value ): self . app . enabledChannels = value @property def layers ( self ): return Layers ( self . app . layers ) @property def layerSets ( self ): # pylint: disable=import-outside-toplevel from ._layerSets import LayerSets return LayerSets ( self . app . layerSets ) @property def linkedLayers ( self ): \"\"\"The layers linked to this layerSet object.\"\"\" return self . app . linkedLayers or [] @property def name ( self ) -> str : return self . app . name @name . setter def name ( self , value ): \"\"\"The name of this layer set.\"\"\" self . app . name = value @property def opacity ( self ): \"\"\"The master opacity of the set.\"\"\" return round ( self . app . opacity ) @opacity . setter def opacity ( self , value ): self . app . opacity = value @property def parent ( self ): return self . app . parent @property def visible ( self ): return self . app . visible @visible . setter def visible ( self , value ): self . app . visible = value def duplicate ( self , relativeObject = None , insertionLocation = None ): return LayerSet ( self . app . duplicate ( relativeObject , insertionLocation )) def link ( self , with_layer ): self . app . link ( with_layer ) def add ( self ): \"\"\"Adds an element.\"\"\" self . app . add () def merge ( self ) -> ArtLayer : \"\"\"Merges the layer set.\"\"\" return ArtLayer ( self . app . merge ()) def move ( self , relativeObject , insertionLocation ): self . app . move ( relativeObject , insertionLocation ) def remove ( self ): \"\"\"Remove this layer set from the document.\"\"\" self . app . delete () def resize ( self , horizontal = None , vertical = None , anchor : AnchorPosition = None ): self . app . resize ( horizontal , vertical , anchor ) def rotate ( self , angle , anchor = None ): self . app . rotate ( angle , anchor ) def translate ( self , delta_x , delta_y ): \"\"\"Moves the position relative to its current position.\"\"\" self . app . translate ( delta_x , delta_y ) def unlink ( self ): \"\"\"Unlinks the layer set.\"\"\" self . app . unlink () def __iter__ ( self ): for layer in self . app : yield layer","title":"LayerSet"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.bounds","text":"The bounding rectangle of the layer set.","title":"bounds"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.linkedLayers","text":"The layers linked to this layerSet object.","title":"linkedLayers"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.opacity","text":"The master opacity of the set.","title":"opacity"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.add","text":"Adds an element. Source code in photoshop/api/_layerSet.py 113 114 115 def add ( self ): \"\"\"Adds an element.\"\"\" self . app . add ()","title":"add()"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.merge","text":"Merges the layer set. Source code in photoshop/api/_layerSet.py 117 118 119 def merge ( self ) -> ArtLayer : \"\"\"Merges the layer set.\"\"\" return ArtLayer ( self . app . merge ())","title":"merge()"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.remove","text":"Remove this layer set from the document. Source code in photoshop/api/_layerSet.py 124 125 126 def remove ( self ): \"\"\"Remove this layer set from the document.\"\"\" self . app . delete ()","title":"remove()"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.translate","text":"Moves the position relative to its current position. Source code in photoshop/api/_layerSet.py 134 135 136 def translate ( self , delta_x , delta_y ): \"\"\"Moves the position relative to its current position.\"\"\" self . app . translate ( delta_x , delta_y )","title":"translate()"},{"location":"reference/photoshop/api/_layerSet/#photoshop.api._layerSet.LayerSet.unlink","text":"Unlinks the layer set. Source code in photoshop/api/_layerSet.py 138 139 140 def unlink ( self ): \"\"\"Unlinks the layer set.\"\"\" self . app . unlink ()","title":"unlink()"},{"location":"reference/photoshop/api/_layerSets/","text":"LayerSets Bases: Photoshop The layer sets collection in the document. Source code in photoshop/api/_layerSets.py 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 class LayerSets ( Photoshop ): \"\"\"The layer sets collection in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"item\" , \"removeAll\" , ) def __len__ ( self ): return self . length def __iter__ ( self ): for layer_set in self . app : yield layer_set def __getitem__ ( self , key : str ): \"\"\"Access a given LayerSet using dictionary key lookup.\"\"\" try : return LayerSet ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { key } \"' ) @property def _layerSets ( self ): return list ( self . app ) @property def length ( self ) -> int : \"\"\"Number of elements in the collection.\"\"\" return len ( self . _layerSets ) def add ( self ): return LayerSet ( self . app . add ()) def item ( self , index : int ) -> LayerSet : return LayerSet ( self . app . item ( index )) def removeAll ( self ): self . app . removeAll () def getByIndex ( self , index : int ): \"\"\"Access LayerSet using list index lookup.\"\"\" return LayerSet ( self . _layerSets [ index ]) def getByName ( self , name : str ) -> LayerSet : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if name == layer . name : return LayerSet ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { name } \"' ) length : int property Number of elements in the collection. __getitem__ ( key ) Access a given LayerSet using dictionary key lookup. Source code in photoshop/api/_layerSets.py 28 29 30 31 32 33 def __getitem__ ( self , key : str ): \"\"\"Access a given LayerSet using dictionary key lookup.\"\"\" try : return LayerSet ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { key } \"' ) getByIndex ( index ) Access LayerSet using list index lookup. Source code in photoshop/api/_layerSets.py 53 54 55 def getByIndex ( self , index : int ): \"\"\"Access LayerSet using list index lookup.\"\"\" return LayerSet ( self . _layerSets [ index ]) getByName ( name ) Get the first element in the collection with the provided name. Source code in photoshop/api/_layerSets.py 57 58 59 60 61 62 def getByName ( self , name : str ) -> LayerSet : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if name == layer . name : return LayerSet ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { name } \"' )","title":"layerSets"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets","text":"Bases: Photoshop The layer sets collection in the document. Source code in photoshop/api/_layerSets.py 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 class LayerSets ( Photoshop ): \"\"\"The layer sets collection in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"item\" , \"removeAll\" , ) def __len__ ( self ): return self . length def __iter__ ( self ): for layer_set in self . app : yield layer_set def __getitem__ ( self , key : str ): \"\"\"Access a given LayerSet using dictionary key lookup.\"\"\" try : return LayerSet ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { key } \"' ) @property def _layerSets ( self ): return list ( self . app ) @property def length ( self ) -> int : \"\"\"Number of elements in the collection.\"\"\" return len ( self . _layerSets ) def add ( self ): return LayerSet ( self . app . add ()) def item ( self , index : int ) -> LayerSet : return LayerSet ( self . app . item ( index )) def removeAll ( self ): self . app . removeAll () def getByIndex ( self , index : int ): \"\"\"Access LayerSet using list index lookup.\"\"\" return LayerSet ( self . _layerSets [ index ]) def getByName ( self , name : str ) -> LayerSet : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if name == layer . name : return LayerSet ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { name } \"' )","title":"LayerSets"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets.length","text":"Number of elements in the collection.","title":"length"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets.__getitem__","text":"Access a given LayerSet using dictionary key lookup. Source code in photoshop/api/_layerSets.py 28 29 30 31 32 33 def __getitem__ ( self , key : str ): \"\"\"Access a given LayerSet using dictionary key lookup.\"\"\" try : return LayerSet ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { key } \"' )","title":"__getitem__()"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets.getByIndex","text":"Access LayerSet using list index lookup. Source code in photoshop/api/_layerSets.py 53 54 55 def getByIndex ( self , index : int ): \"\"\"Access LayerSet using list index lookup.\"\"\" return LayerSet ( self . _layerSets [ index ])","title":"getByIndex()"},{"location":"reference/photoshop/api/_layerSets/#photoshop.api._layerSets.LayerSets.getByName","text":"Get the first element in the collection with the provided name. Source code in photoshop/api/_layerSets.py 57 58 59 60 61 62 def getByName ( self , name : str ) -> LayerSet : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if name == layer . name : return LayerSet ( layer ) raise PhotoshopPythonAPIError ( f 'Could not find a LayerSet named \" { name } \"' )","title":"getByName()"},{"location":"reference/photoshop/api/_layers/","text":"Layers Bases: Photoshop The layers collection in the document. Source code in photoshop/api/_layers.py 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 class Layers ( Photoshop ): \"\"\"The layers collection in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"item\" , ) @property def _layers ( self ): return list ( self . app ) def __len__ ( self ): return self . length def __getitem__ ( self , key ): item = self . _layers [ key ] return ArtLayer ( item ) @property def length ( self ): return len ( self . _layers ) def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove () def item ( self , index ): return ArtLayer ( self . app . item ( index )) def __iter__ ( self ): for layer in self . _layers : yield ArtLayer ( layer ) def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( \"X\" ) getByName ( name ) Get the first element in the collection with the provided name. Source code in photoshop/api/_layers.py 45 46 47 48 49 50 def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( \"X\" ) removeAll () Deletes all elements. Source code in photoshop/api/_layers.py 33 34 35 36 def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"layers"},{"location":"reference/photoshop/api/_layers/#photoshop.api._layers.Layers","text":"Bases: Photoshop The layers collection in the document. Source code in photoshop/api/_layers.py 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 class Layers ( Photoshop ): \"\"\"The layers collection in the document.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"item\" , ) @property def _layers ( self ): return list ( self . app ) def __len__ ( self ): return self . length def __getitem__ ( self , key ): item = self . _layers [ key ] return ArtLayer ( item ) @property def length ( self ): return len ( self . _layers ) def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove () def item ( self , index ): return ArtLayer ( self . app . item ( index )) def __iter__ ( self ): for layer in self . _layers : yield ArtLayer ( layer ) def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( \"X\" )","title":"Layers"},{"location":"reference/photoshop/api/_layers/#photoshop.api._layers.Layers.getByName","text":"Get the first element in the collection with the provided name. Source code in photoshop/api/_layers.py 45 46 47 48 49 50 def getByName ( self , name : str ) -> ArtLayer : \"\"\"Get the first element in the collection with the provided name.\"\"\" for layer in self . app : if layer . name == name : return ArtLayer ( layer ) raise PhotoshopPythonAPIError ( \"X\" )","title":"getByName()"},{"location":"reference/photoshop/api/_layers/#photoshop.api._layers.Layers.removeAll","text":"Deletes all elements. Source code in photoshop/api/_layers.py 33 34 35 36 def removeAll ( self ): \"\"\"Deletes all elements.\"\"\" for layer in self . app : ArtLayer ( layer ) . remove ()","title":"removeAll()"},{"location":"reference/photoshop/api/_measurement_log/","text":"MeasurementLog Bases: Photoshop The log of measurements taken. Source code in photoshop/api/_measurement_log.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 class MeasurementLog ( Photoshop ): \"\"\"The log of measurements taken.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"exportMeasurements\" , \"deleteMeasurements\" , ) def exportMeasurements ( self , file_path : str , range_ : int = None , data_point = None ): if data_point is None : data_point = [] self . app . exportMeasurements ( file_path , range_ , data_point ) def deleteMeasurements ( self , range_ : int ): self . app . deleteMeasurements ( range_ )","title":"measurement_log"},{"location":"reference/photoshop/api/_measurement_log/#photoshop.api._measurement_log.MeasurementLog","text":"Bases: Photoshop The log of measurements taken. Source code in photoshop/api/_measurement_log.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 class MeasurementLog ( Photoshop ): \"\"\"The log of measurements taken.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"exportMeasurements\" , \"deleteMeasurements\" , ) def exportMeasurements ( self , file_path : str , range_ : int = None , data_point = None ): if data_point is None : data_point = [] self . app . exportMeasurements ( file_path , range_ , data_point ) def deleteMeasurements ( self , range_ : int ): self . app . deleteMeasurements ( range_ )","title":"MeasurementLog"},{"location":"reference/photoshop/api/_notifier/","text":"The collection of Notifier objects in the document. Access through the Application.notifiers collection property. For example: var notRef = app.notifiers.add(\"OnClickGoButton\", eventFile) Notifiers must be enabled using the Application.notifiersEnabled property Notifier Bases: Photoshop Source code in photoshop/api/_notifier.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class Notifier ( Photoshop ): def __init__ ( self , parent = None ): super () . __init__ () self . _flag_as_method ( \"remove\" , ) @property def event ( self ): \"\"\"The event identifier, a four-character code or a unique string.\"\"\" return self . app . event @property def eventClass ( self ): \"\"\"The class identifier, a four-character code or a unique string. When an event applies to multiple types of objects, use this propery to distinguish which object this notifier applies to. For example, the Make event (\"Mk \") can apply to documents (\"Dcmn\"), channels (\"Chnl\") and other objects. \"\"\" return self . app . eventClass @property def eventFile ( self ) -> Path : \"\"\"The path to the file to execute when the event occurs and activates the notifier.\"\"\" return Path ( self . app . eventFile ) def remove ( self ): \"\"\"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. \"\"\" return self . app . remove () event property The event identifier, a four-character code or a unique string. eventClass property The class identifier, a four-character code or a unique string. When an event applies to multiple types of objects, use this propery to distinguish which object this notifier applies to. For example, the Make event (\"Mk \") can apply to documents (\"Dcmn\"), channels (\"Chnl\") and other objects. eventFile : Path property The path to the file to execute when the event occurs and activates the notifier. remove () Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. Source code in photoshop/api/_notifier.py 45 46 47 48 49 50 51 52 53 54 55 56 def remove ( self ): \"\"\"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. \"\"\" return self . app . remove ()","title":"notifier"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier","text":"Bases: Photoshop Source code in photoshop/api/_notifier.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class Notifier ( Photoshop ): def __init__ ( self , parent = None ): super () . __init__ () self . _flag_as_method ( \"remove\" , ) @property def event ( self ): \"\"\"The event identifier, a four-character code or a unique string.\"\"\" return self . app . event @property def eventClass ( self ): \"\"\"The class identifier, a four-character code or a unique string. When an event applies to multiple types of objects, use this propery to distinguish which object this notifier applies to. For example, the Make event (\"Mk \") can apply to documents (\"Dcmn\"), channels (\"Chnl\") and other objects. \"\"\" return self . app . eventClass @property def eventFile ( self ) -> Path : \"\"\"The path to the file to execute when the event occurs and activates the notifier.\"\"\" return Path ( self . app . eventFile ) def remove ( self ): \"\"\"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. \"\"\" return self . app . remove ()","title":"Notifier"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier.event","text":"The event identifier, a four-character code or a unique string.","title":"event"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier.eventClass","text":"The class identifier, a four-character code or a unique string. When an event applies to multiple types of objects, use this propery to distinguish which object this notifier applies to. For example, the Make event (\"Mk \") can apply to documents (\"Dcmn\"), channels (\"Chnl\") and other objects.","title":"eventClass"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier.eventFile","text":"The path to the file to execute when the event occurs and activates the notifier.","title":"eventFile"},{"location":"reference/photoshop/api/_notifier/#photoshop.api._notifier.Notifier.remove","text":"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. Source code in photoshop/api/_notifier.py 45 46 47 48 49 50 51 52 53 54 55 56 def remove ( self ): \"\"\"Deletes this object. You can also remove a Notifier object from the Script Events Manager drop-down list by deleting the file named Script Events Manager.xml from the Photoshop preferences folder. See Adobe Photoshop CC help for more information. \"\"\" return self . app . remove ()","title":"remove()"},{"location":"reference/photoshop/api/_notifiers/","text":"The collection of Notifier objects in the document. Access through the Application.notifiers collection property. Examples: Notifiers must be enabled using the Application.notifiersEnabled property. var notRef = app . notifiers . add ( \"OnClickGoButton\" , eventFile ) Notifiers Bases: Photoshop The notifiers currently configured (in the Scripts Events Manager menu in the application). Source code in photoshop/api/_notifiers.py 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class Notifiers ( Photoshop ): \"\"\"The `notifiers` currently configured (in the Scripts Events Manager menu in the application).\"\"\" def __init__ ( self , parent : Optional [ Any ] = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"removeAll\" , ) @property def _notifiers ( self ) -> list : return [ n for n in self . app ] def __len__ ( self ): return self . length def __iter__ ( self ): for app in self . app : yield app def __getitem__ ( self , item ): return self . _notifiers [ item ] @property def length ( self ): return len ( self . _notifiers ) def add ( self , event , event_file : Optional [ Any ] = None , event_class : Optional [ Any ] = None ) -> Notifier : self . parent . notifiersEnabled = True return Notifier ( self . app . add ( event , event_file , event_class )) def removeAll ( self ): self . app . removeAll () self . parent . notifiersEnabled = False","title":"notifiers"},{"location":"reference/photoshop/api/_notifiers/#photoshop.api._notifiers.Notifiers","text":"Bases: Photoshop The notifiers currently configured (in the Scripts Events Manager menu in the application). Source code in photoshop/api/_notifiers.py 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class Notifiers ( Photoshop ): \"\"\"The `notifiers` currently configured (in the Scripts Events Manager menu in the application).\"\"\" def __init__ ( self , parent : Optional [ Any ] = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"add\" , \"removeAll\" , ) @property def _notifiers ( self ) -> list : return [ n for n in self . app ] def __len__ ( self ): return self . length def __iter__ ( self ): for app in self . app : yield app def __getitem__ ( self , item ): return self . _notifiers [ item ] @property def length ( self ): return len ( self . _notifiers ) def add ( self , event , event_file : Optional [ Any ] = None , event_class : Optional [ Any ] = None ) -> Notifier : self . parent . notifiersEnabled = True return Notifier ( self . app . add ( event , event_file , event_class )) def removeAll ( self ): self . app . removeAll () self . parent . notifiersEnabled = False","title":"Notifiers"},{"location":"reference/photoshop/api/_preferences/","text":"Preferences Bases: Photoshop The application preference settings. Source code in photoshop/api/_preferences.py 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 class Preferences ( Photoshop ): \"\"\"The application preference settings.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def additionalPluginFolder ( self ): \"\"\"The path to an additional plug-in folder.\"\"\" return Path ( self . app . additionalPluginFolder ) @property def appendExtension ( self ): return self . app . appendExtension @property def askBeforeSavingLayeredTIFF ( self ) -> bool : return self . app . askBeforeSavingLayeredTIFF @property def autoUpdateOpenDocuments ( self ) -> bool : \"\"\"True to automatically update open documents.\"\"\" return self . app . autoUpdateOpenDocuments @autoUpdateOpenDocuments . setter def autoUpdateOpenDocuments ( self , boolean : bool ): \"\"\"True to automatically update open documents.\"\"\" self . app . autoUpdateOpenDocuments = boolean @property def beepWhenDone ( self ) -> bool : \"\"\"True to beep when a process.\"\"\" return self . app . beepWhenDone @beepWhenDone . setter def beepWhenDone ( self , boolean ): self . app . beepWhenDone = boolean @property def colorChannelsInColor ( self ): \"\"\"True to display component channels in the Channels palette in color.\"\"\" return self . app . colorChannelsInColor @colorChannelsInColor . setter def colorChannelsInColor ( self , value ): self . app . colorChannelsInColor = value @property def colorPicker ( self ): \"\"\"The preferred color selection tool.\"\"\" return self . app . colorPicker @colorPicker . setter def colorPicker ( self , value ): self . app . colorPicker = value @property def columnGutter ( self ): return self . app . columnGutter @columnGutter . setter def columnGutter ( self , value ): self . app . columnGutter = value @property def columnWidth ( self ): return self . app . columnWidth @columnWidth . setter def columnWidth ( self , value ): self . app . columnWidth = value @property def createFirstSnapshot ( self ): \"\"\"Automatically make the first snapshot when a new document is created.\"\"\" return self . app . createFirstSnapshot @createFirstSnapshot . setter def createFirstSnapshot ( self , boolean ): self . app . createFirstSnapshot = boolean @property def dynamicColorSliders ( self ): return self . app . dynamicColorSliders @dynamicColorSliders . setter def dynamicColorSliders ( self , boolean ): self . app . dynamicColorSliders = boolean @property def editLogItems ( self ) -> bool : \"\"\"The preferred level of detail in the history log.\"\"\" return self . app . editLogItems @editLogItems . setter def editLogItems ( self , boolean : bool ): \"\"\"The preferred level of detail in the history log. Valid only when useHistoryLog = True \"\"\" self . app . editLogItems = boolean @property def exportClipboard ( self ): \"\"\"Retain Photoshop contents on the clipboard after exit the app.\"\"\" return self . app . exportClipboard @exportClipboard . setter def exportClipboard ( self , boolean : bool ): self . app . exportClipboard = boolean @property def fontPreviewSize ( self ): return self . app . fontPreviewSize @fontPreviewSize . setter def fontPreviewSize ( self , value ): self . app . fontPreviewSize = value @property def fullSizePreview ( self ): return self . app . fullSizePreview @fullSizePreview . setter def fullSizePreview ( self , value ): self . app . fullSizePreview = value @property def gamutWarningOpacity ( self ): return self . app . gamutWarningOpacity @property def rulerUnits ( self ): return self . app . rulerUnits @rulerUnits . setter def rulerUnits ( self , value ): self . app . rulerUnits = value additionalPluginFolder property The path to an additional plug-in folder. autoUpdateOpenDocuments : bool property writable True to automatically update open documents. beepWhenDone : bool property writable True to beep when a process. colorChannelsInColor property writable True to display component channels in the Channels palette in color. colorPicker property writable The preferred color selection tool. createFirstSnapshot property writable Automatically make the first snapshot when a new document is created. editLogItems : bool property writable The preferred level of detail in the history log. exportClipboard property writable Retain Photoshop contents on the clipboard after exit the app.","title":"preferences"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences","text":"Bases: Photoshop The application preference settings. Source code in photoshop/api/_preferences.py 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 class Preferences ( Photoshop ): \"\"\"The application preference settings.\"\"\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def additionalPluginFolder ( self ): \"\"\"The path to an additional plug-in folder.\"\"\" return Path ( self . app . additionalPluginFolder ) @property def appendExtension ( self ): return self . app . appendExtension @property def askBeforeSavingLayeredTIFF ( self ) -> bool : return self . app . askBeforeSavingLayeredTIFF @property def autoUpdateOpenDocuments ( self ) -> bool : \"\"\"True to automatically update open documents.\"\"\" return self . app . autoUpdateOpenDocuments @autoUpdateOpenDocuments . setter def autoUpdateOpenDocuments ( self , boolean : bool ): \"\"\"True to automatically update open documents.\"\"\" self . app . autoUpdateOpenDocuments = boolean @property def beepWhenDone ( self ) -> bool : \"\"\"True to beep when a process.\"\"\" return self . app . beepWhenDone @beepWhenDone . setter def beepWhenDone ( self , boolean ): self . app . beepWhenDone = boolean @property def colorChannelsInColor ( self ): \"\"\"True to display component channels in the Channels palette in color.\"\"\" return self . app . colorChannelsInColor @colorChannelsInColor . setter def colorChannelsInColor ( self , value ): self . app . colorChannelsInColor = value @property def colorPicker ( self ): \"\"\"The preferred color selection tool.\"\"\" return self . app . colorPicker @colorPicker . setter def colorPicker ( self , value ): self . app . colorPicker = value @property def columnGutter ( self ): return self . app . columnGutter @columnGutter . setter def columnGutter ( self , value ): self . app . columnGutter = value @property def columnWidth ( self ): return self . app . columnWidth @columnWidth . setter def columnWidth ( self , value ): self . app . columnWidth = value @property def createFirstSnapshot ( self ): \"\"\"Automatically make the first snapshot when a new document is created.\"\"\" return self . app . createFirstSnapshot @createFirstSnapshot . setter def createFirstSnapshot ( self , boolean ): self . app . createFirstSnapshot = boolean @property def dynamicColorSliders ( self ): return self . app . dynamicColorSliders @dynamicColorSliders . setter def dynamicColorSliders ( self , boolean ): self . app . dynamicColorSliders = boolean @property def editLogItems ( self ) -> bool : \"\"\"The preferred level of detail in the history log.\"\"\" return self . app . editLogItems @editLogItems . setter def editLogItems ( self , boolean : bool ): \"\"\"The preferred level of detail in the history log. Valid only when useHistoryLog = True \"\"\" self . app . editLogItems = boolean @property def exportClipboard ( self ): \"\"\"Retain Photoshop contents on the clipboard after exit the app.\"\"\" return self . app . exportClipboard @exportClipboard . setter def exportClipboard ( self , boolean : bool ): self . app . exportClipboard = boolean @property def fontPreviewSize ( self ): return self . app . fontPreviewSize @fontPreviewSize . setter def fontPreviewSize ( self , value ): self . app . fontPreviewSize = value @property def fullSizePreview ( self ): return self . app . fullSizePreview @fullSizePreview . setter def fullSizePreview ( self , value ): self . app . fullSizePreview = value @property def gamutWarningOpacity ( self ): return self . app . gamutWarningOpacity @property def rulerUnits ( self ): return self . app . rulerUnits @rulerUnits . setter def rulerUnits ( self , value ): self . app . rulerUnits = value","title":"Preferences"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.additionalPluginFolder","text":"The path to an additional plug-in folder.","title":"additionalPluginFolder"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.autoUpdateOpenDocuments","text":"True to automatically update open documents.","title":"autoUpdateOpenDocuments"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.beepWhenDone","text":"True to beep when a process.","title":"beepWhenDone"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.colorChannelsInColor","text":"True to display component channels in the Channels palette in color.","title":"colorChannelsInColor"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.colorPicker","text":"The preferred color selection tool.","title":"colorPicker"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.createFirstSnapshot","text":"Automatically make the first snapshot when a new document is created.","title":"createFirstSnapshot"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.editLogItems","text":"The preferred level of detail in the history log.","title":"editLogItems"},{"location":"reference/photoshop/api/_preferences/#photoshop.api._preferences.Preferences.exportClipboard","text":"Retain Photoshop contents on the clipboard after exit the app.","title":"exportClipboard"},{"location":"reference/photoshop/api/_selection/","text":"The selected area of the document or layer. Selection Bases: Photoshop The selected area of the document. Source code in photoshop/api/_selection.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 class Selection ( Photoshop ): \"\"\"The selected area of the document.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"clear\" , \"contract\" , \"copy\" , \"cut\" , \"deselect\" , \"expand\" , \"feather\" , \"fill\" , \"grow\" , \"invert\" , \"load\" , \"makeWorkPath\" , \"resize\" , \"resizeBoundary\" , \"rotate\" , \"rotateBoundary\" , \"select\" , \"selectBorder\" , \"similar\" , \"smooth\" , \"store\" , \"stroke\" , \"translate\" , \"translateBoundary\" , ) @property def bounds ( self ): return self . app . bounds def parent ( self ): return self . app . parent @property def solid ( self ): return self . app . solid @property def typename ( self ): return self . app . typename def clear ( self ): \"\"\"Clears the selection and does not copy it to the clipboard.\"\"\" self . app . clear () def contract ( self , contract_by ): \"\"\"Contracts the selection.\"\"\" self . app . contract ( contract_by ) def copy ( self ): \"\"\"Copies the selection to the clipboard.\"\"\" self . app . copy () def cut ( self ): \"\"\"Cuts the current selection to the clipboard.\"\"\" self . app . cut () def select ( self , * args , ** kwargs ): return self . app . select ( * args , ** kwargs ) def deselect ( self ): \"\"\"Deselects the current selection.\"\"\" return self . app . deselect () def expand ( self , by : int ): \"\"\"Expands the selection. Args: by: The amount to expand the selection. \"\"\" self . app . expand ( by ) def feather ( self , by : int ): \"\"\"Feathers the edges of the selection. Args: by: The amount to feather the edge. \"\"\" return self . app . feather ( by ) def fill ( self , fill_type : SolidColor , mode : ColorBlendMode = None , opacity = None , preserve_transparency = None , ): \"\"\"Fills the selection.\"\"\" return self . app . fill ( fill_type , mode , opacity , preserve_transparency ) def grow ( self , tolerance , anti_alias ): \"\"\"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Args: tolerance (int): The tolerance range. Range: 0 to 255. anti_alias (bool): If true, anti-aliasing is used. \"\"\" return self . app . grow ( tolerance , anti_alias ) def invert ( self ): \"\"\"Inverts the selection.\"\"\" self . app . invert () def load ( self , from_channel , combination , inverting ): \"\"\"Loads the selection from the specified channel.\"\"\" return self . app . load ( from_channel , combination , inverting ) def makeWorkPath ( self , tolerance ): \"\"\"Makes this selection item the workpath for this document.\"\"\" self . app . makeWorkPath ( tolerance ) def resize ( self , horizontal , vertical , anchor ): \"\"\"Resizes the selected area to the specified dimensions and anchor position.\"\"\" self . app . resize ( horizontal , vertical , anchor ) def resizeBoundary ( self , horizontal , vertical , anchor ): \"\"\"Scales the boundary of the selection.\"\"\" self . app . resizeBoundary ( horizontal , vertical , anchor ) def rotate ( self , angle , anchor ): \"\"\"Rotates the object.\"\"\" self . app . rotate ( angle , anchor ) def rotateBoundary ( self , angle , anchor ): \"\"\"Rotates the boundary of the selection.\"\"\" self . app . rotateBoundary ( angle , anchor ) def stroke ( self , strokeColor , width , location , mode , opacity , preserveTransparency ): \"\"\"Strokes the selection. Args: strokeColor (SolidColor): The color to stroke the selection with. width (int): The stroke width. location (int): The stroke location. mode (int): The color blend mode. opacity (int): The opacity of the stroke color as a percentage. Range: 1 to 100. preserveTransparency (bool): If true, preserves transparency. \"\"\" return self . app . stroke ( strokeColor , width , location , mode , opacity , preserveTransparency ) def selectBorder ( self , width ): \"\"\"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Args: width (int): The width of the border selection. \"\"\" return self . app . selectBorder ( width ) def similar ( self , tolerance , antiAlias ): return self . app . similar ( tolerance , antiAlias ) def smooth ( self , radius ): \"\"\"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).\"\"\" return self . app . smooth ( radius ) def store ( self , into , combination = SelectionType . ReplaceSelection ): \"\"\"Saves the selection as a channel.\"\"\" return self . app . store ( into , combination ) def translate ( self , deltaX , deltaY ): \"\"\"Moves the object relative to its current position.\"\"\" return self . app . translate ( deltaX , deltaY ) def translateBoundary ( self , deltaX , deltaY ): \"\"\"Moves the boundary of selection relative to its current position.\"\"\" return self . app . translateBoundary ( deltaX , deltaY ) clear () Clears the selection and does not copy it to the clipboard. Source code in photoshop/api/_selection.py 58 59 60 def clear ( self ): \"\"\"Clears the selection and does not copy it to the clipboard.\"\"\" self . app . clear () contract ( contract_by ) Contracts the selection. Source code in photoshop/api/_selection.py 62 63 64 def contract ( self , contract_by ): \"\"\"Contracts the selection.\"\"\" self . app . contract ( contract_by ) copy () Copies the selection to the clipboard. Source code in photoshop/api/_selection.py 66 67 68 def copy ( self ): \"\"\"Copies the selection to the clipboard.\"\"\" self . app . copy () cut () Cuts the current selection to the clipboard. Source code in photoshop/api/_selection.py 70 71 72 def cut ( self ): \"\"\"Cuts the current selection to the clipboard.\"\"\" self . app . cut () deselect () Deselects the current selection. Source code in photoshop/api/_selection.py 77 78 79 def deselect ( self ): \"\"\"Deselects the current selection.\"\"\" return self . app . deselect () expand ( by ) Expands the selection. Parameters: Name Type Description Default by int The amount to expand the selection. required Source code in photoshop/api/_selection.py 81 82 83 84 85 86 87 88 def expand ( self , by : int ): \"\"\"Expands the selection. Args: by: The amount to expand the selection. \"\"\" self . app . expand ( by ) feather ( by ) Feathers the edges of the selection. Parameters: Name Type Description Default by int The amount to feather the edge. required Source code in photoshop/api/_selection.py 90 91 92 93 94 95 96 97 def feather ( self , by : int ): \"\"\"Feathers the edges of the selection. Args: by: The amount to feather the edge. \"\"\" return self . app . feather ( by ) fill ( fill_type , mode = None , opacity = None , preserve_transparency = None ) Fills the selection. Source code in photoshop/api/_selection.py 99 100 101 102 103 104 105 106 107 def fill ( self , fill_type : SolidColor , mode : ColorBlendMode = None , opacity = None , preserve_transparency = None , ): \"\"\"Fills the selection.\"\"\" return self . app . fill ( fill_type , mode , opacity , preserve_transparency ) grow ( tolerance , anti_alias ) Grows the selection to include all adjacent pixels falling within The specified tolerance range. Parameters: Name Type Description Default tolerance int The tolerance range. Range: 0 to 255. required anti_alias bool If true, anti-aliasing is used. required Source code in photoshop/api/_selection.py 109 110 111 112 113 114 115 116 117 118 119 120 def grow ( self , tolerance , anti_alias ): \"\"\"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Args: tolerance (int): The tolerance range. Range: 0 to 255. anti_alias (bool): If true, anti-aliasing is used. \"\"\" return self . app . grow ( tolerance , anti_alias ) invert () Inverts the selection. Source code in photoshop/api/_selection.py 122 123 124 def invert ( self ): \"\"\"Inverts the selection.\"\"\" self . app . invert () load ( from_channel , combination , inverting ) Loads the selection from the specified channel. Source code in photoshop/api/_selection.py 126 127 128 def load ( self , from_channel , combination , inverting ): \"\"\"Loads the selection from the specified channel.\"\"\" return self . app . load ( from_channel , combination , inverting ) makeWorkPath ( tolerance ) Makes this selection item the workpath for this document. Source code in photoshop/api/_selection.py 130 131 132 def makeWorkPath ( self , tolerance ): \"\"\"Makes this selection item the workpath for this document.\"\"\" self . app . makeWorkPath ( tolerance ) resize ( horizontal , vertical , anchor ) Resizes the selected area to the specified dimensions and anchor position. Source code in photoshop/api/_selection.py 134 135 136 137 def resize ( self , horizontal , vertical , anchor ): \"\"\"Resizes the selected area to the specified dimensions and anchor position.\"\"\" self . app . resize ( horizontal , vertical , anchor ) resizeBoundary ( horizontal , vertical , anchor ) Scales the boundary of the selection. Source code in photoshop/api/_selection.py 139 140 141 def resizeBoundary ( self , horizontal , vertical , anchor ): \"\"\"Scales the boundary of the selection.\"\"\" self . app . resizeBoundary ( horizontal , vertical , anchor ) rotate ( angle , anchor ) Rotates the object. Source code in photoshop/api/_selection.py 143 144 145 def rotate ( self , angle , anchor ): \"\"\"Rotates the object.\"\"\" self . app . rotate ( angle , anchor ) rotateBoundary ( angle , anchor ) Rotates the boundary of the selection. Source code in photoshop/api/_selection.py 147 148 149 def rotateBoundary ( self , angle , anchor ): \"\"\"Rotates the boundary of the selection.\"\"\" self . app . rotateBoundary ( angle , anchor ) selectBorder ( width ) Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Parameters: Name Type Description Default width int The width of the border selection. required Source code in photoshop/api/_selection.py 166 167 168 169 170 171 172 173 174 def selectBorder ( self , width ): \"\"\"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Args: width (int): The width of the border selection. \"\"\" return self . app . selectBorder ( width ) smooth ( radius ) Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels). Source code in photoshop/api/_selection.py 179 180 181 182 def smooth ( self , radius ): \"\"\"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).\"\"\" return self . app . smooth ( radius ) store ( into , combination = SelectionType . ReplaceSelection ) Saves the selection as a channel. Source code in photoshop/api/_selection.py 184 185 186 def store ( self , into , combination = SelectionType . ReplaceSelection ): \"\"\"Saves the selection as a channel.\"\"\" return self . app . store ( into , combination ) stroke ( strokeColor , width , location , mode , opacity , preserveTransparency ) Strokes the selection. Parameters: Name Type Description Default strokeColor SolidColor The color to stroke the selection with. required width int The stroke width. required location int The stroke location. required mode int The color blend mode. required opacity int The opacity of the stroke color as a percentage. Range: 1 to 100. required preserveTransparency bool If true, preserves transparency. required Source code in photoshop/api/_selection.py 151 152 153 154 155 156 157 158 159 160 161 162 163 164 def stroke ( self , strokeColor , width , location , mode , opacity , preserveTransparency ): \"\"\"Strokes the selection. Args: strokeColor (SolidColor): The color to stroke the selection with. width (int): The stroke width. location (int): The stroke location. mode (int): The color blend mode. opacity (int): The opacity of the stroke color as a percentage. Range: 1 to 100. preserveTransparency (bool): If true, preserves transparency. \"\"\" return self . app . stroke ( strokeColor , width , location , mode , opacity , preserveTransparency ) translate ( deltaX , deltaY ) Moves the object relative to its current position. Source code in photoshop/api/_selection.py 188 189 190 def translate ( self , deltaX , deltaY ): \"\"\"Moves the object relative to its current position.\"\"\" return self . app . translate ( deltaX , deltaY ) translateBoundary ( deltaX , deltaY ) Moves the boundary of selection relative to its current position. Source code in photoshop/api/_selection.py 192 193 194 def translateBoundary ( self , deltaX , deltaY ): \"\"\"Moves the boundary of selection relative to its current position.\"\"\" return self . app . translateBoundary ( deltaX , deltaY )","title":"selection"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection","text":"Bases: Photoshop The selected area of the document. Source code in photoshop/api/_selection.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 class Selection ( Photoshop ): \"\"\"The selected area of the document.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"clear\" , \"contract\" , \"copy\" , \"cut\" , \"deselect\" , \"expand\" , \"feather\" , \"fill\" , \"grow\" , \"invert\" , \"load\" , \"makeWorkPath\" , \"resize\" , \"resizeBoundary\" , \"rotate\" , \"rotateBoundary\" , \"select\" , \"selectBorder\" , \"similar\" , \"smooth\" , \"store\" , \"stroke\" , \"translate\" , \"translateBoundary\" , ) @property def bounds ( self ): return self . app . bounds def parent ( self ): return self . app . parent @property def solid ( self ): return self . app . solid @property def typename ( self ): return self . app . typename def clear ( self ): \"\"\"Clears the selection and does not copy it to the clipboard.\"\"\" self . app . clear () def contract ( self , contract_by ): \"\"\"Contracts the selection.\"\"\" self . app . contract ( contract_by ) def copy ( self ): \"\"\"Copies the selection to the clipboard.\"\"\" self . app . copy () def cut ( self ): \"\"\"Cuts the current selection to the clipboard.\"\"\" self . app . cut () def select ( self , * args , ** kwargs ): return self . app . select ( * args , ** kwargs ) def deselect ( self ): \"\"\"Deselects the current selection.\"\"\" return self . app . deselect () def expand ( self , by : int ): \"\"\"Expands the selection. Args: by: The amount to expand the selection. \"\"\" self . app . expand ( by ) def feather ( self , by : int ): \"\"\"Feathers the edges of the selection. Args: by: The amount to feather the edge. \"\"\" return self . app . feather ( by ) def fill ( self , fill_type : SolidColor , mode : ColorBlendMode = None , opacity = None , preserve_transparency = None , ): \"\"\"Fills the selection.\"\"\" return self . app . fill ( fill_type , mode , opacity , preserve_transparency ) def grow ( self , tolerance , anti_alias ): \"\"\"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Args: tolerance (int): The tolerance range. Range: 0 to 255. anti_alias (bool): If true, anti-aliasing is used. \"\"\" return self . app . grow ( tolerance , anti_alias ) def invert ( self ): \"\"\"Inverts the selection.\"\"\" self . app . invert () def load ( self , from_channel , combination , inverting ): \"\"\"Loads the selection from the specified channel.\"\"\" return self . app . load ( from_channel , combination , inverting ) def makeWorkPath ( self , tolerance ): \"\"\"Makes this selection item the workpath for this document.\"\"\" self . app . makeWorkPath ( tolerance ) def resize ( self , horizontal , vertical , anchor ): \"\"\"Resizes the selected area to the specified dimensions and anchor position.\"\"\" self . app . resize ( horizontal , vertical , anchor ) def resizeBoundary ( self , horizontal , vertical , anchor ): \"\"\"Scales the boundary of the selection.\"\"\" self . app . resizeBoundary ( horizontal , vertical , anchor ) def rotate ( self , angle , anchor ): \"\"\"Rotates the object.\"\"\" self . app . rotate ( angle , anchor ) def rotateBoundary ( self , angle , anchor ): \"\"\"Rotates the boundary of the selection.\"\"\" self . app . rotateBoundary ( angle , anchor ) def stroke ( self , strokeColor , width , location , mode , opacity , preserveTransparency ): \"\"\"Strokes the selection. Args: strokeColor (SolidColor): The color to stroke the selection with. width (int): The stroke width. location (int): The stroke location. mode (int): The color blend mode. opacity (int): The opacity of the stroke color as a percentage. Range: 1 to 100. preserveTransparency (bool): If true, preserves transparency. \"\"\" return self . app . stroke ( strokeColor , width , location , mode , opacity , preserveTransparency ) def selectBorder ( self , width ): \"\"\"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Args: width (int): The width of the border selection. \"\"\" return self . app . selectBorder ( width ) def similar ( self , tolerance , antiAlias ): return self . app . similar ( tolerance , antiAlias ) def smooth ( self , radius ): \"\"\"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).\"\"\" return self . app . smooth ( radius ) def store ( self , into , combination = SelectionType . ReplaceSelection ): \"\"\"Saves the selection as a channel.\"\"\" return self . app . store ( into , combination ) def translate ( self , deltaX , deltaY ): \"\"\"Moves the object relative to its current position.\"\"\" return self . app . translate ( deltaX , deltaY ) def translateBoundary ( self , deltaX , deltaY ): \"\"\"Moves the boundary of selection relative to its current position.\"\"\" return self . app . translateBoundary ( deltaX , deltaY )","title":"Selection"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.clear","text":"Clears the selection and does not copy it to the clipboard. Source code in photoshop/api/_selection.py 58 59 60 def clear ( self ): \"\"\"Clears the selection and does not copy it to the clipboard.\"\"\" self . app . clear ()","title":"clear()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.contract","text":"Contracts the selection. Source code in photoshop/api/_selection.py 62 63 64 def contract ( self , contract_by ): \"\"\"Contracts the selection.\"\"\" self . app . contract ( contract_by )","title":"contract()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.copy","text":"Copies the selection to the clipboard. Source code in photoshop/api/_selection.py 66 67 68 def copy ( self ): \"\"\"Copies the selection to the clipboard.\"\"\" self . app . copy ()","title":"copy()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.cut","text":"Cuts the current selection to the clipboard. Source code in photoshop/api/_selection.py 70 71 72 def cut ( self ): \"\"\"Cuts the current selection to the clipboard.\"\"\" self . app . cut ()","title":"cut()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.deselect","text":"Deselects the current selection. Source code in photoshop/api/_selection.py 77 78 79 def deselect ( self ): \"\"\"Deselects the current selection.\"\"\" return self . app . deselect ()","title":"deselect()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.expand","text":"Expands the selection. Parameters: Name Type Description Default by int The amount to expand the selection. required Source code in photoshop/api/_selection.py 81 82 83 84 85 86 87 88 def expand ( self , by : int ): \"\"\"Expands the selection. Args: by: The amount to expand the selection. \"\"\" self . app . expand ( by )","title":"expand()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.feather","text":"Feathers the edges of the selection. Parameters: Name Type Description Default by int The amount to feather the edge. required Source code in photoshop/api/_selection.py 90 91 92 93 94 95 96 97 def feather ( self , by : int ): \"\"\"Feathers the edges of the selection. Args: by: The amount to feather the edge. \"\"\" return self . app . feather ( by )","title":"feather()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.fill","text":"Fills the selection. Source code in photoshop/api/_selection.py 99 100 101 102 103 104 105 106 107 def fill ( self , fill_type : SolidColor , mode : ColorBlendMode = None , opacity = None , preserve_transparency = None , ): \"\"\"Fills the selection.\"\"\" return self . app . fill ( fill_type , mode , opacity , preserve_transparency )","title":"fill()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.grow","text":"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Parameters: Name Type Description Default tolerance int The tolerance range. Range: 0 to 255. required anti_alias bool If true, anti-aliasing is used. required Source code in photoshop/api/_selection.py 109 110 111 112 113 114 115 116 117 118 119 120 def grow ( self , tolerance , anti_alias ): \"\"\"Grows the selection to include all adjacent pixels falling within The specified tolerance range. Args: tolerance (int): The tolerance range. Range: 0 to 255. anti_alias (bool): If true, anti-aliasing is used. \"\"\" return self . app . grow ( tolerance , anti_alias )","title":"grow()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.invert","text":"Inverts the selection. Source code in photoshop/api/_selection.py 122 123 124 def invert ( self ): \"\"\"Inverts the selection.\"\"\" self . app . invert ()","title":"invert()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.load","text":"Loads the selection from the specified channel. Source code in photoshop/api/_selection.py 126 127 128 def load ( self , from_channel , combination , inverting ): \"\"\"Loads the selection from the specified channel.\"\"\" return self . app . load ( from_channel , combination , inverting )","title":"load()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.makeWorkPath","text":"Makes this selection item the workpath for this document. Source code in photoshop/api/_selection.py 130 131 132 def makeWorkPath ( self , tolerance ): \"\"\"Makes this selection item the workpath for this document.\"\"\" self . app . makeWorkPath ( tolerance )","title":"makeWorkPath()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.resize","text":"Resizes the selected area to the specified dimensions and anchor position. Source code in photoshop/api/_selection.py 134 135 136 137 def resize ( self , horizontal , vertical , anchor ): \"\"\"Resizes the selected area to the specified dimensions and anchor position.\"\"\" self . app . resize ( horizontal , vertical , anchor )","title":"resize()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.resizeBoundary","text":"Scales the boundary of the selection. Source code in photoshop/api/_selection.py 139 140 141 def resizeBoundary ( self , horizontal , vertical , anchor ): \"\"\"Scales the boundary of the selection.\"\"\" self . app . resizeBoundary ( horizontal , vertical , anchor )","title":"resizeBoundary()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.rotate","text":"Rotates the object. Source code in photoshop/api/_selection.py 143 144 145 def rotate ( self , angle , anchor ): \"\"\"Rotates the object.\"\"\" self . app . rotate ( angle , anchor )","title":"rotate()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.rotateBoundary","text":"Rotates the boundary of the selection. Source code in photoshop/api/_selection.py 147 148 149 def rotateBoundary ( self , angle , anchor ): \"\"\"Rotates the boundary of the selection.\"\"\" self . app . rotateBoundary ( angle , anchor )","title":"rotateBoundary()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.selectBorder","text":"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Parameters: Name Type Description Default width int The width of the border selection. required Source code in photoshop/api/_selection.py 166 167 168 169 170 171 172 173 174 def selectBorder ( self , width ): \"\"\"Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders. Args: width (int): The width of the border selection. \"\"\" return self . app . selectBorder ( width )","title":"selectBorder()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.smooth","text":"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels). Source code in photoshop/api/_selection.py 179 180 181 182 def smooth ( self , radius ): \"\"\"Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).\"\"\" return self . app . smooth ( radius )","title":"smooth()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.store","text":"Saves the selection as a channel. Source code in photoshop/api/_selection.py 184 185 186 def store ( self , into , combination = SelectionType . ReplaceSelection ): \"\"\"Saves the selection as a channel.\"\"\" return self . app . store ( into , combination )","title":"store()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.stroke","text":"Strokes the selection. Parameters: Name Type Description Default strokeColor SolidColor The color to stroke the selection with. required width int The stroke width. required location int The stroke location. required mode int The color blend mode. required opacity int The opacity of the stroke color as a percentage. Range: 1 to 100. required preserveTransparency bool If true, preserves transparency. required Source code in photoshop/api/_selection.py 151 152 153 154 155 156 157 158 159 160 161 162 163 164 def stroke ( self , strokeColor , width , location , mode , opacity , preserveTransparency ): \"\"\"Strokes the selection. Args: strokeColor (SolidColor): The color to stroke the selection with. width (int): The stroke width. location (int): The stroke location. mode (int): The color blend mode. opacity (int): The opacity of the stroke color as a percentage. Range: 1 to 100. preserveTransparency (bool): If true, preserves transparency. \"\"\" return self . app . stroke ( strokeColor , width , location , mode , opacity , preserveTransparency )","title":"stroke()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.translate","text":"Moves the object relative to its current position. Source code in photoshop/api/_selection.py 188 189 190 def translate ( self , deltaX , deltaY ): \"\"\"Moves the object relative to its current position.\"\"\" return self . app . translate ( deltaX , deltaY )","title":"translate()"},{"location":"reference/photoshop/api/_selection/#photoshop.api._selection.Selection.translateBoundary","text":"Moves the boundary of selection relative to its current position. Source code in photoshop/api/_selection.py 192 193 194 def translateBoundary ( self , deltaX , deltaY ): \"\"\"Moves the boundary of selection relative to its current position.\"\"\" return self . app . translateBoundary ( deltaX , deltaY )","title":"translateBoundary()"},{"location":"reference/photoshop/api/_text_fonts/","text":"TextFonts Bases: Photoshop An installed font. Source code in photoshop/api/_text_fonts.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 class TextFonts ( Photoshop ): \"\"\"An installed font.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) \"\"\" MAGIC METHODS \"\"\" def __len__ ( self ): return self . length def __iter__ ( self ): for font in self . app : yield TextFont ( font ) def __contains__ ( self , name : str ): \"\"\"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Args: name: Name or postScriptName of the font to look for. Returns: bool: True if font is found, otherwise False. \"\"\" # Look for postScriptName if self . get ( name ): return True # Look for name (slow) for font in self : try : if font . name == name : return True except COMError : continue return False def __getitem__ ( self , key : str ): \"\"\"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Args: key: The postScriptName of the font. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a font with postScriptName \" { key } \"' ) \"\"\" METHODS \"\"\" def get ( self , key : str , default : Any = None ) -> Union [ TextFont , Any ]: \"\"\" Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Args: key: The postScriptName of the font. default: Value to return if font isn't found. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ( KeyError , ArgumentError ): return default def getByName ( self , name : str ) -> TextFont : \"\"\"Gets the font by the font name. Args: name: The name of the font. Returns: font instance. \"\"\" for font in self . app : if font . name == name : return TextFont ( font ) raise PhotoshopPythonAPIError ( 'Could not find a TextFont named \" {name} \"' ) \"\"\" PROPERTIES \"\"\" @property def _fonts ( self ): return [ a for a in self . app ] @property def length ( self ): \"\"\"The number pf elements in the collection.\"\"\" return len ( self . _fonts ) length property The number pf elements in the collection. __contains__ ( name ) Check if a font is installed. Lookup by font postScriptName (fastest) or name. Parameters: Name Type Description Default name str Name or postScriptName of the font to look for. required Returns: Name Type Description bool True if font is found, otherwise False. Source code in photoshop/api/_text_fonts.py 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 def __contains__ ( self , name : str ): \"\"\"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Args: name: Name or postScriptName of the font to look for. Returns: bool: True if font is found, otherwise False. \"\"\" # Look for postScriptName if self . get ( name ): return True # Look for name (slow) for font in self : try : if font . name == name : return True except COMError : continue return False __getitem__ ( key ) Access a given TextFont using dictionary key lookup, must provide the postScriptName. Parameters: Name Type Description Default key str The postScriptName of the font. required Returns: Type Description TextFont instance. Source code in photoshop/api/_text_fonts.py 53 54 55 56 57 58 59 60 61 62 63 64 65 66 def __getitem__ ( self , key : str ): \"\"\"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Args: key: The postScriptName of the font. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a font with postScriptName \" { key } \"' ) get ( key , default = None ) Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Parameters: Name Type Description Default key str The postScriptName of the font. required default Any Value to return if font isn't found. None Returns: Type Description Union [ TextFont , Any ] TextFont instance. Source code in photoshop/api/_text_fonts.py 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 def get ( self , key : str , default : Any = None ) -> Union [ TextFont , Any ]: \"\"\" Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Args: key: The postScriptName of the font. default: Value to return if font isn't found. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ( KeyError , ArgumentError ): return default getByName ( name ) Gets the font by the font name. Parameters: Name Type Description Default name str The name of the font. required Returns: Type Description TextFont font instance. Source code in photoshop/api/_text_fonts.py 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 def getByName ( self , name : str ) -> TextFont : \"\"\"Gets the font by the font name. Args: name: The name of the font. Returns: font instance. \"\"\" for font in self . app : if font . name == name : return TextFont ( font ) raise PhotoshopPythonAPIError ( 'Could not find a TextFont named \" {name} \"' )","title":"text_fonts"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts","text":"Bases: Photoshop An installed font. Source code in photoshop/api/_text_fonts.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 class TextFonts ( Photoshop ): \"\"\"An installed font.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) \"\"\" MAGIC METHODS \"\"\" def __len__ ( self ): return self . length def __iter__ ( self ): for font in self . app : yield TextFont ( font ) def __contains__ ( self , name : str ): \"\"\"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Args: name: Name or postScriptName of the font to look for. Returns: bool: True if font is found, otherwise False. \"\"\" # Look for postScriptName if self . get ( name ): return True # Look for name (slow) for font in self : try : if font . name == name : return True except COMError : continue return False def __getitem__ ( self , key : str ): \"\"\"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Args: key: The postScriptName of the font. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a font with postScriptName \" { key } \"' ) \"\"\" METHODS \"\"\" def get ( self , key : str , default : Any = None ) -> Union [ TextFont , Any ]: \"\"\" Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Args: key: The postScriptName of the font. default: Value to return if font isn't found. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ( KeyError , ArgumentError ): return default def getByName ( self , name : str ) -> TextFont : \"\"\"Gets the font by the font name. Args: name: The name of the font. Returns: font instance. \"\"\" for font in self . app : if font . name == name : return TextFont ( font ) raise PhotoshopPythonAPIError ( 'Could not find a TextFont named \" {name} \"' ) \"\"\" PROPERTIES \"\"\" @property def _fonts ( self ): return [ a for a in self . app ] @property def length ( self ): \"\"\"The number pf elements in the collection.\"\"\" return len ( self . _fonts )","title":"TextFonts"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.length","text":"The number pf elements in the collection.","title":"length"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.__contains__","text":"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Parameters: Name Type Description Default name str Name or postScriptName of the font to look for. required Returns: Name Type Description bool True if font is found, otherwise False. Source code in photoshop/api/_text_fonts.py 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 def __contains__ ( self , name : str ): \"\"\"Check if a font is installed. Lookup by font postScriptName (fastest) or name. Args: name: Name or postScriptName of the font to look for. Returns: bool: True if font is found, otherwise False. \"\"\" # Look for postScriptName if self . get ( name ): return True # Look for name (slow) for font in self : try : if font . name == name : return True except COMError : continue return False","title":"__contains__()"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.__getitem__","text":"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Parameters: Name Type Description Default key str The postScriptName of the font. required Returns: Type Description TextFont instance. Source code in photoshop/api/_text_fonts.py 53 54 55 56 57 58 59 60 61 62 63 64 65 66 def __getitem__ ( self , key : str ): \"\"\"Access a given TextFont using dictionary key lookup, must provide the postScriptName. Args: key: The postScriptName of the font. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ArgumentError : raise PhotoshopPythonAPIError ( f 'Could not find a font with postScriptName \" { key } \"' )","title":"__getitem__()"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.get","text":"Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Parameters: Name Type Description Default key str The postScriptName of the font. required default Any Value to return if font isn't found. None Returns: Type Description Union [ TextFont , Any ] TextFont instance. Source code in photoshop/api/_text_fonts.py 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 def get ( self , key : str , default : Any = None ) -> Union [ TextFont , Any ]: \"\"\" Accesses a given TextFont using dictionary key lookup of postScriptName, returns default if not found. Args: key: The postScriptName of the font. default: Value to return if font isn't found. Returns: TextFont instance. \"\"\" try : return TextFont ( self . app [ key ]) except ( KeyError , ArgumentError ): return default","title":"get()"},{"location":"reference/photoshop/api/_text_fonts/#photoshop.api._text_fonts.TextFonts.getByName","text":"Gets the font by the font name. Parameters: Name Type Description Default name str The name of the font. required Returns: Type Description TextFont font instance. Source code in photoshop/api/_text_fonts.py 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 def getByName ( self , name : str ) -> TextFont : \"\"\"Gets the font by the font name. Args: name: The name of the font. Returns: font instance. \"\"\" for font in self . app : if font . name == name : return TextFont ( font ) raise PhotoshopPythonAPIError ( 'Could not find a TextFont named \" {name} \"' )","title":"getByName()"},{"location":"reference/photoshop/api/action_descriptor/","text":"A record of key-text_font pairs for actions. such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. ActionDescriptor Bases: Photoshop A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_descriptor.py 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 class ActionDescriptor ( Photoshop ): \"\"\"A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionDescriptor\" def __init__ ( self ): super () . __init__ () self . _flag_as_method ( \"clear\" , \"erase\" , \"fromStream\" , \"getBoolean\" , \"getClass\" , \"getData\" , \"getDouble\" , \"getEnumerationType\" , \"getEnumerationValue\" , \"getInteger\" , \"getKey\" , \"getLargeInteger\" , \"getList\" , \"getObjectType\" , \"getObjectValue\" , \"getPath\" , \"getReference\" , \"getString\" , \"getType\" , \"getUnitDoubleType\" , \"getUnitDoubleValue\" , \"hasKey\" , \"isEqual\" , \"putBoolean\" , \"putClass\" , \"putData\" , \"putDouble\" , \"putEnumerated\" , \"putInteger\" , \"putLargeInteger\" , \"putList\" , \"putObject\" , \"putPath\" , \"putReference\" , \"putString\" , \"putUnitDouble\" , \"toSteadm\" , ) @property def count ( self ): \"\"\"The number of keys contained in the descriptor.\"\"\" return self . app . count def clear ( self ): \"\"\"Clears the descriptor.\"\"\" self . app . clear () def erase ( self , key : int ): \"\"\"Erases a key form the descriptor.\"\"\" self . app . erase ( key ) def fromStream ( self , value : str ): \"\"\"Create a descriptor from a stream of bytes. for reading from disk. \"\"\" self . app . fromStream ( value ) def getBoolean ( self , key : int ) -> int : \"\"\"Gets the text_font of a key of type boolean. Args: key (str): key of type boolean. Returns: bool: The text_font of a key of type boolean. \"\"\" return self . app . getBoolean ( key ) def getClass ( self , key ): \"\"\"Gets the text_font of a key of type class. Args: key (str): The key of type class. Returns: int: The text_font of a key of type class. \"\"\" return self . app . getClass ( key ) def getData ( self , key : int ) -> int : \"\"\"Gets raw byte data as a string value.\"\"\" return self . app . getData ( key ) def getDouble ( self , key : int ) -> float : \"\"\"Gets the value of a key of type double.\"\"\" return self . app . getDouble ( key ) def getEnumerationType ( self , index : int ) -> int : \"\"\"Gets the enumeration type of a key.\"\"\" return self . app . getEnumerationType ( index ) def getEnumerationValue ( self , index : int ) -> int : \"\"\"Gets the enumeration value of a key.\"\"\" return self . app . getEnumerationValue ( index ) def getInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type integer.\"\"\" return self . app . getInteger ( index ) def getKey ( self , index : int ) -> int : \"\"\"Gets the ID of the key provided by index.\"\"\" return self . app . getKey ( index ) def getLargeInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type large integer.\"\"\" return self . app . getLargeInteger ( index ) def getList ( self , index : int ) -> ActionList : \"\"\"Gets the value of a key of type list.\"\"\" return ActionList ( self . app . getList ( index )) def getObjectType ( self , key : int ) -> int : \"\"\"Gets the class ID of an object in a key of type object.\"\"\" return self . app . getObjectType ( key ) def getObjectValue ( self , key : int ) -> int : \"\"\"Get the class ID of an object in a key of type object.\"\"\" return self . app . getObjectValue ( key ) def getPath ( self , key : int ) -> Path : \"\"\"Gets the value of a key of type.\"\"\" return Path ( self . app . getPath ( key )) def getReference ( self , key : int ) -> ActionReference : \"\"\"Gets the value of a key of type.\"\"\" return ActionReference ( self . app . getReference ( key )) def getString ( self , key : int ) -> str : \"\"\"Gets the value of a key of type.\"\"\" return self . app . getString ( key ) def getType ( self , key : int ) -> DescValueType : \"\"\"Gets the type of a key.\"\"\" return DescValueType ( self . app . getType ( key )) def getUnitDoubleType ( self , key : int ) -> int : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleType ( key ) def getUnitDoubleValue ( self , key : int ) -> float : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleValue ( key ) def hasKey ( self , key : int ) -> bool : \"\"\"Checks whether the descriptor contains the provided key.\"\"\" return self . app . hasKey ( key ) def isEqual ( self , otherDesc ) -> bool : \"\"\"Determines whether the descriptor is the same as another descriptor. Args: otherDesc (.action_descriptor.ActionDescriptor): \"\"\" return self . app . isEqual ( otherDesc ) def putBoolean ( self , key : int , value : bool ): \"\"\"Sets the value for a key whose type is boolean.\"\"\" self . app . putBoolean ( key , value ) def putClass ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is class.\"\"\" self . app . putClass ( key , value ) def putData ( self , key : int , value : str ): \"\"\"Puts raw byte data as a string value.\"\"\" self . app . putData ( key , value ) def putDouble ( self , key : int , value : float ): \"\"\"Sets the value for a key whose type is double.\"\"\" self . app . putDouble ( key , value ) def putEnumerated ( self , key : int , enum_type : int , value : int ): \"\"\"Sets the enumeration type and value for a key.\"\"\" self . app . putEnumerated ( key , enum_type , value ) def putInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is integer.\"\"\" self . app . putInteger ( key , value ) def putLargeInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is large integer.\"\"\" self . app . putLargeInteger ( key , value ) def putList ( self , key : int , value : ActionList ): \"\"\"Sets the value for a key whose type is an ActionList object.\"\"\" self . app . putList ( key , value ) def putObject ( self , key : int , class_id : int , value ): \"\"\"Sets the value for a key whose type is an object.\"\"\" self . app . putObject ( key , class_id , value ) def putPath ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is path.\"\"\" self . app . putPath ( key , value ) def putReference ( self , key : int , value : ActionReference ): \"\"\"Sets the value for a key whose type is an object reference.\"\"\" self . app . putReference ( key , value ) def putString ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is string.\"\"\" self . app . putString ( key , value ) def putUnitDouble ( self , key : int , unit_id : int , value : float ): \"\"\"Sets the value for a key whose type is a unit value formatted as double.\"\"\" self . app . putUnitDouble ( key , unit_id , value ) def toStream ( self ) -> str : \"\"\"Gets the entire descriptor as as stream of bytes, for writing to disk.\"\"\" return self . app . toSteadm () count property The number of keys contained in the descriptor. clear () Clears the descriptor. Source code in photoshop/api/action_descriptor.py 77 78 79 def clear ( self ): \"\"\"Clears the descriptor.\"\"\" self . app . clear () erase ( key ) Erases a key form the descriptor. Source code in photoshop/api/action_descriptor.py 81 82 83 def erase ( self , key : int ): \"\"\"Erases a key form the descriptor.\"\"\" self . app . erase ( key ) fromStream ( value ) Create a descriptor from a stream of bytes. for reading from disk. Source code in photoshop/api/action_descriptor.py 85 86 87 88 89 90 91 def fromStream ( self , value : str ): \"\"\"Create a descriptor from a stream of bytes. for reading from disk. \"\"\" self . app . fromStream ( value ) getBoolean ( key ) Gets the text_font of a key of type boolean. Parameters: Name Type Description Default key str key of type boolean. required Returns: Name Type Description bool int The text_font of a key of type boolean. Source code in photoshop/api/action_descriptor.py 93 94 95 96 97 98 99 100 101 102 103 def getBoolean ( self , key : int ) -> int : \"\"\"Gets the text_font of a key of type boolean. Args: key (str): key of type boolean. Returns: bool: The text_font of a key of type boolean. \"\"\" return self . app . getBoolean ( key ) getClass ( key ) Gets the text_font of a key of type class. Parameters: Name Type Description Default key str The key of type class. required Returns: Name Type Description int The text_font of a key of type class. Source code in photoshop/api/action_descriptor.py 105 106 107 108 109 110 111 112 113 114 115 def getClass ( self , key ): \"\"\"Gets the text_font of a key of type class. Args: key (str): The key of type class. Returns: int: The text_font of a key of type class. \"\"\" return self . app . getClass ( key ) getData ( key ) Gets raw byte data as a string value. Source code in photoshop/api/action_descriptor.py 117 118 119 def getData ( self , key : int ) -> int : \"\"\"Gets raw byte data as a string value.\"\"\" return self . app . getData ( key ) getDouble ( key ) Gets the value of a key of type double. Source code in photoshop/api/action_descriptor.py 121 122 123 def getDouble ( self , key : int ) -> float : \"\"\"Gets the value of a key of type double.\"\"\" return self . app . getDouble ( key ) getEnumerationType ( index ) Gets the enumeration type of a key. Source code in photoshop/api/action_descriptor.py 125 126 127 def getEnumerationType ( self , index : int ) -> int : \"\"\"Gets the enumeration type of a key.\"\"\" return self . app . getEnumerationType ( index ) getEnumerationValue ( index ) Gets the enumeration value of a key. Source code in photoshop/api/action_descriptor.py 129 130 131 def getEnumerationValue ( self , index : int ) -> int : \"\"\"Gets the enumeration value of a key.\"\"\" return self . app . getEnumerationValue ( index ) getInteger ( index ) Gets the value of a key of type integer. Source code in photoshop/api/action_descriptor.py 133 134 135 def getInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type integer.\"\"\" return self . app . getInteger ( index ) getKey ( index ) Gets the ID of the key provided by index. Source code in photoshop/api/action_descriptor.py 137 138 139 def getKey ( self , index : int ) -> int : \"\"\"Gets the ID of the key provided by index.\"\"\" return self . app . getKey ( index ) getLargeInteger ( index ) Gets the value of a key of type large integer. Source code in photoshop/api/action_descriptor.py 141 142 143 def getLargeInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type large integer.\"\"\" return self . app . getLargeInteger ( index ) getList ( index ) Gets the value of a key of type list. Source code in photoshop/api/action_descriptor.py 145 146 147 def getList ( self , index : int ) -> ActionList : \"\"\"Gets the value of a key of type list.\"\"\" return ActionList ( self . app . getList ( index )) getObjectType ( key ) Gets the class ID of an object in a key of type object. Source code in photoshop/api/action_descriptor.py 149 150 151 def getObjectType ( self , key : int ) -> int : \"\"\"Gets the class ID of an object in a key of type object.\"\"\" return self . app . getObjectType ( key ) getObjectValue ( key ) Get the class ID of an object in a key of type object. Source code in photoshop/api/action_descriptor.py 153 154 155 def getObjectValue ( self , key : int ) -> int : \"\"\"Get the class ID of an object in a key of type object.\"\"\" return self . app . getObjectValue ( key ) getPath ( key ) Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 157 158 159 def getPath ( self , key : int ) -> Path : \"\"\"Gets the value of a key of type.\"\"\" return Path ( self . app . getPath ( key )) getReference ( key ) Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 161 162 163 def getReference ( self , key : int ) -> ActionReference : \"\"\"Gets the value of a key of type.\"\"\" return ActionReference ( self . app . getReference ( key )) getString ( key ) Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 165 166 167 def getString ( self , key : int ) -> str : \"\"\"Gets the value of a key of type.\"\"\" return self . app . getString ( key ) getType ( key ) Gets the type of a key. Source code in photoshop/api/action_descriptor.py 169 170 171 def getType ( self , key : int ) -> DescValueType : \"\"\"Gets the type of a key.\"\"\" return DescValueType ( self . app . getType ( key )) getUnitDoubleType ( key ) Gets the unit type of a key of type UnitDouble. Source code in photoshop/api/action_descriptor.py 173 174 175 def getUnitDoubleType ( self , key : int ) -> int : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleType ( key ) getUnitDoubleValue ( key ) Gets the unit type of a key of type UnitDouble. Source code in photoshop/api/action_descriptor.py 177 178 179 def getUnitDoubleValue ( self , key : int ) -> float : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleValue ( key ) hasKey ( key ) Checks whether the descriptor contains the provided key. Source code in photoshop/api/action_descriptor.py 181 182 183 def hasKey ( self , key : int ) -> bool : \"\"\"Checks whether the descriptor contains the provided key.\"\"\" return self . app . hasKey ( key ) isEqual ( otherDesc ) Determines whether the descriptor is the same as another descriptor. Parameters: Name Type Description Default otherDesc .action_descriptor.ActionDescriptor required Source code in photoshop/api/action_descriptor.py 185 186 187 188 189 190 191 192 def isEqual ( self , otherDesc ) -> bool : \"\"\"Determines whether the descriptor is the same as another descriptor. Args: otherDesc (.action_descriptor.ActionDescriptor): \"\"\" return self . app . isEqual ( otherDesc ) putBoolean ( key , value ) Sets the value for a key whose type is boolean. Source code in photoshop/api/action_descriptor.py 194 195 196 def putBoolean ( self , key : int , value : bool ): \"\"\"Sets the value for a key whose type is boolean.\"\"\" self . app . putBoolean ( key , value ) putClass ( key , value ) Sets the value for a key whose type is class. Source code in photoshop/api/action_descriptor.py 198 199 200 def putClass ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is class.\"\"\" self . app . putClass ( key , value ) putData ( key , value ) Puts raw byte data as a string value. Source code in photoshop/api/action_descriptor.py 202 203 204 def putData ( self , key : int , value : str ): \"\"\"Puts raw byte data as a string value.\"\"\" self . app . putData ( key , value ) putDouble ( key , value ) Sets the value for a key whose type is double. Source code in photoshop/api/action_descriptor.py 206 207 208 def putDouble ( self , key : int , value : float ): \"\"\"Sets the value for a key whose type is double.\"\"\" self . app . putDouble ( key , value ) putEnumerated ( key , enum_type , value ) Sets the enumeration type and value for a key. Source code in photoshop/api/action_descriptor.py 210 211 212 def putEnumerated ( self , key : int , enum_type : int , value : int ): \"\"\"Sets the enumeration type and value for a key.\"\"\" self . app . putEnumerated ( key , enum_type , value ) putInteger ( key , value ) Sets the value for a key whose type is integer. Source code in photoshop/api/action_descriptor.py 214 215 216 def putInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is integer.\"\"\" self . app . putInteger ( key , value ) putLargeInteger ( key , value ) Sets the value for a key whose type is large integer. Source code in photoshop/api/action_descriptor.py 218 219 220 def putLargeInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is large integer.\"\"\" self . app . putLargeInteger ( key , value ) putList ( key , value ) Sets the value for a key whose type is an ActionList object. Source code in photoshop/api/action_descriptor.py 222 223 224 def putList ( self , key : int , value : ActionList ): \"\"\"Sets the value for a key whose type is an ActionList object.\"\"\" self . app . putList ( key , value ) putObject ( key , class_id , value ) Sets the value for a key whose type is an object. Source code in photoshop/api/action_descriptor.py 226 227 228 def putObject ( self , key : int , class_id : int , value ): \"\"\"Sets the value for a key whose type is an object.\"\"\" self . app . putObject ( key , class_id , value ) putPath ( key , value ) Sets the value for a key whose type is path. Source code in photoshop/api/action_descriptor.py 230 231 232 def putPath ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is path.\"\"\" self . app . putPath ( key , value ) putReference ( key , value ) Sets the value for a key whose type is an object reference. Source code in photoshop/api/action_descriptor.py 234 235 236 def putReference ( self , key : int , value : ActionReference ): \"\"\"Sets the value for a key whose type is an object reference.\"\"\" self . app . putReference ( key , value ) putString ( key , value ) Sets the value for a key whose type is string. Source code in photoshop/api/action_descriptor.py 238 239 240 def putString ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is string.\"\"\" self . app . putString ( key , value ) putUnitDouble ( key , unit_id , value ) Sets the value for a key whose type is a unit value formatted as double. Source code in photoshop/api/action_descriptor.py 242 243 244 245 def putUnitDouble ( self , key : int , unit_id : int , value : float ): \"\"\"Sets the value for a key whose type is a unit value formatted as double.\"\"\" self . app . putUnitDouble ( key , unit_id , value ) toStream () Gets the entire descriptor as as stream of bytes, for writing to disk. Source code in photoshop/api/action_descriptor.py 247 248 249 250 def toStream ( self ) -> str : \"\"\"Gets the entire descriptor as as stream of bytes, for writing to disk.\"\"\" return self . app . toSteadm ()","title":"action_descriptor"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor","text":"Bases: Photoshop A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_descriptor.py 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 class ActionDescriptor ( Photoshop ): \"\"\"A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu. The ActionDescriptor class is part of the Action Manager functionality. For more details on the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionDescriptor\" def __init__ ( self ): super () . __init__ () self . _flag_as_method ( \"clear\" , \"erase\" , \"fromStream\" , \"getBoolean\" , \"getClass\" , \"getData\" , \"getDouble\" , \"getEnumerationType\" , \"getEnumerationValue\" , \"getInteger\" , \"getKey\" , \"getLargeInteger\" , \"getList\" , \"getObjectType\" , \"getObjectValue\" , \"getPath\" , \"getReference\" , \"getString\" , \"getType\" , \"getUnitDoubleType\" , \"getUnitDoubleValue\" , \"hasKey\" , \"isEqual\" , \"putBoolean\" , \"putClass\" , \"putData\" , \"putDouble\" , \"putEnumerated\" , \"putInteger\" , \"putLargeInteger\" , \"putList\" , \"putObject\" , \"putPath\" , \"putReference\" , \"putString\" , \"putUnitDouble\" , \"toSteadm\" , ) @property def count ( self ): \"\"\"The number of keys contained in the descriptor.\"\"\" return self . app . count def clear ( self ): \"\"\"Clears the descriptor.\"\"\" self . app . clear () def erase ( self , key : int ): \"\"\"Erases a key form the descriptor.\"\"\" self . app . erase ( key ) def fromStream ( self , value : str ): \"\"\"Create a descriptor from a stream of bytes. for reading from disk. \"\"\" self . app . fromStream ( value ) def getBoolean ( self , key : int ) -> int : \"\"\"Gets the text_font of a key of type boolean. Args: key (str): key of type boolean. Returns: bool: The text_font of a key of type boolean. \"\"\" return self . app . getBoolean ( key ) def getClass ( self , key ): \"\"\"Gets the text_font of a key of type class. Args: key (str): The key of type class. Returns: int: The text_font of a key of type class. \"\"\" return self . app . getClass ( key ) def getData ( self , key : int ) -> int : \"\"\"Gets raw byte data as a string value.\"\"\" return self . app . getData ( key ) def getDouble ( self , key : int ) -> float : \"\"\"Gets the value of a key of type double.\"\"\" return self . app . getDouble ( key ) def getEnumerationType ( self , index : int ) -> int : \"\"\"Gets the enumeration type of a key.\"\"\" return self . app . getEnumerationType ( index ) def getEnumerationValue ( self , index : int ) -> int : \"\"\"Gets the enumeration value of a key.\"\"\" return self . app . getEnumerationValue ( index ) def getInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type integer.\"\"\" return self . app . getInteger ( index ) def getKey ( self , index : int ) -> int : \"\"\"Gets the ID of the key provided by index.\"\"\" return self . app . getKey ( index ) def getLargeInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type large integer.\"\"\" return self . app . getLargeInteger ( index ) def getList ( self , index : int ) -> ActionList : \"\"\"Gets the value of a key of type list.\"\"\" return ActionList ( self . app . getList ( index )) def getObjectType ( self , key : int ) -> int : \"\"\"Gets the class ID of an object in a key of type object.\"\"\" return self . app . getObjectType ( key ) def getObjectValue ( self , key : int ) -> int : \"\"\"Get the class ID of an object in a key of type object.\"\"\" return self . app . getObjectValue ( key ) def getPath ( self , key : int ) -> Path : \"\"\"Gets the value of a key of type.\"\"\" return Path ( self . app . getPath ( key )) def getReference ( self , key : int ) -> ActionReference : \"\"\"Gets the value of a key of type.\"\"\" return ActionReference ( self . app . getReference ( key )) def getString ( self , key : int ) -> str : \"\"\"Gets the value of a key of type.\"\"\" return self . app . getString ( key ) def getType ( self , key : int ) -> DescValueType : \"\"\"Gets the type of a key.\"\"\" return DescValueType ( self . app . getType ( key )) def getUnitDoubleType ( self , key : int ) -> int : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleType ( key ) def getUnitDoubleValue ( self , key : int ) -> float : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleValue ( key ) def hasKey ( self , key : int ) -> bool : \"\"\"Checks whether the descriptor contains the provided key.\"\"\" return self . app . hasKey ( key ) def isEqual ( self , otherDesc ) -> bool : \"\"\"Determines whether the descriptor is the same as another descriptor. Args: otherDesc (.action_descriptor.ActionDescriptor): \"\"\" return self . app . isEqual ( otherDesc ) def putBoolean ( self , key : int , value : bool ): \"\"\"Sets the value for a key whose type is boolean.\"\"\" self . app . putBoolean ( key , value ) def putClass ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is class.\"\"\" self . app . putClass ( key , value ) def putData ( self , key : int , value : str ): \"\"\"Puts raw byte data as a string value.\"\"\" self . app . putData ( key , value ) def putDouble ( self , key : int , value : float ): \"\"\"Sets the value for a key whose type is double.\"\"\" self . app . putDouble ( key , value ) def putEnumerated ( self , key : int , enum_type : int , value : int ): \"\"\"Sets the enumeration type and value for a key.\"\"\" self . app . putEnumerated ( key , enum_type , value ) def putInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is integer.\"\"\" self . app . putInteger ( key , value ) def putLargeInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is large integer.\"\"\" self . app . putLargeInteger ( key , value ) def putList ( self , key : int , value : ActionList ): \"\"\"Sets the value for a key whose type is an ActionList object.\"\"\" self . app . putList ( key , value ) def putObject ( self , key : int , class_id : int , value ): \"\"\"Sets the value for a key whose type is an object.\"\"\" self . app . putObject ( key , class_id , value ) def putPath ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is path.\"\"\" self . app . putPath ( key , value ) def putReference ( self , key : int , value : ActionReference ): \"\"\"Sets the value for a key whose type is an object reference.\"\"\" self . app . putReference ( key , value ) def putString ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is string.\"\"\" self . app . putString ( key , value ) def putUnitDouble ( self , key : int , unit_id : int , value : float ): \"\"\"Sets the value for a key whose type is a unit value formatted as double.\"\"\" self . app . putUnitDouble ( key , unit_id , value ) def toStream ( self ) -> str : \"\"\"Gets the entire descriptor as as stream of bytes, for writing to disk.\"\"\" return self . app . toSteadm ()","title":"ActionDescriptor"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.count","text":"The number of keys contained in the descriptor.","title":"count"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.clear","text":"Clears the descriptor. Source code in photoshop/api/action_descriptor.py 77 78 79 def clear ( self ): \"\"\"Clears the descriptor.\"\"\" self . app . clear ()","title":"clear()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.erase","text":"Erases a key form the descriptor. Source code in photoshop/api/action_descriptor.py 81 82 83 def erase ( self , key : int ): \"\"\"Erases a key form the descriptor.\"\"\" self . app . erase ( key )","title":"erase()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.fromStream","text":"Create a descriptor from a stream of bytes. for reading from disk. Source code in photoshop/api/action_descriptor.py 85 86 87 88 89 90 91 def fromStream ( self , value : str ): \"\"\"Create a descriptor from a stream of bytes. for reading from disk. \"\"\" self . app . fromStream ( value )","title":"fromStream()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getBoolean","text":"Gets the text_font of a key of type boolean. Parameters: Name Type Description Default key str key of type boolean. required Returns: Name Type Description bool int The text_font of a key of type boolean. Source code in photoshop/api/action_descriptor.py 93 94 95 96 97 98 99 100 101 102 103 def getBoolean ( self , key : int ) -> int : \"\"\"Gets the text_font of a key of type boolean. Args: key (str): key of type boolean. Returns: bool: The text_font of a key of type boolean. \"\"\" return self . app . getBoolean ( key )","title":"getBoolean()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getClass","text":"Gets the text_font of a key of type class. Parameters: Name Type Description Default key str The key of type class. required Returns: Name Type Description int The text_font of a key of type class. Source code in photoshop/api/action_descriptor.py 105 106 107 108 109 110 111 112 113 114 115 def getClass ( self , key ): \"\"\"Gets the text_font of a key of type class. Args: key (str): The key of type class. Returns: int: The text_font of a key of type class. \"\"\" return self . app . getClass ( key )","title":"getClass()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getData","text":"Gets raw byte data as a string value. Source code in photoshop/api/action_descriptor.py 117 118 119 def getData ( self , key : int ) -> int : \"\"\"Gets raw byte data as a string value.\"\"\" return self . app . getData ( key )","title":"getData()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getDouble","text":"Gets the value of a key of type double. Source code in photoshop/api/action_descriptor.py 121 122 123 def getDouble ( self , key : int ) -> float : \"\"\"Gets the value of a key of type double.\"\"\" return self . app . getDouble ( key )","title":"getDouble()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getEnumerationType","text":"Gets the enumeration type of a key. Source code in photoshop/api/action_descriptor.py 125 126 127 def getEnumerationType ( self , index : int ) -> int : \"\"\"Gets the enumeration type of a key.\"\"\" return self . app . getEnumerationType ( index )","title":"getEnumerationType()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getEnumerationValue","text":"Gets the enumeration value of a key. Source code in photoshop/api/action_descriptor.py 129 130 131 def getEnumerationValue ( self , index : int ) -> int : \"\"\"Gets the enumeration value of a key.\"\"\" return self . app . getEnumerationValue ( index )","title":"getEnumerationValue()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getInteger","text":"Gets the value of a key of type integer. Source code in photoshop/api/action_descriptor.py 133 134 135 def getInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type integer.\"\"\" return self . app . getInteger ( index )","title":"getInteger()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getKey","text":"Gets the ID of the key provided by index. Source code in photoshop/api/action_descriptor.py 137 138 139 def getKey ( self , index : int ) -> int : \"\"\"Gets the ID of the key provided by index.\"\"\" return self . app . getKey ( index )","title":"getKey()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getLargeInteger","text":"Gets the value of a key of type large integer. Source code in photoshop/api/action_descriptor.py 141 142 143 def getLargeInteger ( self , index : int ) -> int : \"\"\"Gets the value of a key of type large integer.\"\"\" return self . app . getLargeInteger ( index )","title":"getLargeInteger()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getList","text":"Gets the value of a key of type list. Source code in photoshop/api/action_descriptor.py 145 146 147 def getList ( self , index : int ) -> ActionList : \"\"\"Gets the value of a key of type list.\"\"\" return ActionList ( self . app . getList ( index ))","title":"getList()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getObjectType","text":"Gets the class ID of an object in a key of type object. Source code in photoshop/api/action_descriptor.py 149 150 151 def getObjectType ( self , key : int ) -> int : \"\"\"Gets the class ID of an object in a key of type object.\"\"\" return self . app . getObjectType ( key )","title":"getObjectType()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getObjectValue","text":"Get the class ID of an object in a key of type object. Source code in photoshop/api/action_descriptor.py 153 154 155 def getObjectValue ( self , key : int ) -> int : \"\"\"Get the class ID of an object in a key of type object.\"\"\" return self . app . getObjectValue ( key )","title":"getObjectValue()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getPath","text":"Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 157 158 159 def getPath ( self , key : int ) -> Path : \"\"\"Gets the value of a key of type.\"\"\" return Path ( self . app . getPath ( key ))","title":"getPath()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getReference","text":"Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 161 162 163 def getReference ( self , key : int ) -> ActionReference : \"\"\"Gets the value of a key of type.\"\"\" return ActionReference ( self . app . getReference ( key ))","title":"getReference()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getString","text":"Gets the value of a key of type. Source code in photoshop/api/action_descriptor.py 165 166 167 def getString ( self , key : int ) -> str : \"\"\"Gets the value of a key of type.\"\"\" return self . app . getString ( key )","title":"getString()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getType","text":"Gets the type of a key. Source code in photoshop/api/action_descriptor.py 169 170 171 def getType ( self , key : int ) -> DescValueType : \"\"\"Gets the type of a key.\"\"\" return DescValueType ( self . app . getType ( key ))","title":"getType()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getUnitDoubleType","text":"Gets the unit type of a key of type UnitDouble. Source code in photoshop/api/action_descriptor.py 173 174 175 def getUnitDoubleType ( self , key : int ) -> int : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleType ( key )","title":"getUnitDoubleType()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.getUnitDoubleValue","text":"Gets the unit type of a key of type UnitDouble. Source code in photoshop/api/action_descriptor.py 177 178 179 def getUnitDoubleValue ( self , key : int ) -> float : \"\"\"Gets the unit type of a key of type UnitDouble.\"\"\" return self . app . getUnitDoubleValue ( key )","title":"getUnitDoubleValue()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.hasKey","text":"Checks whether the descriptor contains the provided key. Source code in photoshop/api/action_descriptor.py 181 182 183 def hasKey ( self , key : int ) -> bool : \"\"\"Checks whether the descriptor contains the provided key.\"\"\" return self . app . hasKey ( key )","title":"hasKey()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.isEqual","text":"Determines whether the descriptor is the same as another descriptor. Parameters: Name Type Description Default otherDesc .action_descriptor.ActionDescriptor required Source code in photoshop/api/action_descriptor.py 185 186 187 188 189 190 191 192 def isEqual ( self , otherDesc ) -> bool : \"\"\"Determines whether the descriptor is the same as another descriptor. Args: otherDesc (.action_descriptor.ActionDescriptor): \"\"\" return self . app . isEqual ( otherDesc )","title":"isEqual()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putBoolean","text":"Sets the value for a key whose type is boolean. Source code in photoshop/api/action_descriptor.py 194 195 196 def putBoolean ( self , key : int , value : bool ): \"\"\"Sets the value for a key whose type is boolean.\"\"\" self . app . putBoolean ( key , value )","title":"putBoolean()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putClass","text":"Sets the value for a key whose type is class. Source code in photoshop/api/action_descriptor.py 198 199 200 def putClass ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is class.\"\"\" self . app . putClass ( key , value )","title":"putClass()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putData","text":"Puts raw byte data as a string value. Source code in photoshop/api/action_descriptor.py 202 203 204 def putData ( self , key : int , value : str ): \"\"\"Puts raw byte data as a string value.\"\"\" self . app . putData ( key , value )","title":"putData()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putDouble","text":"Sets the value for a key whose type is double. Source code in photoshop/api/action_descriptor.py 206 207 208 def putDouble ( self , key : int , value : float ): \"\"\"Sets the value for a key whose type is double.\"\"\" self . app . putDouble ( key , value )","title":"putDouble()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putEnumerated","text":"Sets the enumeration type and value for a key. Source code in photoshop/api/action_descriptor.py 210 211 212 def putEnumerated ( self , key : int , enum_type : int , value : int ): \"\"\"Sets the enumeration type and value for a key.\"\"\" self . app . putEnumerated ( key , enum_type , value )","title":"putEnumerated()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putInteger","text":"Sets the value for a key whose type is integer. Source code in photoshop/api/action_descriptor.py 214 215 216 def putInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is integer.\"\"\" self . app . putInteger ( key , value )","title":"putInteger()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putLargeInteger","text":"Sets the value for a key whose type is large integer. Source code in photoshop/api/action_descriptor.py 218 219 220 def putLargeInteger ( self , key : int , value : int ): \"\"\"Sets the value for a key whose type is large integer.\"\"\" self . app . putLargeInteger ( key , value )","title":"putLargeInteger()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putList","text":"Sets the value for a key whose type is an ActionList object. Source code in photoshop/api/action_descriptor.py 222 223 224 def putList ( self , key : int , value : ActionList ): \"\"\"Sets the value for a key whose type is an ActionList object.\"\"\" self . app . putList ( key , value )","title":"putList()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putObject","text":"Sets the value for a key whose type is an object. Source code in photoshop/api/action_descriptor.py 226 227 228 def putObject ( self , key : int , class_id : int , value ): \"\"\"Sets the value for a key whose type is an object.\"\"\" self . app . putObject ( key , class_id , value )","title":"putObject()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putPath","text":"Sets the value for a key whose type is path. Source code in photoshop/api/action_descriptor.py 230 231 232 def putPath ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is path.\"\"\" self . app . putPath ( key , value )","title":"putPath()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putReference","text":"Sets the value for a key whose type is an object reference. Source code in photoshop/api/action_descriptor.py 234 235 236 def putReference ( self , key : int , value : ActionReference ): \"\"\"Sets the value for a key whose type is an object reference.\"\"\" self . app . putReference ( key , value )","title":"putReference()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putString","text":"Sets the value for a key whose type is string. Source code in photoshop/api/action_descriptor.py 238 239 240 def putString ( self , key : int , value : str ): \"\"\"Sets the value for a key whose type is string.\"\"\" self . app . putString ( key , value )","title":"putString()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.putUnitDouble","text":"Sets the value for a key whose type is a unit value formatted as double. Source code in photoshop/api/action_descriptor.py 242 243 244 245 def putUnitDouble ( self , key : int , unit_id : int , value : float ): \"\"\"Sets the value for a key whose type is a unit value formatted as double.\"\"\" self . app . putUnitDouble ( key , unit_id , value )","title":"putUnitDouble()"},{"location":"reference/photoshop/api/action_descriptor/#photoshop.api.action_descriptor.ActionDescriptor.toStream","text":"Gets the entire descriptor as as stream of bytes, for writing to disk. Source code in photoshop/api/action_descriptor.py 247 248 249 250 def toStream ( self ) -> str : \"\"\"Gets the entire descriptor as as stream of bytes, for writing to disk.\"\"\" return self . app . toSteadm ()","title":"toStream()"},{"location":"reference/photoshop/api/action_list/","text":"This object provides an array-style mechanism for storing data. It can be used for low-level access info Photoshop. ActionList Bases: Photoshop The list of commands that comprise an Action. (such as an Action created using the Actions palette in the Adobe Photoshop application). The action list object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_list.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 class ActionList ( Photoshop ): \"\"\"The list of commands that comprise an Action. (such as an Action created using the Actions palette in the Adobe Photoshop application). The action list object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionList\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"getBoolean\" , \"getClass\" , \"getData\" , \"getDouble\" , \"getEnumerationType\" , \"getEnumerationValue\" , \"getInteger\" , \"getLargeInteger\" , \"getList\" , \"getObjectType\" , ) @property def count ( self ): return self . app . count def getBoolean ( self , index ): return self . app . getBoolean ( index ) def getClass ( self , index ): return self . app . getClass ( index ) def getData ( self , index ): return self . app . getData ( index ) def getDouble ( self , index ): return self . app . getDouble ( index ) def getEnumerationType ( self , index ): return self . app . getEnumerationType ( index ) def getEnumerationValue ( self , index ): return self . app . getEnumerationValue ( index ) def getInteger ( self , index ): return self . app . getInteger ( index ) def getLargeInteger ( self , index ): return self . app . getLargeInteger ( index ) def getList ( self , index ): return self . app . getList ( index ) def getObjectType ( self , index ): return self . app . getObjectType ( index )","title":"action_list"},{"location":"reference/photoshop/api/action_list/#photoshop.api.action_list.ActionList","text":"Bases: Photoshop The list of commands that comprise an Action. (such as an Action created using the Actions palette in the Adobe Photoshop application). The action list object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_list.py 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 class ActionList ( Photoshop ): \"\"\"The list of commands that comprise an Action. (such as an Action created using the Actions palette in the Adobe Photoshop application). The action list object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionList\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"getBoolean\" , \"getClass\" , \"getData\" , \"getDouble\" , \"getEnumerationType\" , \"getEnumerationValue\" , \"getInteger\" , \"getLargeInteger\" , \"getList\" , \"getObjectType\" , ) @property def count ( self ): return self . app . count def getBoolean ( self , index ): return self . app . getBoolean ( index ) def getClass ( self , index ): return self . app . getClass ( index ) def getData ( self , index ): return self . app . getData ( index ) def getDouble ( self , index ): return self . app . getDouble ( index ) def getEnumerationType ( self , index ): return self . app . getEnumerationType ( index ) def getEnumerationValue ( self , index ): return self . app . getEnumerationValue ( index ) def getInteger ( self , index ): return self . app . getInteger ( index ) def getLargeInteger ( self , index ): return self . app . getLargeInteger ( index ) def getList ( self , index ): return self . app . getList ( index ) def getObjectType ( self , index ): return self . app . getObjectType ( index )","title":"ActionList"},{"location":"reference/photoshop/api/action_reference/","text":"This object provides information about what the action is refering to. For example, when referring to the name of something you might use keyName. The reference would also need to know what name you are referring to. In this case you could use classDocument for the name of the document or classLayer for the name of the layer. It can be used for low-level access into Contains data associated with an ActionDescriptor. ActionReference Bases: Photoshop Contains data describing a referenced Action. The action reference object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_reference.py 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 class ActionReference ( Photoshop ): \"\"\"Contains data describing a referenced Action. The action reference object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionReference\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"getContainer\" , \"getDesiredClass\" , \"getEnumeratedType\" , \"getEnumeratedValue\" , \"getForm\" , \"getIdentifier\" , \"getIndex\" , \"putName\" , \"putClass\" , \"putEnumerated\" , \"putIdentifier\" , \"putIndex\" , \"putOffset\" , \"putProperty\" , ) def getContainer ( self ): return self . app . getContainer () def getDesiredClass ( self ): return self . app . getDesiredClass () def getEnumeratedType ( self ) -> int : return self . app . getEnumeratedType () def getEnumeratedValue ( self ) -> int : return self . app . getEnumeratedValue () def getForm ( self ) -> ReferenceFormType : \"\"\"Gets the form of this action reference.\"\"\" return ReferenceFormType ( self . app . getForm ()) def getIdentifier ( self ) -> int : \"\"\"Gets the identifier value for a reference whose form is identifier.\"\"\" return self . app . getIdentifier () def getIndex ( self ) -> int : \"\"\"Gets the index value for a reference in a list or array,\"\"\" return self . app . getIndex () def putName ( self , key , value ): return self . app . putName ( key , value ) def putClass ( self , value ): return self . app . putClass ( value ) def putEnumerated ( self , desired_class , enum_type , value ): \"\"\"Puts an enumeration type and ID into a reference along with the desired class for the reference.\"\"\" return self . app . putEnumerated ( desired_class , enum_type , value ) def putIdentifier ( self , desired_class , value ): return self . app . putIdentifier ( desired_class , value ) def putIndex ( self , desired_class , value ): return self . app . putIndex ( desired_class , value ) def putOffset ( self , desired_class , value ): return self . app . putOffset ( desired_class , value ) def putProperty ( self , desired_class , value ): return self . app . putProperty ( desired_class , value ) getForm () Gets the form of this action reference. Source code in photoshop/api/action_reference.py 57 58 59 def getForm ( self ) -> ReferenceFormType : \"\"\"Gets the form of this action reference.\"\"\" return ReferenceFormType ( self . app . getForm ()) getIdentifier () Gets the identifier value for a reference whose form is identifier. Source code in photoshop/api/action_reference.py 61 62 63 64 def getIdentifier ( self ) -> int : \"\"\"Gets the identifier value for a reference whose form is identifier.\"\"\" return self . app . getIdentifier () getIndex () Gets the index value for a reference in a list or array, Source code in photoshop/api/action_reference.py 66 67 68 def getIndex ( self ) -> int : \"\"\"Gets the index value for a reference in a list or array,\"\"\" return self . app . getIndex () putEnumerated ( desired_class , enum_type , value ) Puts an enumeration type and ID into a reference along with the desired class for the reference. Source code in photoshop/api/action_reference.py 76 77 78 79 def putEnumerated ( self , desired_class , enum_type , value ): \"\"\"Puts an enumeration type and ID into a reference along with the desired class for the reference.\"\"\" return self . app . putEnumerated ( desired_class , enum_type , value )","title":"action_reference"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference","text":"Bases: Photoshop Contains data describing a referenced Action. The action reference object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. Source code in photoshop/api/action_reference.py 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 class ActionReference ( Photoshop ): \"\"\"Contains data describing a referenced Action. The action reference object is part of the Action Manager functionality. For details on using the Action Manager, see the Photoshop Scripting Guide. \"\"\" object_name = \"ActionReference\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"getContainer\" , \"getDesiredClass\" , \"getEnumeratedType\" , \"getEnumeratedValue\" , \"getForm\" , \"getIdentifier\" , \"getIndex\" , \"putName\" , \"putClass\" , \"putEnumerated\" , \"putIdentifier\" , \"putIndex\" , \"putOffset\" , \"putProperty\" , ) def getContainer ( self ): return self . app . getContainer () def getDesiredClass ( self ): return self . app . getDesiredClass () def getEnumeratedType ( self ) -> int : return self . app . getEnumeratedType () def getEnumeratedValue ( self ) -> int : return self . app . getEnumeratedValue () def getForm ( self ) -> ReferenceFormType : \"\"\"Gets the form of this action reference.\"\"\" return ReferenceFormType ( self . app . getForm ()) def getIdentifier ( self ) -> int : \"\"\"Gets the identifier value for a reference whose form is identifier.\"\"\" return self . app . getIdentifier () def getIndex ( self ) -> int : \"\"\"Gets the index value for a reference in a list or array,\"\"\" return self . app . getIndex () def putName ( self , key , value ): return self . app . putName ( key , value ) def putClass ( self , value ): return self . app . putClass ( value ) def putEnumerated ( self , desired_class , enum_type , value ): \"\"\"Puts an enumeration type and ID into a reference along with the desired class for the reference.\"\"\" return self . app . putEnumerated ( desired_class , enum_type , value ) def putIdentifier ( self , desired_class , value ): return self . app . putIdentifier ( desired_class , value ) def putIndex ( self , desired_class , value ): return self . app . putIndex ( desired_class , value ) def putOffset ( self , desired_class , value ): return self . app . putOffset ( desired_class , value ) def putProperty ( self , desired_class , value ): return self . app . putProperty ( desired_class , value )","title":"ActionReference"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference.getForm","text":"Gets the form of this action reference. Source code in photoshop/api/action_reference.py 57 58 59 def getForm ( self ) -> ReferenceFormType : \"\"\"Gets the form of this action reference.\"\"\" return ReferenceFormType ( self . app . getForm ())","title":"getForm()"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference.getIdentifier","text":"Gets the identifier value for a reference whose form is identifier. Source code in photoshop/api/action_reference.py 61 62 63 64 def getIdentifier ( self ) -> int : \"\"\"Gets the identifier value for a reference whose form is identifier.\"\"\" return self . app . getIdentifier ()","title":"getIdentifier()"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference.getIndex","text":"Gets the index value for a reference in a list or array, Source code in photoshop/api/action_reference.py 66 67 68 def getIndex ( self ) -> int : \"\"\"Gets the index value for a reference in a list or array,\"\"\" return self . app . getIndex ()","title":"getIndex()"},{"location":"reference/photoshop/api/action_reference/#photoshop.api.action_reference.ActionReference.putEnumerated","text":"Puts an enumeration type and ID into a reference along with the desired class for the reference. Source code in photoshop/api/action_reference.py 76 77 78 79 def putEnumerated ( self , desired_class , enum_type , value ): \"\"\"Puts an enumeration type and ID into a reference along with the desired class for the reference.\"\"\" return self . app . putEnumerated ( desired_class , enum_type , value )","title":"putEnumerated()"},{"location":"reference/photoshop/api/application/","text":"The Adobe Photoshop CC application object. Which is the root of the object model and provides access to all other objects. This object provides application-wide information, such as application defaults and available fonts. It provides many important methods, such as those for opening files and loading documents. app = Application() app.documents.add(800, 600, 72, \"docRef\") Application Bases: Photoshop The Adobe Photoshop application object, which contains all other Adobe Photoshop objects. This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. Source code in photoshop/api/application.py 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 class Application ( Photoshop ): \"\"\"The Adobe Photoshop application object, which contains all other Adobe Photoshop objects. This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. \"\"\" def __init__ ( self , version : Optional [ str ] = None ): super () . __init__ ( ps_version = version ) self . _flag_as_method ( \"batch\" , \"charIDToTypeID\" , \"doAction\" , \"doJavaScript\" , \"eraseCustomOptions\" , \"executeAction\" , \"executeActionGet\" , \"featureEnabled\" , \"getCustomOptions\" , \"isQuicktimeAvailable\" , \"load\" , \"open\" , \"openDialog\" , \"purge\" , \"putCustomOptions\" , \"refresh\" , \"stringIDToTypeID\" , \"toolSupportsBrushes\" , \"toolSupportsPresets\" , \"typeIDToCharID\" , \"typeIDToStringID\" , ) @property def activeLayer ( self ) -> ArtLayer : return ArtLayer ( self . app . ArtLayer ) @property def layerSets ( self ) -> LayerSets : return LayerSets ( self . app . LayerSets ) @property def activeDocument ( self ): \"\"\"The front-most documents. Setting this property is equivalent to clicking an open document in the Adobe Photoshop CC application to bring it to the front of the screen. \"\"\" return Document ( self . app . activeDocument ) @activeDocument . setter def activeDocument ( self , document : Document ): self . app . activeDocument = document @property def backgroundColor ( self ) -> SolidColor : \"\"\"The default background color and color style for documents.\"\"\" return SolidColor ( self . app . backgroundColor ) @backgroundColor . setter def backgroundColor ( self , color : SolidColor ): \"\"\"Sets the default background color and color style for documents. Args: color: The SolidColor instance. \"\"\" self . app . backgroundColor = color @property def build ( self ) -> str : \"\"\"str: The information about the application.\"\"\" return self . app . build @property def colorSettings ( self ) -> str : \"\"\"str: The name of the currently selected color settings profile (selected with Edit > Color Settings). \"\"\" return self . app . colorSettings @colorSettings . setter def colorSettings ( self , settings : str ): \"\"\"Sets the currently selected color settings profile. Args: settings: The name of a color settings profile to select. \"\"\" try : self . doJavaScript ( f 'app.colorSettings=\" { settings } \"' ) except COMError as e : raise PhotoshopPythonAPIError ( f \"Invalid color profile provided: ' { settings } '\" ) from e @property def currentTool ( self ) -> str : \"\"\"str: The name of the current tool selected.\"\"\" return self . app . currentTool @currentTool . setter def currentTool ( self , tool_name : str ): \"\"\"Sets the currently selected tool. Args: tool_name: The name of a tool to select.. \"\"\" self . app . currentTool = tool_name @property def displayDialogs ( self ) -> DialogModes : \"\"\"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs.\"\"\" return DialogModes ( self . app . displayDialogs ) @displayDialogs . setter def displayDialogs ( self , dialog_mode : DialogModes ): \"\"\"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs. \"\"\" self . app . displayDialogs = dialog_mode @property def documents ( self ) -> Documents : \"\"\"._documents.Documents: The Documents instance.\"\"\" return Documents ( self . app . documents ) @property def fonts ( self ) -> TextFonts : return TextFonts ( self . app . fonts ) @property def foregroundColor ( self ) -> SolidColor : \"\"\"Get default foreground color. Used to paint, fill, and stroke selections. Returns: The SolidColor instance. \"\"\" return SolidColor ( parent = self . app . foregroundColor ) @foregroundColor . setter def foregroundColor ( self , color : SolidColor ): \"\"\"Set the `foregroundColor`. Args: color: The SolidColor instance. \"\"\" self . app . foregroundColor = color @property def freeMemory ( self ) -> float : \"\"\"The amount of unused memory available to .\"\"\" return self . app . freeMemory @property def locale ( self ) -> str : \"\"\"The language locale of the application.\"\"\" return self . app . locale @property def macintoshFileTypes ( self ) -> List [ str ]: \"\"\"A list of the image file types Photoshop can open.\"\"\" return self . app . macintoshFileTypes @property def measurementLog ( self ) -> MeasurementLog : \"\"\"The log of measurements taken.\"\"\" return MeasurementLog ( self . app . measurementLog ) @property def name ( self ) -> str : return self . app . name @property def notifiers ( self ) -> Notifiers : \"\"\"The notifiers currently configured (in the Scripts Events Manager menu in the application).\"\"\" return Notifiers ( self . app . notifiers ) @property def notifiersEnabled ( self ) -> bool : \"\"\"bool: If true, notifiers are enabled.\"\"\" return self . app . notifiersEnabled @notifiersEnabled . setter def notifiersEnabled ( self , value : bool ): self . app . notifiersEnabled = value @property def parent ( self ): \"\"\"The object\u2019s container.\"\"\" return self . app . parent @property def path ( self ) -> Path : \"\"\"str: The full path to the location of the Photoshop application.\"\"\" return Path ( self . app . path ) @property def playbackDisplayDialogs ( self ): return self . doJavaScript ( \"app.playbackDisplayDialogs\" ) @property def playbackParameters ( self ): \"\"\"Stores and retrieves parameters used as part of a recorded action.\"\"\" return self . app . playbackParameters @playbackParameters . setter def playbackParameters ( self , value ): self . app . playbackParameters = value @property def preferences ( self ) -> Preferences : return Preferences ( self . app . preferences ) @property def preferencesFolder ( self ) -> Path : return Path ( self . app . preferencesFolder ) @property def recentFiles ( self ): return self . app . recentFiles @property def scriptingBuildDate ( self ): return self . app . scriptingBuildDate @property def scriptingVersion ( self ): return self . app . scriptingVersion @property def systemInformation ( self ): return self . app . systemInformation @property def version ( self ): return self . app . version @property def windowsFileTypes ( self ): return self . app . windowsFileTypes # Methods. def batch ( self , files , actionName , actionSet , options ): \"\"\"Runs the batch automation routine. Similar to the **File** > **Automate** > **Batch** command. \"\"\" self . app . batch ( files , actionName , actionSet , options ) def beep ( self ): \"\"\"Causes a \"beep\" sound.\"\"\" return self . eval_javascript ( \"app.beep()\" ) def bringToFront ( self ): return self . eval_javascript ( \"app.bringToFront()\" ) def changeProgressText ( self , text ): \"\"\"Changes the text that appears in the progress window.\"\"\" self . eval_javascript ( f \"app.changeProgressText(' { text } ')\" ) def charIDToTypeID ( self , char_id ): return self . app . charIDToTypeID ( char_id ) @staticmethod def compareWithNumbers ( first , second ): return first > second def doAction ( self , action , action_from = \"Default Actions\" ): \"\"\"Plays the specified action from the Actions palette.\"\"\" self . app . doAction ( action , action_from ) return True def doForcedProgress ( self , title , javascript ): script = \"app.doForcedProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgress ( self , title , javascript ): \"\"\"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Args: title (str): String to show in the progress window. javascript (str): JavaScriptString to execute. \"\"\" script = \"app.doProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressSegmentTask ( self , segmentLength , done , total , javascript ): script = \"app.doProgressSegmentTask( {} , {} , {} , ' {} ');\" . format ( segmentLength , done , total , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressSubTask ( self , index , limit , javascript ): script = \"app.doProgressSubTask( {} , {} , ' {} ');\" . format ( index , limit , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressTask ( self , index , javascript ): \"\"\"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. \"\"\" script = f \"app.doProgressTask( { index } , ' { javascript } ');\" self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def eraseCustomOptions ( self , key ): \"\"\"Removes the specified user objects from the Photoshop registry.\"\"\" self . app . eraseCustomOptions ( key ) def executeAction ( self , event_id , descriptor , display_dialogs = 2 ): return self . app . executeAction ( event_id , descriptor , display_dialogs ) def executeActionGet ( self , reference ): return self . app . executeActionGet ( reference ) def featureEnabled ( self , name ): \"\"\"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial \"\"\" return self . app . featureEnabled ( name ) def getCustomOptions ( self , key ): \"\"\"Retrieves user objects in the Photoshop registry for the ID with value key.\"\"\" return self . app . getCustomOptions ( key ) def open ( self , document_file_path , document_type : str = None , as_smart_object : bool = False , ) -> Document : document = self . app . open ( document_file_path , document_type , as_smart_object ) if not as_smart_object : return Document ( document ) return document def load ( self , document_file_path : Union [ str , os . PathLike ]) -> Document : \"\"\"Loads a supported Photoshop document.\"\"\" self . app . load ( str ( document_file_path )) return self . activeDocument def doJavaScript ( self , javascript , Arguments = None , ExecutionMode = None ): return self . app . doJavaScript ( javascript , Arguments , ExecutionMode ) def isQuicktimeAvailable ( self ) -> bool : return self . app . isQuicktimeAvailable def openDialog ( self ): return self . app . openDialog () def purge ( self , target : PurgeTarget ): \"\"\"Purges one or more caches. Args: target: 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches \"\"\" self . app . purge ( target ) def putCustomOptions ( self , key , custom_object , persistent ): self . app . putCustomOptions ( key , custom_object , persistent ) def refresh ( self ): \"\"\"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. \"\"\" self . app . refresh () def refreshFonts ( self ): \"\"\"Force the font list to get refreshed.\"\"\" return self . eval_javascript ( \"app.refreshFonts();\" ) def runMenuItem ( self , menu_id ): \"\"\"Run a menu item given the menu ID.\"\"\" return self . eval_javascript ( f \"app.runMenuItem( { menu_id } )\" , ) def showColorPicker ( self ): \"\"\"Returns false if dialog is cancelled, true otherwise.\"\"\" return self . eval_javascript ( \"app.showColorPicker();\" ) def stringIDToTypeID ( self , string_id ): return self . app . stringIDToTypeID ( string_id ) def togglePalettes ( self ): \"\"\"Toggle palette visibility.\"\"\" return self . doJavaScript ( \"app.togglePalettes()\" ) def toolSupportsBrushes ( self , tool ): return self . app . toolSupportsBrushes ( tool ) def toolSupportsBrushPresets ( self , tool ): return self . app . toolSupportsPresets ( tool ) @staticmethod def system ( command ): os . system ( command ) def typeIDToStringID ( self , type_id : int ) -> str : return self . app . typeIDToStringID ( type_id ) def typeIDToCharID ( self , type_id : int ) -> str : return self . app . typeIDToCharID ( type_id ) def updateProgress ( self , done , total ): self . eval_javascript ( f \"app.updateProgress( { done } , { total } )\" ) activeDocument property writable The front-most documents. Setting this property is equivalent to clicking an open document in the Adobe Photoshop CC application to bring it to the front of the screen. backgroundColor : SolidColor property writable The default background color and color style for documents. build : str property colorSettings : str property writable (selected with Edit > Color Settings). currentTool : str property writable displayDialogs : DialogModes property writable The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs. documents : Documents property ._documents.Documents: The Documents instance. foregroundColor : SolidColor property writable Get default foreground color. Used to paint, fill, and stroke selections. Returns: Type Description SolidColor The SolidColor instance. freeMemory : float property The amount of unused memory available to . locale : str property The language locale of the application. macintoshFileTypes : List [ str ] property A list of the image file types Photoshop can open. measurementLog : MeasurementLog property The log of measurements taken. notifiers : Notifiers property The notifiers currently configured (in the Scripts Events Manager menu in the application). notifiersEnabled : bool property writable parent property The object\u2019s container. path : Path property playbackParameters property writable Stores and retrieves parameters used as part of a recorded action. batch ( files , actionName , actionSet , options ) Runs the batch automation routine. Similar to the File > Automate > Batch command. Source code in photoshop/api/application.py 292 293 294 295 296 297 298 def batch ( self , files , actionName , actionSet , options ): \"\"\"Runs the batch automation routine. Similar to the **File** > **Automate** > **Batch** command. \"\"\" self . app . batch ( files , actionName , actionSet , options ) beep () Causes a \"beep\" sound. Source code in photoshop/api/application.py 300 301 302 def beep ( self ): \"\"\"Causes a \"beep\" sound.\"\"\" return self . eval_javascript ( \"app.beep()\" ) changeProgressText ( text ) Changes the text that appears in the progress window. Source code in photoshop/api/application.py 307 308 309 def changeProgressText ( self , text ): \"\"\"Changes the text that appears in the progress window.\"\"\" self . eval_javascript ( f \"app.changeProgressText(' { text } ')\" ) doAction ( action , action_from = 'Default Actions' ) Plays the specified action from the Actions palette. Source code in photoshop/api/application.py 318 319 320 321 def doAction ( self , action , action_from = \"Default Actions\" ): \"\"\"Plays the specified action from the Actions palette.\"\"\" self . app . doAction ( action , action_from ) return True doProgress ( title , javascript ) Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Parameters: Name Type Description Default title str String to show in the progress window. required javascript str JavaScriptString to execute. required Source code in photoshop/api/application.py 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 def doProgress ( self , title , javascript ): \"\"\"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Args: title (str): String to show in the progress window. javascript (str): JavaScriptString to execute. \"\"\" script = \"app.doProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) doProgressTask ( index , javascript ) Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. Source code in photoshop/api/application.py 370 371 372 373 374 375 376 377 378 def doProgressTask ( self , index , javascript ): \"\"\"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. \"\"\" script = f \"app.doProgressTask( { index } , ' { javascript } ');\" self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) eraseCustomOptions ( key ) Removes the specified user objects from the Photoshop registry. Source code in photoshop/api/application.py 380 381 382 def eraseCustomOptions ( self , key ): \"\"\"Removes the specified user objects from the Photoshop registry.\"\"\" self . app . eraseCustomOptions ( key ) featureEnabled ( name ) Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial Source code in photoshop/api/application.py 390 391 392 393 394 395 396 397 398 399 400 401 402 def featureEnabled ( self , name ): \"\"\"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial \"\"\" return self . app . featureEnabled ( name ) getCustomOptions ( key ) Retrieves user objects in the Photoshop registry for the ID with value key. Source code in photoshop/api/application.py 404 405 406 407 def getCustomOptions ( self , key ): \"\"\"Retrieves user objects in the Photoshop registry for the ID with value key.\"\"\" return self . app . getCustomOptions ( key ) load ( document_file_path ) Loads a supported Photoshop document. Source code in photoshop/api/application.py 420 421 422 423 def load ( self , document_file_path : Union [ str , os . PathLike ]) -> Document : \"\"\"Loads a supported Photoshop document.\"\"\" self . app . load ( str ( document_file_path )) return self . activeDocument purge ( target ) Purges one or more caches. Parameters: Name Type Description Default target PurgeTarget 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches required Source code in photoshop/api/application.py 434 435 436 437 438 439 440 441 442 443 444 445 def purge ( self , target : PurgeTarget ): \"\"\"Purges one or more caches. Args: target: 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches \"\"\" self . app . purge ( target ) refresh () Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. Source code in photoshop/api/application.py 450 451 452 453 454 455 456 457 458 459 def refresh ( self ): \"\"\"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. \"\"\" self . app . refresh () refreshFonts () Force the font list to get refreshed. Source code in photoshop/api/application.py 461 462 463 def refreshFonts ( self ): \"\"\"Force the font list to get refreshed.\"\"\" return self . eval_javascript ( \"app.refreshFonts();\" ) runMenuItem ( menu_id ) Run a menu item given the menu ID. Source code in photoshop/api/application.py 465 466 467 468 469 def runMenuItem ( self , menu_id ): \"\"\"Run a menu item given the menu ID.\"\"\" return self . eval_javascript ( f \"app.runMenuItem( { menu_id } )\" , ) showColorPicker () Returns false if dialog is cancelled, true otherwise. Source code in photoshop/api/application.py 471 472 473 def showColorPicker ( self ): \"\"\"Returns false if dialog is cancelled, true otherwise.\"\"\" return self . eval_javascript ( \"app.showColorPicker();\" ) togglePalettes () Toggle palette visibility. Source code in photoshop/api/application.py 478 479 480 def togglePalettes ( self ): \"\"\"Toggle palette visibility.\"\"\" return self . doJavaScript ( \"app.togglePalettes()\" )","title":"application"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application","text":"Bases: Photoshop The Adobe Photoshop application object, which contains all other Adobe Photoshop objects. This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. Source code in photoshop/api/application.py 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 class Application ( Photoshop ): \"\"\"The Adobe Photoshop application object, which contains all other Adobe Photoshop objects. This is the root of the object model, and provides access to all other objects. To access the properties and methods, you can use the pre-defined global variable app. \"\"\" def __init__ ( self , version : Optional [ str ] = None ): super () . __init__ ( ps_version = version ) self . _flag_as_method ( \"batch\" , \"charIDToTypeID\" , \"doAction\" , \"doJavaScript\" , \"eraseCustomOptions\" , \"executeAction\" , \"executeActionGet\" , \"featureEnabled\" , \"getCustomOptions\" , \"isQuicktimeAvailable\" , \"load\" , \"open\" , \"openDialog\" , \"purge\" , \"putCustomOptions\" , \"refresh\" , \"stringIDToTypeID\" , \"toolSupportsBrushes\" , \"toolSupportsPresets\" , \"typeIDToCharID\" , \"typeIDToStringID\" , ) @property def activeLayer ( self ) -> ArtLayer : return ArtLayer ( self . app . ArtLayer ) @property def layerSets ( self ) -> LayerSets : return LayerSets ( self . app . LayerSets ) @property def activeDocument ( self ): \"\"\"The front-most documents. Setting this property is equivalent to clicking an open document in the Adobe Photoshop CC application to bring it to the front of the screen. \"\"\" return Document ( self . app . activeDocument ) @activeDocument . setter def activeDocument ( self , document : Document ): self . app . activeDocument = document @property def backgroundColor ( self ) -> SolidColor : \"\"\"The default background color and color style for documents.\"\"\" return SolidColor ( self . app . backgroundColor ) @backgroundColor . setter def backgroundColor ( self , color : SolidColor ): \"\"\"Sets the default background color and color style for documents. Args: color: The SolidColor instance. \"\"\" self . app . backgroundColor = color @property def build ( self ) -> str : \"\"\"str: The information about the application.\"\"\" return self . app . build @property def colorSettings ( self ) -> str : \"\"\"str: The name of the currently selected color settings profile (selected with Edit > Color Settings). \"\"\" return self . app . colorSettings @colorSettings . setter def colorSettings ( self , settings : str ): \"\"\"Sets the currently selected color settings profile. Args: settings: The name of a color settings profile to select. \"\"\" try : self . doJavaScript ( f 'app.colorSettings=\" { settings } \"' ) except COMError as e : raise PhotoshopPythonAPIError ( f \"Invalid color profile provided: ' { settings } '\" ) from e @property def currentTool ( self ) -> str : \"\"\"str: The name of the current tool selected.\"\"\" return self . app . currentTool @currentTool . setter def currentTool ( self , tool_name : str ): \"\"\"Sets the currently selected tool. Args: tool_name: The name of a tool to select.. \"\"\" self . app . currentTool = tool_name @property def displayDialogs ( self ) -> DialogModes : \"\"\"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs.\"\"\" return DialogModes ( self . app . displayDialogs ) @displayDialogs . setter def displayDialogs ( self , dialog_mode : DialogModes ): \"\"\"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs. \"\"\" self . app . displayDialogs = dialog_mode @property def documents ( self ) -> Documents : \"\"\"._documents.Documents: The Documents instance.\"\"\" return Documents ( self . app . documents ) @property def fonts ( self ) -> TextFonts : return TextFonts ( self . app . fonts ) @property def foregroundColor ( self ) -> SolidColor : \"\"\"Get default foreground color. Used to paint, fill, and stroke selections. Returns: The SolidColor instance. \"\"\" return SolidColor ( parent = self . app . foregroundColor ) @foregroundColor . setter def foregroundColor ( self , color : SolidColor ): \"\"\"Set the `foregroundColor`. Args: color: The SolidColor instance. \"\"\" self . app . foregroundColor = color @property def freeMemory ( self ) -> float : \"\"\"The amount of unused memory available to .\"\"\" return self . app . freeMemory @property def locale ( self ) -> str : \"\"\"The language locale of the application.\"\"\" return self . app . locale @property def macintoshFileTypes ( self ) -> List [ str ]: \"\"\"A list of the image file types Photoshop can open.\"\"\" return self . app . macintoshFileTypes @property def measurementLog ( self ) -> MeasurementLog : \"\"\"The log of measurements taken.\"\"\" return MeasurementLog ( self . app . measurementLog ) @property def name ( self ) -> str : return self . app . name @property def notifiers ( self ) -> Notifiers : \"\"\"The notifiers currently configured (in the Scripts Events Manager menu in the application).\"\"\" return Notifiers ( self . app . notifiers ) @property def notifiersEnabled ( self ) -> bool : \"\"\"bool: If true, notifiers are enabled.\"\"\" return self . app . notifiersEnabled @notifiersEnabled . setter def notifiersEnabled ( self , value : bool ): self . app . notifiersEnabled = value @property def parent ( self ): \"\"\"The object\u2019s container.\"\"\" return self . app . parent @property def path ( self ) -> Path : \"\"\"str: The full path to the location of the Photoshop application.\"\"\" return Path ( self . app . path ) @property def playbackDisplayDialogs ( self ): return self . doJavaScript ( \"app.playbackDisplayDialogs\" ) @property def playbackParameters ( self ): \"\"\"Stores and retrieves parameters used as part of a recorded action.\"\"\" return self . app . playbackParameters @playbackParameters . setter def playbackParameters ( self , value ): self . app . playbackParameters = value @property def preferences ( self ) -> Preferences : return Preferences ( self . app . preferences ) @property def preferencesFolder ( self ) -> Path : return Path ( self . app . preferencesFolder ) @property def recentFiles ( self ): return self . app . recentFiles @property def scriptingBuildDate ( self ): return self . app . scriptingBuildDate @property def scriptingVersion ( self ): return self . app . scriptingVersion @property def systemInformation ( self ): return self . app . systemInformation @property def version ( self ): return self . app . version @property def windowsFileTypes ( self ): return self . app . windowsFileTypes # Methods. def batch ( self , files , actionName , actionSet , options ): \"\"\"Runs the batch automation routine. Similar to the **File** > **Automate** > **Batch** command. \"\"\" self . app . batch ( files , actionName , actionSet , options ) def beep ( self ): \"\"\"Causes a \"beep\" sound.\"\"\" return self . eval_javascript ( \"app.beep()\" ) def bringToFront ( self ): return self . eval_javascript ( \"app.bringToFront()\" ) def changeProgressText ( self , text ): \"\"\"Changes the text that appears in the progress window.\"\"\" self . eval_javascript ( f \"app.changeProgressText(' { text } ')\" ) def charIDToTypeID ( self , char_id ): return self . app . charIDToTypeID ( char_id ) @staticmethod def compareWithNumbers ( first , second ): return first > second def doAction ( self , action , action_from = \"Default Actions\" ): \"\"\"Plays the specified action from the Actions palette.\"\"\" self . app . doAction ( action , action_from ) return True def doForcedProgress ( self , title , javascript ): script = \"app.doForcedProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgress ( self , title , javascript ): \"\"\"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Args: title (str): String to show in the progress window. javascript (str): JavaScriptString to execute. \"\"\" script = \"app.doProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressSegmentTask ( self , segmentLength , done , total , javascript ): script = \"app.doProgressSegmentTask( {} , {} , {} , ' {} ');\" . format ( segmentLength , done , total , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressSubTask ( self , index , limit , javascript ): script = \"app.doProgressSubTask( {} , {} , ' {} ');\" . format ( index , limit , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def doProgressTask ( self , index , javascript ): \"\"\"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. \"\"\" script = f \"app.doProgressTask( { index } , ' { javascript } ');\" self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 ) def eraseCustomOptions ( self , key ): \"\"\"Removes the specified user objects from the Photoshop registry.\"\"\" self . app . eraseCustomOptions ( key ) def executeAction ( self , event_id , descriptor , display_dialogs = 2 ): return self . app . executeAction ( event_id , descriptor , display_dialogs ) def executeActionGet ( self , reference ): return self . app . executeActionGet ( reference ) def featureEnabled ( self , name ): \"\"\"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial \"\"\" return self . app . featureEnabled ( name ) def getCustomOptions ( self , key ): \"\"\"Retrieves user objects in the Photoshop registry for the ID with value key.\"\"\" return self . app . getCustomOptions ( key ) def open ( self , document_file_path , document_type : str = None , as_smart_object : bool = False , ) -> Document : document = self . app . open ( document_file_path , document_type , as_smart_object ) if not as_smart_object : return Document ( document ) return document def load ( self , document_file_path : Union [ str , os . PathLike ]) -> Document : \"\"\"Loads a supported Photoshop document.\"\"\" self . app . load ( str ( document_file_path )) return self . activeDocument def doJavaScript ( self , javascript , Arguments = None , ExecutionMode = None ): return self . app . doJavaScript ( javascript , Arguments , ExecutionMode ) def isQuicktimeAvailable ( self ) -> bool : return self . app . isQuicktimeAvailable def openDialog ( self ): return self . app . openDialog () def purge ( self , target : PurgeTarget ): \"\"\"Purges one or more caches. Args: target: 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches \"\"\" self . app . purge ( target ) def putCustomOptions ( self , key , custom_object , persistent ): self . app . putCustomOptions ( key , custom_object , persistent ) def refresh ( self ): \"\"\"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. \"\"\" self . app . refresh () def refreshFonts ( self ): \"\"\"Force the font list to get refreshed.\"\"\" return self . eval_javascript ( \"app.refreshFonts();\" ) def runMenuItem ( self , menu_id ): \"\"\"Run a menu item given the menu ID.\"\"\" return self . eval_javascript ( f \"app.runMenuItem( { menu_id } )\" , ) def showColorPicker ( self ): \"\"\"Returns false if dialog is cancelled, true otherwise.\"\"\" return self . eval_javascript ( \"app.showColorPicker();\" ) def stringIDToTypeID ( self , string_id ): return self . app . stringIDToTypeID ( string_id ) def togglePalettes ( self ): \"\"\"Toggle palette visibility.\"\"\" return self . doJavaScript ( \"app.togglePalettes()\" ) def toolSupportsBrushes ( self , tool ): return self . app . toolSupportsBrushes ( tool ) def toolSupportsBrushPresets ( self , tool ): return self . app . toolSupportsPresets ( tool ) @staticmethod def system ( command ): os . system ( command ) def typeIDToStringID ( self , type_id : int ) -> str : return self . app . typeIDToStringID ( type_id ) def typeIDToCharID ( self , type_id : int ) -> str : return self . app . typeIDToCharID ( type_id ) def updateProgress ( self , done , total ): self . eval_javascript ( f \"app.updateProgress( { done } , { total } )\" )","title":"Application"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.activeDocument","text":"The front-most documents. Setting this property is equivalent to clicking an open document in the Adobe Photoshop CC application to bring it to the front of the screen.","title":"activeDocument"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.backgroundColor","text":"The default background color and color style for documents.","title":"backgroundColor"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.build","text":"","title":"build"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.colorSettings","text":"(selected with Edit > Color Settings).","title":"colorSettings"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.currentTool","text":"","title":"currentTool"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.displayDialogs","text":"The dialog mode for the document, which indicates whether Photoshop displays dialogs when the script runs.","title":"displayDialogs"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.documents","text":"._documents.Documents: The Documents instance.","title":"documents"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.foregroundColor","text":"Get default foreground color. Used to paint, fill, and stroke selections. Returns: Type Description SolidColor The SolidColor instance.","title":"foregroundColor"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.freeMemory","text":"The amount of unused memory available to .","title":"freeMemory"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.locale","text":"The language locale of the application.","title":"locale"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.macintoshFileTypes","text":"A list of the image file types Photoshop can open.","title":"macintoshFileTypes"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.measurementLog","text":"The log of measurements taken.","title":"measurementLog"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.notifiers","text":"The notifiers currently configured (in the Scripts Events Manager menu in the application).","title":"notifiers"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.notifiersEnabled","text":"","title":"notifiersEnabled"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.parent","text":"The object\u2019s container.","title":"parent"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.path","text":"","title":"path"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.playbackParameters","text":"Stores and retrieves parameters used as part of a recorded action.","title":"playbackParameters"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.batch","text":"Runs the batch automation routine. Similar to the File > Automate > Batch command. Source code in photoshop/api/application.py 292 293 294 295 296 297 298 def batch ( self , files , actionName , actionSet , options ): \"\"\"Runs the batch automation routine. Similar to the **File** > **Automate** > **Batch** command. \"\"\" self . app . batch ( files , actionName , actionSet , options )","title":"batch()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.beep","text":"Causes a \"beep\" sound. Source code in photoshop/api/application.py 300 301 302 def beep ( self ): \"\"\"Causes a \"beep\" sound.\"\"\" return self . eval_javascript ( \"app.beep()\" )","title":"beep()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.changeProgressText","text":"Changes the text that appears in the progress window. Source code in photoshop/api/application.py 307 308 309 def changeProgressText ( self , text ): \"\"\"Changes the text that appears in the progress window.\"\"\" self . eval_javascript ( f \"app.changeProgressText(' { text } ')\" )","title":"changeProgressText()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.doAction","text":"Plays the specified action from the Actions palette. Source code in photoshop/api/application.py 318 319 320 321 def doAction ( self , action , action_from = \"Default Actions\" ): \"\"\"Plays the specified action from the Actions palette.\"\"\" self . app . doAction ( action , action_from ) return True","title":"doAction()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.doProgress","text":"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Parameters: Name Type Description Default title str String to show in the progress window. required javascript str JavaScriptString to execute. required Source code in photoshop/api/application.py 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 def doProgress ( self , title , javascript ): \"\"\"Performs a task with a progress bar. Other progress APIs must be called periodically to update the progress bar and allow cancelling. Args: title (str): String to show in the progress window. javascript (str): JavaScriptString to execute. \"\"\" script = \"app.doProgress(' {} ', ' {} ')\" . format ( title , javascript , ) self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 )","title":"doProgress()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.doProgressTask","text":"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. Source code in photoshop/api/application.py 370 371 372 373 374 375 376 377 378 def doProgressTask ( self , index , javascript ): \"\"\"Sections off a portion of the unused progress bar for execution of a subtask. Returns false on cancel. \"\"\" script = f \"app.doProgressTask( { index } , ' { javascript } ');\" self . eval_javascript ( script ) # Ensure the script execute success. time . sleep ( 1 )","title":"doProgressTask()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.eraseCustomOptions","text":"Removes the specified user objects from the Photoshop registry. Source code in photoshop/api/application.py 380 381 382 def eraseCustomOptions ( self , key ): \"\"\"Removes the specified user objects from the Photoshop registry.\"\"\" self . app . eraseCustomOptions ( key )","title":"eraseCustomOptions()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.featureEnabled","text":"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial Source code in photoshop/api/application.py 390 391 392 393 394 395 396 397 398 399 400 401 402 def featureEnabled ( self , name ): \"\"\"Determines whether the feature specified by name is enabled. The following features are supported as values for name: \"photoshop/extended\" \"photoshop/standard\" \"photoshop/trial \"\"\" return self . app . featureEnabled ( name )","title":"featureEnabled()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.getCustomOptions","text":"Retrieves user objects in the Photoshop registry for the ID with value key. Source code in photoshop/api/application.py 404 405 406 407 def getCustomOptions ( self , key ): \"\"\"Retrieves user objects in the Photoshop registry for the ID with value key.\"\"\" return self . app . getCustomOptions ( key )","title":"getCustomOptions()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.load","text":"Loads a supported Photoshop document. Source code in photoshop/api/application.py 420 421 422 423 def load ( self , document_file_path : Union [ str , os . PathLike ]) -> Document : \"\"\"Loads a supported Photoshop document.\"\"\" self . app . load ( str ( document_file_path )) return self . activeDocument","title":"load()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.purge","text":"Purges one or more caches. Parameters: Name Type Description Default target PurgeTarget 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches required Source code in photoshop/api/application.py 434 435 436 437 438 439 440 441 442 443 444 445 def purge ( self , target : PurgeTarget ): \"\"\"Purges one or more caches. Args: target: 1: Clears the undo cache. 2: Clears history states from the History palette. 3: Clears the clipboard data. 4: Clears all caches \"\"\" self . app . purge ( target )","title":"purge()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.refresh","text":"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. Source code in photoshop/api/application.py 450 451 452 453 454 455 456 457 458 459 def refresh ( self ): \"\"\"Pauses the script while the application refreshes. Ues to slow down execution and show the results to the user as the script runs. Use carefully; your script runs much more slowly when using this method. \"\"\" self . app . refresh ()","title":"refresh()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.refreshFonts","text":"Force the font list to get refreshed. Source code in photoshop/api/application.py 461 462 463 def refreshFonts ( self ): \"\"\"Force the font list to get refreshed.\"\"\" return self . eval_javascript ( \"app.refreshFonts();\" )","title":"refreshFonts()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.runMenuItem","text":"Run a menu item given the menu ID. Source code in photoshop/api/application.py 465 466 467 468 469 def runMenuItem ( self , menu_id ): \"\"\"Run a menu item given the menu ID.\"\"\" return self . eval_javascript ( f \"app.runMenuItem( { menu_id } )\" , )","title":"runMenuItem()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.showColorPicker","text":"Returns false if dialog is cancelled, true otherwise. Source code in photoshop/api/application.py 471 472 473 def showColorPicker ( self ): \"\"\"Returns false if dialog is cancelled, true otherwise.\"\"\" return self . eval_javascript ( \"app.showColorPicker();\" )","title":"showColorPicker()"},{"location":"reference/photoshop/api/application/#photoshop.api.application.Application.togglePalettes","text":"Toggle palette visibility. Source code in photoshop/api/application.py 478 479 480 def togglePalettes ( self ): \"\"\"Toggle palette visibility.\"\"\" return self . doJavaScript ( \"app.togglePalettes()\" )","title":"togglePalettes()"},{"location":"reference/photoshop/api/batch_options/","text":"BatchOptions Bases: Photoshop Source code in photoshop/api/batch_options.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 class BatchOptions ( Photoshop ): object_name = \"BatchOptions\" def __init__ ( self ): super () . __init__ () @property def destination ( self ): \"\"\"The type of destination for the processed files.\"\"\" return self . app . destination @destination . setter def destination ( self , value ): self . app . destination = value @property def destinationFolder ( self ): \"\"\"The folder location for the processed files. Valid only when \u2018destination\u2019 = folder.\"\"\" return self . app . destinationFolder @destinationFolder . setter def destinationFolder ( self , path ): self . app . destinationFolder = path @property def errorFile ( self ): \"\"\"The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank.\"\"\" return self . app . errorFile @errorFile . setter def errorFile ( self , file_path ): self . app . errorFile = file_path @property def fileNaming ( self ) -> list : \"\"\"A list of file naming options. Maximum: 6.\"\"\" return self . app . fileNaming @fileNaming . setter def fileNaming ( self , file_naming : list ): self . app . fileNaming = file_naming @property def macintoshCompatible ( self ) -> bool : \"\"\"If true, the final file names are Macintosh compatible.\"\"\" return self . app . macintoshCompatible @macintoshCompatible . setter def macintoshCompatible ( self , value : bool ): self . app . macintoshCompatible = value @property def overrideOpen ( self ) -> bool : \"\"\"If true, overrides action open commands.\"\"\" return self . app . overrideOpen @overrideOpen . setter def overrideOpen ( self , value : bool ): self . app . overrideOpen = value @property def overrideSave ( self ) -> bool : \"\"\"If true, overrides save as action steps with the specified destination.\"\"\" return self . app . overrideSave @overrideSave . setter def overrideSave ( self , value : bool ): self . app . overrideSave = value @property def startingSerial ( self ) -> int : \"\"\"The starting serial number to use in naming files.\"\"\" return self . app . startingSerial @startingSerial . setter def startingSerial ( self , value : int ): self . app . startingSerial = value @property def suppressOpen ( self ) -> bool : \"\"\"If true, suppresses file open options dialogs.\"\"\" return self . app . suppressOpen @suppressOpen . setter def suppressOpen ( self , value : bool ): self . app . suppressOpen = value @property def suppressProfile ( self ) -> bool : \"\"\"If true, suppresses color profile warnings.\"\"\" return self . app . suppressProfile @suppressProfile . setter def suppressProfile ( self , value : bool ): self . app . suppressProfile = value @property def unixCompatible ( self ) -> bool : \"\"\"If true, the final file names are Unix compatible.\"\"\" return self . app . unixCompatible @unixCompatible . setter def unixCompatible ( self , value : bool ): self . app . unixCompatible = value @property def windowsCompatible ( self ) -> bool : \"\"\"If true, the final file names are Windows compatible.\"\"\" return self . app . windowsCompatible @windowsCompatible . setter def windowsCompatible ( self , value : bool ): self . app . windowsCompatible = value destination property writable The type of destination for the processed files. destinationFolder property writable The folder location for the processed files. Valid only when \u2018destination\u2019 = folder. errorFile property writable The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank. fileNaming : list property writable A list of file naming options. Maximum: 6. macintoshCompatible : bool property writable If true, the final file names are Macintosh compatible. overrideOpen : bool property writable If true, overrides action open commands. overrideSave : bool property writable If true, overrides save as action steps with the specified destination. startingSerial : int property writable The starting serial number to use in naming files. suppressOpen : bool property writable If true, suppresses file open options dialogs. suppressProfile : bool property writable If true, suppresses color profile warnings. unixCompatible : bool property writable If true, the final file names are Unix compatible. windowsCompatible : bool property writable If true, the final file names are Windows compatible.","title":"batch_options"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions","text":"Bases: Photoshop Source code in photoshop/api/batch_options.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 class BatchOptions ( Photoshop ): object_name = \"BatchOptions\" def __init__ ( self ): super () . __init__ () @property def destination ( self ): \"\"\"The type of destination for the processed files.\"\"\" return self . app . destination @destination . setter def destination ( self , value ): self . app . destination = value @property def destinationFolder ( self ): \"\"\"The folder location for the processed files. Valid only when \u2018destination\u2019 = folder.\"\"\" return self . app . destinationFolder @destinationFolder . setter def destinationFolder ( self , path ): self . app . destinationFolder = path @property def errorFile ( self ): \"\"\"The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank.\"\"\" return self . app . errorFile @errorFile . setter def errorFile ( self , file_path ): self . app . errorFile = file_path @property def fileNaming ( self ) -> list : \"\"\"A list of file naming options. Maximum: 6.\"\"\" return self . app . fileNaming @fileNaming . setter def fileNaming ( self , file_naming : list ): self . app . fileNaming = file_naming @property def macintoshCompatible ( self ) -> bool : \"\"\"If true, the final file names are Macintosh compatible.\"\"\" return self . app . macintoshCompatible @macintoshCompatible . setter def macintoshCompatible ( self , value : bool ): self . app . macintoshCompatible = value @property def overrideOpen ( self ) -> bool : \"\"\"If true, overrides action open commands.\"\"\" return self . app . overrideOpen @overrideOpen . setter def overrideOpen ( self , value : bool ): self . app . overrideOpen = value @property def overrideSave ( self ) -> bool : \"\"\"If true, overrides save as action steps with the specified destination.\"\"\" return self . app . overrideSave @overrideSave . setter def overrideSave ( self , value : bool ): self . app . overrideSave = value @property def startingSerial ( self ) -> int : \"\"\"The starting serial number to use in naming files.\"\"\" return self . app . startingSerial @startingSerial . setter def startingSerial ( self , value : int ): self . app . startingSerial = value @property def suppressOpen ( self ) -> bool : \"\"\"If true, suppresses file open options dialogs.\"\"\" return self . app . suppressOpen @suppressOpen . setter def suppressOpen ( self , value : bool ): self . app . suppressOpen = value @property def suppressProfile ( self ) -> bool : \"\"\"If true, suppresses color profile warnings.\"\"\" return self . app . suppressProfile @suppressProfile . setter def suppressProfile ( self , value : bool ): self . app . suppressProfile = value @property def unixCompatible ( self ) -> bool : \"\"\"If true, the final file names are Unix compatible.\"\"\" return self . app . unixCompatible @unixCompatible . setter def unixCompatible ( self , value : bool ): self . app . unixCompatible = value @property def windowsCompatible ( self ) -> bool : \"\"\"If true, the final file names are Windows compatible.\"\"\" return self . app . windowsCompatible @windowsCompatible . setter def windowsCompatible ( self , value : bool ): self . app . windowsCompatible = value","title":"BatchOptions"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.destination","text":"The type of destination for the processed files.","title":"destination"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.destinationFolder","text":"The folder location for the processed files. Valid only when \u2018destination\u2019 = folder.","title":"destinationFolder"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.errorFile","text":"The file in which to log errors encountered. To display errors on the screen and stop batch processing when errors occur, leave blank.","title":"errorFile"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.fileNaming","text":"A list of file naming options. Maximum: 6.","title":"fileNaming"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.macintoshCompatible","text":"If true, the final file names are Macintosh compatible.","title":"macintoshCompatible"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.overrideOpen","text":"If true, overrides action open commands.","title":"overrideOpen"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.overrideSave","text":"If true, overrides save as action steps with the specified destination.","title":"overrideSave"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.startingSerial","text":"The starting serial number to use in naming files.","title":"startingSerial"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.suppressOpen","text":"If true, suppresses file open options dialogs.","title":"suppressOpen"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.suppressProfile","text":"If true, suppresses color profile warnings.","title":"suppressProfile"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.unixCompatible","text":"If true, the final file names are Unix compatible.","title":"unixCompatible"},{"location":"reference/photoshop/api/batch_options/#photoshop.api.batch_options.BatchOptions.windowsCompatible","text":"If true, the final file names are Windows compatible.","title":"windowsCompatible"},{"location":"reference/photoshop/api/constants/","text":"","title":"constants"},{"location":"reference/photoshop/api/enumerations/","text":"constants type of enum for Photoshop.","title":"enumerations"},{"location":"reference/photoshop/api/errors/","text":"","title":"errors"},{"location":"reference/photoshop/api/event_id/","text":"EventID Bases: str , Enum All event ids. Source code in photoshop/api/event_id.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 class EventID ( str , Enum ): \"\"\"All event ids.\"\"\" # Here is a list of JSON CallBack events in Photoshop. # https://community.adobe.com/t5/get-started/photoshop-json-callback-events-list-up-to-cc2015-ver-16/td-p/4792115?page=1 TDTransform = \"TdT \" Average = \"Avrg\" ApplyStyle = \"ASty\" Assert = \"Asrt\" AccentedEdges = \"AccE\" Add = \"Add\" AddNoise = \"AdNs\" AddTo = \"AddT\" Align = \"Algn\" All = \"All \" AngledStrokes = \"AngS\" ApplyImage = \"AppI\" BasRelief = \"BsRl\" Batch = \"Btch\" BatchFromDroplet = \"BtcF\" Blur = \"Blr \" BlurMore = \"BlrM\" Border = \"Brdr\" Brightness = \"BrgC\" CanvasSize = \"CnvS\" ChalkCharcoal = \"ChlC\" ChannelMixer = \"ChnM\" Charcoal = \"Chrc\" Chrome = \"Chrm\" Clear = \"Cler\" Close = \"Cls \" Clouds = \"Clds\" ColorBalance = \"ClrB\" ColorHalftone = \"ClrH\" ColorRange = \"ClrR\" ColoredPencil = \"ClrP\" ContactSheet = \"0B71D221-F8CE-11d2-B21B-0008C75B322C\" ConteCrayon = \"CntC\" Contract = \"Cntc\" ConvertMode = \"CnvM\" Copy = \"copy\" CopyEffects = \"CpFX\" CopyMerged = \"CpyM\" CopyToLayer = \"CpTL\" Craquelure = \"Crql\" CreateDroplet = \"CrtD\" Crop = \"Crop\" Crosshatch = \"Crsh\" Crystallize = \"Crst\" Curves = \"Crvs\" Custom = \"Cstm\" Cut = \"cut \" CutToLayer = \"CtTL\" Cutout = \"Ct \" DarkStrokes = \"DrkS\" DeInterlace = \"Dntr\" DefinePattern = \"DfnP\" Defringe = \"Dfrg\" Delete = \"Dlt \" Desaturate = \"Dstt\" Deselect = \"Dslc\" Despeckle = \"Dspc\" DifferenceClouds = \"DrfC\" Diffuse = \"Dfs \" DiffuseGlow = \"DfsG\" DisableLayerFX = \"dlfx\" Displace = \"Dspl\" Distribute = \"Dstr\" Draw = \"Draw\" DryBrush = \"DryB\" Duplicate = \"Dplc\" DustAndScratches = \"DstS\" Emboss = \"Embs\" Equalize = \"Eqlz\" Exchange = \"Exch\" Expand = \"Expn\" Export = \"Expr\" Jumpto = \"Jpto\" ExportTransparentImage = \"02879e00-cb66-11d1-bc43-0060b0a13dc4\" Extrude = \"Extr\" Facet = \"Fct \" Fade = \"Fade\" Feather = \"Fthr\" Fibers = \"Fbrs\" Fill = \"Fl \" FilmGrain = \"FlmG\" Filter = \"Fltr\" FindEdges = \"FndE\" FitImage = \"3caa3434-cb67-11d1-bc43-0060b0a13dc4\" FlattenImage = \"FltI\" Flip = \"Flip\" Fragment = \"Frgm\" Fresco = \"Frsc\" GaussianBlur = \"GsnB\" Get = \"getd\" Glass = \"Gls \" GlowingEdges = \"GlwE\" Gradient = \"Grdn\" GradientMap = \"GrMp\" Grain = \"Grn \" GraphicPen = \"GraP\" Group = \"GrpL\" Grow = \"Grow\" HalftoneScreen = \"HlfS\" Hide = \"Hd \" HighPass = \"HghP\" HSBHSL = \"HsbP\" HueSaturation = \"HStr\" ImageSize = \"ImgS\" Import = \"Impr\" InkOutlines = \"InkO\" Intersect = \"Intr\" IntersectWith = \"IntW\" Inverse = \"Invs\" Invert = \"Invr\" LensFlare = \"LnsF\" Levels = \"Lvls\" LightingEffects = \"LghE\" Link = \"Lnk \" Make = \"Mk \" Maximum = \"Mxm \" Median = \"Mdn \" MergeLayers = \"Mrg2\" MergeLayersOld = \"MrgL\" MergeSpotChannel = \"MSpt\" MergeVisible = \"MrgV\" Mezzotint = \"Mztn\" Minimum = \"Mnm \" ModeChange = \"8cba8cd6-cb66-11d1-bc43-0060b0a13dc4\" Mosaic = \"Msc \" Mosaic_PLUGIN = \"MscT\" MotionBlur = \"MtnB\" Move = \"move\" NTSCColors = \"NTSC\" NeonGlow = \"NGlw\" Next = \"Nxt \" NotePaper = \"NtPr\" Notify = \"Ntfy\" Null = \"typeNull\" OceanRipple = \"OcnR\" Offset = \"Ofst\" Open = \"Opn \" Paint = \"Pnt \" PaintDaubs = \"PntD\" PaletteKnife = \"PltK\" Paste = \"past\" PasteEffects = \"PaFX\" PasteInto = \"PstI\" PasteOutside = \"PstO\" Patchwork = \"Ptch\" Photocopy = \"Phtc\" PicturePackage = \"4C1ABF40-DD82-11d2-B20F-0008C75B322C\" Pinch = \"Pnch\" Place = \"Plc \" Plaster = \"Plst\" PlasticWrap = \"PlsW\" Play = \"Ply \" Pointillize = \"Pntl\" Polar = \"Plr \" PosterEdges = \"PstE\" Posterize = \"Pstr\" Previous = \"Prvs\" Print = \"Prnt\" ProfileToProfile = \"PrfT\" Purge = \"Prge\" Quit = \"quit\" RadialBlur = \"RdlB\" Rasterize = \"Rstr\" RasterizeTypeSheet = \"RstT\" RemoveBlackMatte = \"RmvB\" RemoveLayerMask = \"RmvL\" RemoveWhiteMatte = \"RmvW\" Rename = \"Rnm \" ReplaceColor = \"RplC\" Reset = \"Rset\" ResizeImage = \"1333cf0c-cb67-11d1-bc43-0060b0a13dc4\" Reticulation = \"Rtcl\" Revert = \"Rvrt\" Ripple = \"Rple\" Rotate = \"Rtte\" RoughPastels = \"RghP\" Save = \"save\" Select = \"slct\" SelectiveColor = \"SlcC\" Set = \"setd\" SharpenEdges = \"ShrE\" Sharpen = \"Shrp\" SharpenMore = \"ShrM\" Shear = \"Shr \" Show = \"Shw \" Similar = \"Smlr\" SmartBlur = \"SmrB\" Smooth = \"Smth\" SmudgeStick = \"SmdS\" Solarize = \"Slrz\" Spatter = \"Spt \" Spherize = \"Sphr\" SplitChannels = \"SplC\" Sponge = \"Spng\" SprayedStrokes = \"SprS\" StainedGlass = \"StnG\" Stamp = \"Stmp\" Stop = \"Stop\" Stroke = \"Strk\" Subtract = \"Sbtr\" SubtractFrom = \"SbtF\" Sumie = \"Smie\" TakeMergedSnapshot = \"TkMr\" TakeSnapshot = \"TkSn\" TextureFill = \"TxtF\" Texturizer = \"Txtz\" Threshold = \"Thrs\" Tiles = \"Tls \" TornEdges = \"TrnE\" TraceContour = \"TrcC\" Transform = \"Trnf\" Trap = \"Trap\" Twirl = \"Twrl\" Underpainting = \"Undr\" Undo = \"undo\" Ungroup = \"Ungr\" Unlink = \"Unlk\" UnsharpMask = \"UnsM\" Variations = \"Vrtn\" Wait = \"Wait\" WaterPaper = \"WtrP\" Watercolor = \"Wtrc\" Wave = \"Wave\" Wind = \"Wnd \" ZigZag = \"ZgZg\" BackLight = \"BacL\" FillFlash = \"FilE\" ColorCast = \"ColE\" OpenUntitled = \"OpnU\" PresetKind = \"presetKindType\" SmartSharpen = \"smartSharpen\" PresetKindType = \"presetKindType\" PresetKindCustom = \"presetKindCustom\" NoiseReduction = \"noiseReduction\" BlurType = \"blurType\" ContentLayer = \"contentLayer\" SaveStage = \"saveStage\" SaveStageType = \"saveStageType\" SaveSucceeded = \"saveSucceeded\" RasterizeLayer = \"rasterizeLayer\" ForceNotify = \"forceNotify\" PlacedLayerEditContents = \"placedLayerEditContents\"","title":"event_id"},{"location":"reference/photoshop/api/event_id/#photoshop.api.event_id.EventID","text":"Bases: str , Enum All event ids. Source code in photoshop/api/event_id.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 class EventID ( str , Enum ): \"\"\"All event ids.\"\"\" # Here is a list of JSON CallBack events in Photoshop. # https://community.adobe.com/t5/get-started/photoshop-json-callback-events-list-up-to-cc2015-ver-16/td-p/4792115?page=1 TDTransform = \"TdT \" Average = \"Avrg\" ApplyStyle = \"ASty\" Assert = \"Asrt\" AccentedEdges = \"AccE\" Add = \"Add\" AddNoise = \"AdNs\" AddTo = \"AddT\" Align = \"Algn\" All = \"All \" AngledStrokes = \"AngS\" ApplyImage = \"AppI\" BasRelief = \"BsRl\" Batch = \"Btch\" BatchFromDroplet = \"BtcF\" Blur = \"Blr \" BlurMore = \"BlrM\" Border = \"Brdr\" Brightness = \"BrgC\" CanvasSize = \"CnvS\" ChalkCharcoal = \"ChlC\" ChannelMixer = \"ChnM\" Charcoal = \"Chrc\" Chrome = \"Chrm\" Clear = \"Cler\" Close = \"Cls \" Clouds = \"Clds\" ColorBalance = \"ClrB\" ColorHalftone = \"ClrH\" ColorRange = \"ClrR\" ColoredPencil = \"ClrP\" ContactSheet = \"0B71D221-F8CE-11d2-B21B-0008C75B322C\" ConteCrayon = \"CntC\" Contract = \"Cntc\" ConvertMode = \"CnvM\" Copy = \"copy\" CopyEffects = \"CpFX\" CopyMerged = \"CpyM\" CopyToLayer = \"CpTL\" Craquelure = \"Crql\" CreateDroplet = \"CrtD\" Crop = \"Crop\" Crosshatch = \"Crsh\" Crystallize = \"Crst\" Curves = \"Crvs\" Custom = \"Cstm\" Cut = \"cut \" CutToLayer = \"CtTL\" Cutout = \"Ct \" DarkStrokes = \"DrkS\" DeInterlace = \"Dntr\" DefinePattern = \"DfnP\" Defringe = \"Dfrg\" Delete = \"Dlt \" Desaturate = \"Dstt\" Deselect = \"Dslc\" Despeckle = \"Dspc\" DifferenceClouds = \"DrfC\" Diffuse = \"Dfs \" DiffuseGlow = \"DfsG\" DisableLayerFX = \"dlfx\" Displace = \"Dspl\" Distribute = \"Dstr\" Draw = \"Draw\" DryBrush = \"DryB\" Duplicate = \"Dplc\" DustAndScratches = \"DstS\" Emboss = \"Embs\" Equalize = \"Eqlz\" Exchange = \"Exch\" Expand = \"Expn\" Export = \"Expr\" Jumpto = \"Jpto\" ExportTransparentImage = \"02879e00-cb66-11d1-bc43-0060b0a13dc4\" Extrude = \"Extr\" Facet = \"Fct \" Fade = \"Fade\" Feather = \"Fthr\" Fibers = \"Fbrs\" Fill = \"Fl \" FilmGrain = \"FlmG\" Filter = \"Fltr\" FindEdges = \"FndE\" FitImage = \"3caa3434-cb67-11d1-bc43-0060b0a13dc4\" FlattenImage = \"FltI\" Flip = \"Flip\" Fragment = \"Frgm\" Fresco = \"Frsc\" GaussianBlur = \"GsnB\" Get = \"getd\" Glass = \"Gls \" GlowingEdges = \"GlwE\" Gradient = \"Grdn\" GradientMap = \"GrMp\" Grain = \"Grn \" GraphicPen = \"GraP\" Group = \"GrpL\" Grow = \"Grow\" HalftoneScreen = \"HlfS\" Hide = \"Hd \" HighPass = \"HghP\" HSBHSL = \"HsbP\" HueSaturation = \"HStr\" ImageSize = \"ImgS\" Import = \"Impr\" InkOutlines = \"InkO\" Intersect = \"Intr\" IntersectWith = \"IntW\" Inverse = \"Invs\" Invert = \"Invr\" LensFlare = \"LnsF\" Levels = \"Lvls\" LightingEffects = \"LghE\" Link = \"Lnk \" Make = \"Mk \" Maximum = \"Mxm \" Median = \"Mdn \" MergeLayers = \"Mrg2\" MergeLayersOld = \"MrgL\" MergeSpotChannel = \"MSpt\" MergeVisible = \"MrgV\" Mezzotint = \"Mztn\" Minimum = \"Mnm \" ModeChange = \"8cba8cd6-cb66-11d1-bc43-0060b0a13dc4\" Mosaic = \"Msc \" Mosaic_PLUGIN = \"MscT\" MotionBlur = \"MtnB\" Move = \"move\" NTSCColors = \"NTSC\" NeonGlow = \"NGlw\" Next = \"Nxt \" NotePaper = \"NtPr\" Notify = \"Ntfy\" Null = \"typeNull\" OceanRipple = \"OcnR\" Offset = \"Ofst\" Open = \"Opn \" Paint = \"Pnt \" PaintDaubs = \"PntD\" PaletteKnife = \"PltK\" Paste = \"past\" PasteEffects = \"PaFX\" PasteInto = \"PstI\" PasteOutside = \"PstO\" Patchwork = \"Ptch\" Photocopy = \"Phtc\" PicturePackage = \"4C1ABF40-DD82-11d2-B20F-0008C75B322C\" Pinch = \"Pnch\" Place = \"Plc \" Plaster = \"Plst\" PlasticWrap = \"PlsW\" Play = \"Ply \" Pointillize = \"Pntl\" Polar = \"Plr \" PosterEdges = \"PstE\" Posterize = \"Pstr\" Previous = \"Prvs\" Print = \"Prnt\" ProfileToProfile = \"PrfT\" Purge = \"Prge\" Quit = \"quit\" RadialBlur = \"RdlB\" Rasterize = \"Rstr\" RasterizeTypeSheet = \"RstT\" RemoveBlackMatte = \"RmvB\" RemoveLayerMask = \"RmvL\" RemoveWhiteMatte = \"RmvW\" Rename = \"Rnm \" ReplaceColor = \"RplC\" Reset = \"Rset\" ResizeImage = \"1333cf0c-cb67-11d1-bc43-0060b0a13dc4\" Reticulation = \"Rtcl\" Revert = \"Rvrt\" Ripple = \"Rple\" Rotate = \"Rtte\" RoughPastels = \"RghP\" Save = \"save\" Select = \"slct\" SelectiveColor = \"SlcC\" Set = \"setd\" SharpenEdges = \"ShrE\" Sharpen = \"Shrp\" SharpenMore = \"ShrM\" Shear = \"Shr \" Show = \"Shw \" Similar = \"Smlr\" SmartBlur = \"SmrB\" Smooth = \"Smth\" SmudgeStick = \"SmdS\" Solarize = \"Slrz\" Spatter = \"Spt \" Spherize = \"Sphr\" SplitChannels = \"SplC\" Sponge = \"Spng\" SprayedStrokes = \"SprS\" StainedGlass = \"StnG\" Stamp = \"Stmp\" Stop = \"Stop\" Stroke = \"Strk\" Subtract = \"Sbtr\" SubtractFrom = \"SbtF\" Sumie = \"Smie\" TakeMergedSnapshot = \"TkMr\" TakeSnapshot = \"TkSn\" TextureFill = \"TxtF\" Texturizer = \"Txtz\" Threshold = \"Thrs\" Tiles = \"Tls \" TornEdges = \"TrnE\" TraceContour = \"TrcC\" Transform = \"Trnf\" Trap = \"Trap\" Twirl = \"Twrl\" Underpainting = \"Undr\" Undo = \"undo\" Ungroup = \"Ungr\" Unlink = \"Unlk\" UnsharpMask = \"UnsM\" Variations = \"Vrtn\" Wait = \"Wait\" WaterPaper = \"WtrP\" Watercolor = \"Wtrc\" Wave = \"Wave\" Wind = \"Wnd \" ZigZag = \"ZgZg\" BackLight = \"BacL\" FillFlash = \"FilE\" ColorCast = \"ColE\" OpenUntitled = \"OpnU\" PresetKind = \"presetKindType\" SmartSharpen = \"smartSharpen\" PresetKindType = \"presetKindType\" PresetKindCustom = \"presetKindCustom\" NoiseReduction = \"noiseReduction\" BlurType = \"blurType\" ContentLayer = \"contentLayer\" SaveStage = \"saveStage\" SaveStageType = \"saveStageType\" SaveSucceeded = \"saveSucceeded\" RasterizeLayer = \"rasterizeLayer\" ForceNotify = \"forceNotify\" PlacedLayerEditContents = \"placedLayerEditContents\"","title":"EventID"},{"location":"reference/photoshop/api/solid_color/","text":"A color definition used in the document. Maps a color to equivalents in all available color models. Used in Application.backgroundColor and foregroundColor properties, in Channel.color , in ColorSampler.color , and in TextItem.color Passed to PathItem.fillPath() , Selection.fill() , and Selection.stroke() . SolidColor Bases: Photoshop A color definition used in the document. Source code in photoshop/api/solid_color.py 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 class SolidColor ( Photoshop ): \"\"\"A color definition used in the document.\"\"\" object_name = \"SolidColor\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"isEqual\" , ) @property def cmyk ( self ) -> CMYKColor : \"\"\"The CMYK color mode. Returns: .colors.cmyk.CMYKColor: \"\"\" return CMYKColor ( self . app . cmyk ) @cmyk . setter def cmyk ( self , value : CMYKColor ): self . app . cmyk = value @property def gray ( self ) -> GrayColor : return GrayColor ( self . app . gray ) @property def hsb ( self ) -> HSBColor : return HSBColor ( self . app . hsb ) @hsb . setter def hsb ( self , value : HSBColor ): self . app . hsb = value @property def lab ( self ) -> LabColor : return LabColor ( self . app . lab ) @lab . setter def lab ( self , value : LabColor ): self . app . lab = value @property def model ( self ) -> ColorModel : \"\"\"The color model.\"\"\" return ColorModel ( self . app . model ) @model . setter def model ( self , value : ColorModel ): \"\"\"The color model.\"\"\" self . app . model = value @property def nearestWebColor ( self ) -> RGBColor : \"\"\"The nearest web color to the current color.\"\"\" return RGBColor ( self . app . NearestWebColor ) @property def rgb ( self ) -> RGBColor : \"\"\"The RGB color mode.\"\"\" return RGBColor ( self . app . rgb ) @rgb . setter def rgb ( self , value : RGBColor ): self . app . rgb = value def isEqual ( self , color : RGBColor ): \"\"\"`SolidColor` object is visually equal to the specified color.\"\"\" return self . app . isEqual ( color ) cmyk : CMYKColor property writable The CMYK color mode. Returns: Type Description CMYKColor .colors.cmyk.CMYKColor: model : ColorModel property writable The color model. nearestWebColor : RGBColor property The nearest web color to the current color. rgb : RGBColor property writable The RGB color mode. isEqual ( color ) SolidColor object is visually equal to the specified color. Source code in photoshop/api/solid_color.py 90 91 92 def isEqual ( self , color : RGBColor ): \"\"\"`SolidColor` object is visually equal to the specified color.\"\"\" return self . app . isEqual ( color )","title":"solid_color"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor","text":"Bases: Photoshop A color definition used in the document. Source code in photoshop/api/solid_color.py 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 class SolidColor ( Photoshop ): \"\"\"A color definition used in the document.\"\"\" object_name = \"SolidColor\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"isEqual\" , ) @property def cmyk ( self ) -> CMYKColor : \"\"\"The CMYK color mode. Returns: .colors.cmyk.CMYKColor: \"\"\" return CMYKColor ( self . app . cmyk ) @cmyk . setter def cmyk ( self , value : CMYKColor ): self . app . cmyk = value @property def gray ( self ) -> GrayColor : return GrayColor ( self . app . gray ) @property def hsb ( self ) -> HSBColor : return HSBColor ( self . app . hsb ) @hsb . setter def hsb ( self , value : HSBColor ): self . app . hsb = value @property def lab ( self ) -> LabColor : return LabColor ( self . app . lab ) @lab . setter def lab ( self , value : LabColor ): self . app . lab = value @property def model ( self ) -> ColorModel : \"\"\"The color model.\"\"\" return ColorModel ( self . app . model ) @model . setter def model ( self , value : ColorModel ): \"\"\"The color model.\"\"\" self . app . model = value @property def nearestWebColor ( self ) -> RGBColor : \"\"\"The nearest web color to the current color.\"\"\" return RGBColor ( self . app . NearestWebColor ) @property def rgb ( self ) -> RGBColor : \"\"\"The RGB color mode.\"\"\" return RGBColor ( self . app . rgb ) @rgb . setter def rgb ( self , value : RGBColor ): self . app . rgb = value def isEqual ( self , color : RGBColor ): \"\"\"`SolidColor` object is visually equal to the specified color.\"\"\" return self . app . isEqual ( color )","title":"SolidColor"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.cmyk","text":"The CMYK color mode. Returns: Type Description CMYKColor .colors.cmyk.CMYKColor:","title":"cmyk"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.model","text":"The color model.","title":"model"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.nearestWebColor","text":"The nearest web color to the current color.","title":"nearestWebColor"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.rgb","text":"The RGB color mode.","title":"rgb"},{"location":"reference/photoshop/api/solid_color/#photoshop.api.solid_color.SolidColor.isEqual","text":"SolidColor object is visually equal to the specified color. Source code in photoshop/api/solid_color.py 90 91 92 def isEqual ( self , color : RGBColor ): \"\"\"`SolidColor` object is visually equal to the specified color.\"\"\" return self . app . isEqual ( color )","title":"isEqual()"},{"location":"reference/photoshop/api/text_font/","text":"TextFont Bases: Photoshop An installed font. Source code in photoshop/api/text_font.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 class TextFont ( Photoshop ): \"\"\"An installed font.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) @property def family ( self ) -> str : \"\"\"The font family\"\"\" return self . app . family @property def name ( self ): \"\"\"The name of the font.\"\"\" return self . app . name @property def postScriptName ( self ): \"\"\"The PostScript name of the font.\"\"\" return self . app . postScriptName @property def style ( self ): \"\"\"The font style.\"\"\" return self . app . style family : str property The font family name property The name of the font. postScriptName property The PostScript name of the font. style property The font style.","title":"text_font"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont","text":"Bases: Photoshop An installed font. Source code in photoshop/api/text_font.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 class TextFont ( Photoshop ): \"\"\"An installed font.\"\"\" def __init__ ( self , parent = None ): super () . __init__ ( parent = parent ) @property def family ( self ) -> str : \"\"\"The font family\"\"\" return self . app . family @property def name ( self ): \"\"\"The name of the font.\"\"\" return self . app . name @property def postScriptName ( self ): \"\"\"The PostScript name of the font.\"\"\" return self . app . postScriptName @property def style ( self ): \"\"\"The font style.\"\"\" return self . app . style","title":"TextFont"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont.family","text":"The font family","title":"family"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont.name","text":"The name of the font.","title":"name"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont.postScriptName","text":"The PostScript name of the font.","title":"postScriptName"},{"location":"reference/photoshop/api/text_font/#photoshop.api.text_font.TextFont.style","text":"The font style.","title":"style"},{"location":"reference/photoshop/api/text_item/","text":"TextItem Bases: Photoshop The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. Source code in photoshop/api/text_item.py 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 class TextItem ( Photoshop ): \"\"\"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer.\"\"\" object_name = \"Application\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"convertToShape\" , \"createPath\" , ) @property def alternateLigatures ( self ): return self . app . alternateLigatures @alternateLigatures . setter def alternateLigatures ( self , value ): self . app . alternateLigatures = value @property def antiAliasMethod ( self ) -> AntiAlias : \"\"\"The method of anti aliasing to use.\"\"\" return AntiAlias ( self . app . antiAliasMethod ) @antiAliasMethod . setter def antiAliasMethod ( self , value ): self . app . antiAliasMethod = value @property def autoKerning ( self ) -> AutoKernType : \"\"\"The auto kerning option to use.\"\"\" return AutoKernType ( self . app . autoKerning ) @autoKerning . setter def autoKerning ( self , value ): self . app . autoKerning = value @property def autoLeadingAmount ( self ): return self . app . autoLeadingAmount @autoLeadingAmount . setter def autoLeadingAmount ( self , value ): \"\"\"The percentage to use for auto (default) leading (in points). Valid only when useAutoLeading = True. \"\"\" self . app . useAutoLeading = True self . app . autoLeadingAmount = value @property def baselineShift ( self ): \"\"\"The unit value to use in the baseline offset of text.\"\"\" return self . app . baselineShift @baselineShift . setter def baselineShift ( self , value ): self . app . baselineShift = value @property def capitalization ( self ): \"\"\"Gets text case.\"\"\" return self . app . capitalization @capitalization . setter def capitalization ( self , value ): \"\"\"Sets text case.\"\"\" self . app . capitalization = value @property def color ( self ) -> SolidColor : \"\"\"The text color.\"\"\" return SolidColor ( self . app . color ) @color . setter def color ( self , color_value ): \"\"\"The color of textItem.\"\"\" self . app . color = color_value @property def contents ( self ) -> str : \"\"\"The actual text in the layer.\"\"\" return self . app . contents @contents . setter def contents ( self , text : str ): \"\"\"Set the actual text in the layer. Args: text: The actual text. \"\"\" self . app . contents = text @property def desiredGlyphScaling ( self ): \"\"\"The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled.\"\"\" return self . app . desiredGlyphScaling @desiredGlyphScaling . setter def desiredGlyphScaling ( self , value ): self . app . desiredGlyphScaling = value @property def desiredLetterScaling ( self ): \"\"\"The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required. \"\"\" return self . app . desiredLetterScaling @desiredLetterScaling . setter def desiredLetterScaling ( self , value ): self . app . desiredGlyphScaling = value @property def desiredWordScaling ( self ): \"\"\" The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required \"\"\" return self . app . desiredWordScaling @desiredWordScaling . setter def desiredWordScaling ( self , value ): self . app . desiredWordScaling = value @property def direction ( self ): \"\"\"The text orientation.\"\"\" return Direction ( self . app . direction ) @direction . setter def direction ( self , value ): self . app . direction = value @property def fauxBold ( self ): \"\"\"True to use faux bold (default: false). Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette. \"\"\" return self . app . fauxBold @fauxBold . setter def fauxBold ( self , value ): self . app . fauxBold = value @property def fauxItalic ( self ): \"\"\"True to use faux italic (default: false). Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette. \"\"\" return self . app . fauxItalic @fauxItalic . setter def fauxItalic ( self , value ): self . app . fauxItalic = value @property def firstLineIndent ( self ): \"\"\"The amount (unit value) to indent the first line of paragraphs.\"\"\" return self . app . firstLineIndent @firstLineIndent . setter def firstLineIndent ( self , value ): self . app . firstLineIndent = value @property def font ( self ) -> str : \"\"\"str: postScriptName of the TextItem's font.\"\"\" return self . app . font @font . setter def font ( self , text_font : str ): \"\"\"Set the font of this TextItem. Args: text_font (str): Must provide the postScriptName of a valid font. \"\"\" self . app . font = text_font @property def hangingPunctuation ( self ) -> bool : \"\"\"bool: Whether to use Roman hanging punctuation.\"\"\" return self . app . hangingPunctuation @hangingPunctuation . setter def hangingPunctuation ( self , value : bool ): self . app . hangingPunctuation = value @property def height ( self ): \"\"\"int: The height of the bounding box for paragraph text.\"\"\" return self . app . height @height . setter def height ( self , value ): self . app . height = value @property def horizontalScale ( self ) -> int : \"\"\"Character scaling (horizontal) in proportion to verticalScale (a percentage value).\"\"\" return self . app . horizontalScale @horizontalScale . setter def horizontalScale ( self , value : int ): \"\"\"Set the horizontalScale of this TextItem. Args: value: An integer between 0 and 1000. \"\"\" self . app . horizontalScale = value @property def hyphenateAfterFirst ( self ): \"\"\"The number of letters after which hyphenation in word wrap is allowed.\"\"\" return self . app . hyphenateAfterFirst @hyphenateAfterFirst . setter def hyphenateAfterFirst ( self , value ): self . app . hyphenateAfterFirst = value @property def hyphenateBeforeLast ( self ): \"\"\"The number of letters before which hyphenation in word wrap is allowed.\"\"\" return self . app . hyphenateBeforeLast @hyphenateBeforeLast . setter def hyphenateBeforeLast ( self , value ): self . app . hyphenateBeforeLast = value @property def hyphenateCapitalWords ( self ): \"\"\"True to allow hyphenation in word wrap of capitalized words\"\"\" return self . app . hyphenateCapitalWords @hyphenateCapitalWords . setter def hyphenateCapitalWords ( self , value ): self . app . hyphenateCapitalWords = value @property def hyphenateWordsLongerThan ( self ): \"\"\"The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.\"\"\" return self . app . hyphenateWordsLongerThan @hyphenateWordsLongerThan . setter def hyphenateWordsLongerThan ( self , value ): self . app . hyphenateWordsLongerThan = value @property def hyphenation ( self ): \"\"\"True to use hyphenation in word wrap.\"\"\" return self . app . hyphenation @hyphenation . setter def hyphenation ( self , value ): self . app . hyphenation = value @property def hyphenationZone ( self ): \"\"\"The distance at the end of a line that will cause a word to break in unjustified type.\"\"\" return self . app . hyphenationZone @hyphenationZone . setter def hyphenationZone ( self , value ): self . app . hyphenationZone = value @property def hyphenLimit ( self ): return self . app . hyphenLimit @hyphenLimit . setter def hyphenLimit ( self , value ): self . app . hyphenLimit = value @property def justification ( self ): \"\"\"The paragraph justification.\"\"\" return Justification ( self . app . justification ) @justification . setter def justification ( self , value ): self . app . justification = value @property def kind ( self ): return TextType ( self . app . kind ) @kind . setter def kind ( self , kind_type ): self . app . kind = kind_type @property def language ( self ): return Language ( self . app . language ) @language . setter def language ( self , text ): self . app . language = text @property def leading ( self ): return self . app . leading @leading . setter def leading ( self , value ): self . app . leading = value @property def leftIndent ( self ): \"\"\"The amoun of space to indent text from the left.\"\"\" return self . app . leftIndent @leftIndent . setter def leftIndent ( self , value ): self . app . leftIndent = value @property def ligatures ( self ): \"\"\"True to use ligatures.\"\"\" return self . app . ligatures @ligatures . setter def ligatures ( self , value ): self . app . ligatures = value @property def maximumGlyphScaling ( self ): \"\"\"The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required. \"\"\" return self . app . maximumGlyphScaling @maximumGlyphScaling . setter def maximumGlyphScaling ( self , value ): self . app . maximumGlyphScaling = value @property def maximumLetterScaling ( self ): \"\"\"The maximum amount of space to allow between letters (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required. \"\"\" return self . app . maximumLetterScaling @maximumLetterScaling . setter def maximumLetterScaling ( self , value ): self . app . maximumLetterScaling = value @property def maximumWordScaling ( self ): return self . app . maximumWordScaling @maximumWordScaling . setter def maximumWordScaling ( self , value ): self . app . maximumWordScaling = value @property def minimumGlyphScaling ( self ): \"\"\"The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required. \"\"\" return self . app . minimumGlyphScaling @minimumGlyphScaling . setter def minimumGlyphScaling ( self , value ): self . app . minimumGlyphScaling = value @property def minimumLetterScaling ( self ): \"\"\"The minimum amount of space to allow between letters (a percentage value; at 0, no space is removed between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required. \"\"\" return self . app . minimumLetterScaling @minimumLetterScaling . setter def minimumLetterScaling ( self , value ): self . app . minimumLetterScaling = value @property def minimumWordScaling ( self ): \"\"\"The minimum amount of space to allow between words (a percentage value; at 100, no additional space is removed between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required. \"\"\" return self . app . minimumWordScaling @minimumWordScaling . setter def minimumWordScaling ( self , value ): self . app . minimumWordScaling = value @property def noBreak ( self ): \"\"\"True to disallow line breaks in this text. Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen. \"\"\" return self . app . noBreak @noBreak . setter def noBreak ( self , value ): self . app . noBreak = value @property def oldStyle ( self ): return self . app . oldStyle @oldStyle . setter def oldStyle ( self , value ): self . app . oldStyle = value @property def parent ( self ): return self . app . parent @parent . setter def parent ( self , value ): self . app . parent = value @property def position ( self ): return self . app . position @position . setter def position ( self , array ): \"\"\"The position of the origin for the text. The array must contain two values. Setting this property is basically equivalent to clicking the text tool at a point in the documents to create the point of origin for text. \"\"\" self . app . position = array @property def rightIndent ( self ): return self . app . rightIndent @rightIndent . setter def rightIndent ( self , value ): self . app . rightIndent = value @property def size ( self ): \"\"\"The font size in UnitValue. NOTE: Type was points for CS3 and older. \"\"\" return self . app . size @size . setter def size ( self , value ): self . app . size = value @property def spaceAfter ( self ): \"\"\"The amount of space to use after each paragraph.\"\"\" return self . app . spaceAfter @spaceAfter . setter def spaceAfter ( self , value ): self . app . spaceAfter = value @property def spaceBefore ( self ): return self . app . spaceBefore @spaceBefore . setter def spaceBefore ( self , value ): self . app . spaceBefore = value @property def strikeThru ( self ): \"\"\"The text strike-through option to use.\"\"\" return StrikeThruType ( self . app . strikeThru ) @strikeThru . setter def strikeThru ( self , value ): self . app . strikeThru = value @property def textComposer ( self ): return TextComposer ( self . app . textComposer ) @textComposer . setter def textComposer ( self , value ): self . app . textComposer = value @property def tracking ( self ): return self . app . tracking @tracking . setter def tracking ( self , value ): self . app . tracking = value @property def underline ( self ): \"\"\"The text underlining options.\"\"\" return self . app . underline @underline . setter def underline ( self , value ): self . app . underline = value @property def useAutoLeading ( self ): return self . app . useAutoLeading @useAutoLeading . setter def useAutoLeading ( self , value ): self . app . useAutoLeading = value @property def verticalScale ( self ): return self . app . verticalScale @verticalScale . setter def verticalScale ( self , value ): self . app . verticalScale = value @property def warpBend ( self ): \"\"\"The warp bend percentage.\"\"\" return self . app . warpBend @warpBend . setter def warpBend ( self , value ): self . app . warpBend = value @property def warpDirection ( self ) -> Direction : \"\"\"The warp direction.\"\"\" return Direction ( self . app . warpDirection ) @warpDirection . setter def warpDirection ( self , value ): self . app . warpDirection = value @property def warpHorizontalDistortion ( self ): return self . app . warpHorizontalDistortion @warpHorizontalDistortion . setter def warpHorizontalDistortion ( self , value ): self . app . warpHorizontalDistortion = value @property def warpStyle ( self ): \"\"\"The style of warp to use.\"\"\" return self . app . warpStyle @warpStyle . setter def warpStyle ( self , value ): self . app . warpStyle = value @property def warpVerticalDistortion ( self ): return self . app . warpVerticalDistortion @warpVerticalDistortion . setter def warpVerticalDistortion ( self , value ): self . app . warpVerticalDistortion = value @property def width ( self ): \"\"\"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. \"\"\" return self . app . width @width . setter def width ( self , value : float ): \"\"\"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. \"\"\" self . app . width = value def convertToShape ( self ): \"\"\"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.\"\"\" return self . app . convertToShape () def createPath ( self ): \"\"\"Creates a clipping path from the outlines of the actual text items (such as letters or words). \"\"\" return self . app . createPath () antiAliasMethod : AntiAlias property writable The method of anti aliasing to use. autoKerning : AutoKernType property writable The auto kerning option to use. baselineShift property writable The unit value to use in the baseline offset of text. capitalization property writable Gets text case. color : SolidColor property writable The text color. contents : str property writable The actual text in the layer. desiredGlyphScaling property writable The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled. desiredLetterScaling property writable The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required. desiredWordScaling property writable The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required direction property writable The text orientation. fauxBold property writable True to use faux bold (default: false). Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette. fauxItalic property writable True to use faux italic (default: false). Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette. firstLineIndent property writable The amount (unit value) to indent the first line of paragraphs. font : str property writable hangingPunctuation : bool property writable height property writable horizontalScale : int property writable Character scaling (horizontal) in proportion to verticalScale (a percentage value). hyphenateAfterFirst property writable The number of letters after which hyphenation in word wrap is allowed. hyphenateBeforeLast property writable The number of letters before which hyphenation in word wrap is allowed. hyphenateCapitalWords property writable True to allow hyphenation in word wrap of capitalized words hyphenateWordsLongerThan property writable The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed. hyphenation property writable True to use hyphenation in word wrap. hyphenationZone property writable The distance at the end of a line that will cause a word to break in unjustified type. justification property writable The paragraph justification. leftIndent property writable The amoun of space to indent text from the left. ligatures property writable True to use ligatures. maximumGlyphScaling property writable The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required. maximumLetterScaling property writable The maximum amount of space to allow between letters (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required. minimumGlyphScaling property writable The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required. minimumLetterScaling property writable The minimum amount of space to allow between letters (a percentage value; at 0, no space is removed between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required. minimumWordScaling property writable The minimum amount of space to allow between words (a percentage value; at 100, no additional space is removed between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required. noBreak property writable True to disallow line breaks in this text. Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen. size property writable The font size in UnitValue. NOTE: Type was points for CS3 and older. spaceAfter property writable The amount of space to use after each paragraph. strikeThru property writable The text strike-through option to use. underline property writable The text underlining options. warpBend property writable The warp bend percentage. warpDirection : Direction property writable The warp direction. warpStyle property writable The style of warp to use. width property writable The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. convertToShape () Converts the text item and its containing layer to a fill layer with the text changed to a clipping path. Source code in photoshop/api/text_item.py 682 683 684 685 def convertToShape ( self ): \"\"\"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.\"\"\" return self . app . convertToShape () createPath () Creates a clipping path from the outlines of the actual text items (such as letters or words). Source code in photoshop/api/text_item.py 687 688 689 690 691 692 693 def createPath ( self ): \"\"\"Creates a clipping path from the outlines of the actual text items (such as letters or words). \"\"\" return self . app . createPath ()","title":"text_item"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem","text":"Bases: Photoshop The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer. Source code in photoshop/api/text_item.py 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 class TextItem ( Photoshop ): \"\"\"The text that is associated with the layer. Valid only when \u2018kind\u2019 is text layer.\"\"\" object_name = \"Application\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . _flag_as_method ( \"convertToShape\" , \"createPath\" , ) @property def alternateLigatures ( self ): return self . app . alternateLigatures @alternateLigatures . setter def alternateLigatures ( self , value ): self . app . alternateLigatures = value @property def antiAliasMethod ( self ) -> AntiAlias : \"\"\"The method of anti aliasing to use.\"\"\" return AntiAlias ( self . app . antiAliasMethod ) @antiAliasMethod . setter def antiAliasMethod ( self , value ): self . app . antiAliasMethod = value @property def autoKerning ( self ) -> AutoKernType : \"\"\"The auto kerning option to use.\"\"\" return AutoKernType ( self . app . autoKerning ) @autoKerning . setter def autoKerning ( self , value ): self . app . autoKerning = value @property def autoLeadingAmount ( self ): return self . app . autoLeadingAmount @autoLeadingAmount . setter def autoLeadingAmount ( self , value ): \"\"\"The percentage to use for auto (default) leading (in points). Valid only when useAutoLeading = True. \"\"\" self . app . useAutoLeading = True self . app . autoLeadingAmount = value @property def baselineShift ( self ): \"\"\"The unit value to use in the baseline offset of text.\"\"\" return self . app . baselineShift @baselineShift . setter def baselineShift ( self , value ): self . app . baselineShift = value @property def capitalization ( self ): \"\"\"Gets text case.\"\"\" return self . app . capitalization @capitalization . setter def capitalization ( self , value ): \"\"\"Sets text case.\"\"\" self . app . capitalization = value @property def color ( self ) -> SolidColor : \"\"\"The text color.\"\"\" return SolidColor ( self . app . color ) @color . setter def color ( self , color_value ): \"\"\"The color of textItem.\"\"\" self . app . color = color_value @property def contents ( self ) -> str : \"\"\"The actual text in the layer.\"\"\" return self . app . contents @contents . setter def contents ( self , text : str ): \"\"\"Set the actual text in the layer. Args: text: The actual text. \"\"\" self . app . contents = text @property def desiredGlyphScaling ( self ): \"\"\"The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled.\"\"\" return self . app . desiredGlyphScaling @desiredGlyphScaling . setter def desiredGlyphScaling ( self , value ): self . app . desiredGlyphScaling = value @property def desiredLetterScaling ( self ): \"\"\"The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required. \"\"\" return self . app . desiredLetterScaling @desiredLetterScaling . setter def desiredLetterScaling ( self , value ): self . app . desiredGlyphScaling = value @property def desiredWordScaling ( self ): \"\"\" The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required \"\"\" return self . app . desiredWordScaling @desiredWordScaling . setter def desiredWordScaling ( self , value ): self . app . desiredWordScaling = value @property def direction ( self ): \"\"\"The text orientation.\"\"\" return Direction ( self . app . direction ) @direction . setter def direction ( self , value ): self . app . direction = value @property def fauxBold ( self ): \"\"\"True to use faux bold (default: false). Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette. \"\"\" return self . app . fauxBold @fauxBold . setter def fauxBold ( self , value ): self . app . fauxBold = value @property def fauxItalic ( self ): \"\"\"True to use faux italic (default: false). Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette. \"\"\" return self . app . fauxItalic @fauxItalic . setter def fauxItalic ( self , value ): self . app . fauxItalic = value @property def firstLineIndent ( self ): \"\"\"The amount (unit value) to indent the first line of paragraphs.\"\"\" return self . app . firstLineIndent @firstLineIndent . setter def firstLineIndent ( self , value ): self . app . firstLineIndent = value @property def font ( self ) -> str : \"\"\"str: postScriptName of the TextItem's font.\"\"\" return self . app . font @font . setter def font ( self , text_font : str ): \"\"\"Set the font of this TextItem. Args: text_font (str): Must provide the postScriptName of a valid font. \"\"\" self . app . font = text_font @property def hangingPunctuation ( self ) -> bool : \"\"\"bool: Whether to use Roman hanging punctuation.\"\"\" return self . app . hangingPunctuation @hangingPunctuation . setter def hangingPunctuation ( self , value : bool ): self . app . hangingPunctuation = value @property def height ( self ): \"\"\"int: The height of the bounding box for paragraph text.\"\"\" return self . app . height @height . setter def height ( self , value ): self . app . height = value @property def horizontalScale ( self ) -> int : \"\"\"Character scaling (horizontal) in proportion to verticalScale (a percentage value).\"\"\" return self . app . horizontalScale @horizontalScale . setter def horizontalScale ( self , value : int ): \"\"\"Set the horizontalScale of this TextItem. Args: value: An integer between 0 and 1000. \"\"\" self . app . horizontalScale = value @property def hyphenateAfterFirst ( self ): \"\"\"The number of letters after which hyphenation in word wrap is allowed.\"\"\" return self . app . hyphenateAfterFirst @hyphenateAfterFirst . setter def hyphenateAfterFirst ( self , value ): self . app . hyphenateAfterFirst = value @property def hyphenateBeforeLast ( self ): \"\"\"The number of letters before which hyphenation in word wrap is allowed.\"\"\" return self . app . hyphenateBeforeLast @hyphenateBeforeLast . setter def hyphenateBeforeLast ( self , value ): self . app . hyphenateBeforeLast = value @property def hyphenateCapitalWords ( self ): \"\"\"True to allow hyphenation in word wrap of capitalized words\"\"\" return self . app . hyphenateCapitalWords @hyphenateCapitalWords . setter def hyphenateCapitalWords ( self , value ): self . app . hyphenateCapitalWords = value @property def hyphenateWordsLongerThan ( self ): \"\"\"The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.\"\"\" return self . app . hyphenateWordsLongerThan @hyphenateWordsLongerThan . setter def hyphenateWordsLongerThan ( self , value ): self . app . hyphenateWordsLongerThan = value @property def hyphenation ( self ): \"\"\"True to use hyphenation in word wrap.\"\"\" return self . app . hyphenation @hyphenation . setter def hyphenation ( self , value ): self . app . hyphenation = value @property def hyphenationZone ( self ): \"\"\"The distance at the end of a line that will cause a word to break in unjustified type.\"\"\" return self . app . hyphenationZone @hyphenationZone . setter def hyphenationZone ( self , value ): self . app . hyphenationZone = value @property def hyphenLimit ( self ): return self . app . hyphenLimit @hyphenLimit . setter def hyphenLimit ( self , value ): self . app . hyphenLimit = value @property def justification ( self ): \"\"\"The paragraph justification.\"\"\" return Justification ( self . app . justification ) @justification . setter def justification ( self , value ): self . app . justification = value @property def kind ( self ): return TextType ( self . app . kind ) @kind . setter def kind ( self , kind_type ): self . app . kind = kind_type @property def language ( self ): return Language ( self . app . language ) @language . setter def language ( self , text ): self . app . language = text @property def leading ( self ): return self . app . leading @leading . setter def leading ( self , value ): self . app . leading = value @property def leftIndent ( self ): \"\"\"The amoun of space to indent text from the left.\"\"\" return self . app . leftIndent @leftIndent . setter def leftIndent ( self , value ): self . app . leftIndent = value @property def ligatures ( self ): \"\"\"True to use ligatures.\"\"\" return self . app . ligatures @ligatures . setter def ligatures ( self , value ): self . app . ligatures = value @property def maximumGlyphScaling ( self ): \"\"\"The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required. \"\"\" return self . app . maximumGlyphScaling @maximumGlyphScaling . setter def maximumGlyphScaling ( self , value ): self . app . maximumGlyphScaling = value @property def maximumLetterScaling ( self ): \"\"\"The maximum amount of space to allow between letters (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required. \"\"\" return self . app . maximumLetterScaling @maximumLetterScaling . setter def maximumLetterScaling ( self , value ): self . app . maximumLetterScaling = value @property def maximumWordScaling ( self ): return self . app . maximumWordScaling @maximumWordScaling . setter def maximumWordScaling ( self , value ): self . app . maximumWordScaling = value @property def minimumGlyphScaling ( self ): \"\"\"The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required. \"\"\" return self . app . minimumGlyphScaling @minimumGlyphScaling . setter def minimumGlyphScaling ( self , value ): self . app . minimumGlyphScaling = value @property def minimumLetterScaling ( self ): \"\"\"The minimum amount of space to allow between letters (a percentage value; at 0, no space is removed between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required. \"\"\" return self . app . minimumLetterScaling @minimumLetterScaling . setter def minimumLetterScaling ( self , value ): self . app . minimumLetterScaling = value @property def minimumWordScaling ( self ): \"\"\"The minimum amount of space to allow between words (a percentage value; at 100, no additional space is removed between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required. \"\"\" return self . app . minimumWordScaling @minimumWordScaling . setter def minimumWordScaling ( self , value ): self . app . minimumWordScaling = value @property def noBreak ( self ): \"\"\"True to disallow line breaks in this text. Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen. \"\"\" return self . app . noBreak @noBreak . setter def noBreak ( self , value ): self . app . noBreak = value @property def oldStyle ( self ): return self . app . oldStyle @oldStyle . setter def oldStyle ( self , value ): self . app . oldStyle = value @property def parent ( self ): return self . app . parent @parent . setter def parent ( self , value ): self . app . parent = value @property def position ( self ): return self . app . position @position . setter def position ( self , array ): \"\"\"The position of the origin for the text. The array must contain two values. Setting this property is basically equivalent to clicking the text tool at a point in the documents to create the point of origin for text. \"\"\" self . app . position = array @property def rightIndent ( self ): return self . app . rightIndent @rightIndent . setter def rightIndent ( self , value ): self . app . rightIndent = value @property def size ( self ): \"\"\"The font size in UnitValue. NOTE: Type was points for CS3 and older. \"\"\" return self . app . size @size . setter def size ( self , value ): self . app . size = value @property def spaceAfter ( self ): \"\"\"The amount of space to use after each paragraph.\"\"\" return self . app . spaceAfter @spaceAfter . setter def spaceAfter ( self , value ): self . app . spaceAfter = value @property def spaceBefore ( self ): return self . app . spaceBefore @spaceBefore . setter def spaceBefore ( self , value ): self . app . spaceBefore = value @property def strikeThru ( self ): \"\"\"The text strike-through option to use.\"\"\" return StrikeThruType ( self . app . strikeThru ) @strikeThru . setter def strikeThru ( self , value ): self . app . strikeThru = value @property def textComposer ( self ): return TextComposer ( self . app . textComposer ) @textComposer . setter def textComposer ( self , value ): self . app . textComposer = value @property def tracking ( self ): return self . app . tracking @tracking . setter def tracking ( self , value ): self . app . tracking = value @property def underline ( self ): \"\"\"The text underlining options.\"\"\" return self . app . underline @underline . setter def underline ( self , value ): self . app . underline = value @property def useAutoLeading ( self ): return self . app . useAutoLeading @useAutoLeading . setter def useAutoLeading ( self , value ): self . app . useAutoLeading = value @property def verticalScale ( self ): return self . app . verticalScale @verticalScale . setter def verticalScale ( self , value ): self . app . verticalScale = value @property def warpBend ( self ): \"\"\"The warp bend percentage.\"\"\" return self . app . warpBend @warpBend . setter def warpBend ( self , value ): self . app . warpBend = value @property def warpDirection ( self ) -> Direction : \"\"\"The warp direction.\"\"\" return Direction ( self . app . warpDirection ) @warpDirection . setter def warpDirection ( self , value ): self . app . warpDirection = value @property def warpHorizontalDistortion ( self ): return self . app . warpHorizontalDistortion @warpHorizontalDistortion . setter def warpHorizontalDistortion ( self , value ): self . app . warpHorizontalDistortion = value @property def warpStyle ( self ): \"\"\"The style of warp to use.\"\"\" return self . app . warpStyle @warpStyle . setter def warpStyle ( self , value ): self . app . warpStyle = value @property def warpVerticalDistortion ( self ): return self . app . warpVerticalDistortion @warpVerticalDistortion . setter def warpVerticalDistortion ( self , value ): self . app . warpVerticalDistortion = value @property def width ( self ): \"\"\"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. \"\"\" return self . app . width @width . setter def width ( self , value : float ): \"\"\"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT. \"\"\" self . app . width = value def convertToShape ( self ): \"\"\"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.\"\"\" return self . app . convertToShape () def createPath ( self ): \"\"\"Creates a clipping path from the outlines of the actual text items (such as letters or words). \"\"\" return self . app . createPath ()","title":"TextItem"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.antiAliasMethod","text":"The method of anti aliasing to use.","title":"antiAliasMethod"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.autoKerning","text":"The auto kerning option to use.","title":"autoKerning"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.baselineShift","text":"The unit value to use in the baseline offset of text.","title":"baselineShift"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.capitalization","text":"Gets text case.","title":"capitalization"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.color","text":"The text color.","title":"color"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.contents","text":"The actual text in the layer.","title":"contents"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.desiredGlyphScaling","text":"The desired amount by which to scale the horizontal size of the text letters. A percentage value; at 100, the width of characters is not scaled.","title":"desiredGlyphScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.desiredLetterScaling","text":"The amount of space between letters . (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and maximumLetterScaling values are also required.","title":"desiredLetterScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.desiredWordScaling","text":"The amount (percentage) of space between words (at 100, no additional space is added between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumWordScaling and maximumWordScaling values are also required","title":"desiredWordScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.direction","text":"The text orientation.","title":"direction"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.fauxBold","text":"True to use faux bold (default: false). Setting this to true is equivalent to selecting text and clicking Faux Bold in the Character palette.","title":"fauxBold"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.fauxItalic","text":"True to use faux italic (default: false). Setting this to true is equivalent to selecting text and clicking Faux Italic in the Character palette.","title":"fauxItalic"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.firstLineIndent","text":"The amount (unit value) to indent the first line of paragraphs.","title":"firstLineIndent"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.font","text":"","title":"font"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hangingPunctuation","text":"","title":"hangingPunctuation"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.height","text":"","title":"height"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.horizontalScale","text":"Character scaling (horizontal) in proportion to verticalScale (a percentage value).","title":"horizontalScale"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenateAfterFirst","text":"The number of letters after which hyphenation in word wrap is allowed.","title":"hyphenateAfterFirst"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenateBeforeLast","text":"The number of letters before which hyphenation in word wrap is allowed.","title":"hyphenateBeforeLast"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenateCapitalWords","text":"True to allow hyphenation in word wrap of capitalized words","title":"hyphenateCapitalWords"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenateWordsLongerThan","text":"The minimum number of letters a word must have in order for hyphenation in word wrap to be allowed.","title":"hyphenateWordsLongerThan"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenation","text":"True to use hyphenation in word wrap.","title":"hyphenation"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.hyphenationZone","text":"The distance at the end of a line that will cause a word to break in unjustified type.","title":"hyphenationZone"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.justification","text":"The paragraph justification.","title":"justification"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.leftIndent","text":"The amoun of space to indent text from the left.","title":"leftIndent"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.ligatures","text":"True to use ligatures.","title":"ligatures"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.maximumGlyphScaling","text":"The maximum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumGlyphScaling and desiredGlyphScaling values are also required.","title":"maximumGlyphScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.maximumLetterScaling","text":"The maximum amount of space to allow between letters (at 0, no space is added between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the minimumLetterScaling and desiredLetterScaling values are also required.","title":"maximumLetterScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.minimumGlyphScaling","text":"The minimum amount to scale the horizontal size of the text letters (a percentage value; at 100, the width of characters is not scaled). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumGlyphScaling and desiredGlyphScaling values are also required.","title":"minimumGlyphScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.minimumLetterScaling","text":"The minimum amount of space to allow between letters (a percentage value; at 0, no space is removed between letters). Equivalent to Letter Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumLetterScaling and desiredLetterScaling values are also required.","title":"minimumLetterScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.minimumWordScaling","text":"The minimum amount of space to allow between words (a percentage value; at 100, no additional space is removed between words). Equivalent to Word Spacing in the Justification dialog (Select Justification on the Paragraphs palette menu). Valid only when justification = Justification.CENTERJUSTIFIED, FULLYJUSTIFIED, LEFTJUSTIFIED, or Justification.RIGHTJUSTIFIED. When used, the maximumWordScaling and desiredWordScaling values are also required.","title":"minimumWordScaling"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.noBreak","text":"True to disallow line breaks in this text. Tip: When true for many consecutive characters, can prevent word wrap and thus may prevent some text from appearing on the screen.","title":"noBreak"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.size","text":"The font size in UnitValue. NOTE: Type was points for CS3 and older.","title":"size"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.spaceAfter","text":"The amount of space to use after each paragraph.","title":"spaceAfter"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.strikeThru","text":"The text strike-through option to use.","title":"strikeThru"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.underline","text":"The text underlining options.","title":"underline"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.warpBend","text":"The warp bend percentage.","title":"warpBend"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.warpDirection","text":"The warp direction.","title":"warpDirection"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.warpStyle","text":"The style of warp to use.","title":"warpStyle"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.width","text":"The width of the bounding box for paragraph text. Valid only when kind = TextType.PARAGRAPHTEXT.","title":"width"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.convertToShape","text":"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path. Source code in photoshop/api/text_item.py 682 683 684 685 def convertToShape ( self ): \"\"\"Converts the text item and its containing layer to a fill layer with the text changed to a clipping path.\"\"\" return self . app . convertToShape ()","title":"convertToShape()"},{"location":"reference/photoshop/api/text_item/#photoshop.api.text_item.TextItem.createPath","text":"Creates a clipping path from the outlines of the actual text items (such as letters or words). Source code in photoshop/api/text_item.py 687 688 689 690 691 692 693 def createPath ( self ): \"\"\"Creates a clipping path from the outlines of the actual text items (such as letters or words). \"\"\" return self . app . createPath ()","title":"createPath()"},{"location":"reference/photoshop/api/colors/cmyk/","text":"Defines a CMYK color, used in the SolidColor object. CMYKColor Bases: Photoshop A CMYK color specification. Source code in photoshop/api/colors/cmyk.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 class CMYKColor ( Photoshop ): \"\"\"A CMYK color specification.\"\"\" object_name = \"CMYKColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def black ( self ) -> int : \"\"\"The black color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . black ) @black . setter def black ( self , value : int ): self . app . black = value @property def cyan ( self ) -> int : \"\"\"The cyan color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . cyan ) @cyan . setter def cyan ( self , value : int ): self . app . cyan = value @property def magenta ( self ) -> int : \"\"\"The magenta color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . magenta ) @magenta . setter def magenta ( self , value : int ): self . app . magenta = value @property def yellow ( self ) -> int : \"\"\"The yellow color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . yellow ) @yellow . setter def yellow ( self , value : int ): self . app . yellow = value black : int property writable The black color value. Range: 0.0 to 100.0. cyan : int property writable The cyan color value. Range: 0.0 to 100.0. magenta : int property writable The magenta color value. Range: 0.0 to 100.0. yellow : int property writable The yellow color value. Range: 0.0 to 100.0.","title":"cmyk"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor","text":"Bases: Photoshop A CMYK color specification. Source code in photoshop/api/colors/cmyk.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 class CMYKColor ( Photoshop ): \"\"\"A CMYK color specification.\"\"\" object_name = \"CMYKColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def black ( self ) -> int : \"\"\"The black color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . black ) @black . setter def black ( self , value : int ): self . app . black = value @property def cyan ( self ) -> int : \"\"\"The cyan color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . cyan ) @cyan . setter def cyan ( self , value : int ): self . app . cyan = value @property def magenta ( self ) -> int : \"\"\"The magenta color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . magenta ) @magenta . setter def magenta ( self , value : int ): self . app . magenta = value @property def yellow ( self ) -> int : \"\"\"The yellow color value. Range: 0.0 to 100.0.\"\"\" return round ( self . app . yellow ) @yellow . setter def yellow ( self , value : int ): self . app . yellow = value","title":"CMYKColor"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor.black","text":"The black color value. Range: 0.0 to 100.0.","title":"black"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor.cyan","text":"The cyan color value. Range: 0.0 to 100.0.","title":"cyan"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor.magenta","text":"The magenta color value. Range: 0.0 to 100.0.","title":"magenta"},{"location":"reference/photoshop/api/colors/cmyk/#photoshop.api.colors.cmyk.CMYKColor.yellow","text":"The yellow color value. Range: 0.0 to 100.0.","title":"yellow"},{"location":"reference/photoshop/api/colors/gray/","text":"Defines a gray color, used in the SolidColor object. GrayColor Bases: Photoshop Options for defining a gray color. Source code in photoshop/api/colors/gray.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 class GrayColor ( Photoshop ): \"\"\"Options for defining a gray color.\"\"\" object_name = \"GrayColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def gray ( self ) -> float : \"\"\"The gray value.\"\"\" return self . app . gray @gray . setter def gray ( self , value : float ): \"\"\"The gray value.\"\"\" self . app . gray = value gray : float property writable The gray value.","title":"gray"},{"location":"reference/photoshop/api/colors/gray/#photoshop.api.colors.gray.GrayColor","text":"Bases: Photoshop Options for defining a gray color. Source code in photoshop/api/colors/gray.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 class GrayColor ( Photoshop ): \"\"\"Options for defining a gray color.\"\"\" object_name = \"GrayColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def gray ( self ) -> float : \"\"\"The gray value.\"\"\" return self . app . gray @gray . setter def gray ( self , value : float ): \"\"\"The gray value.\"\"\" self . app . gray = value","title":"GrayColor"},{"location":"reference/photoshop/api/colors/gray/#photoshop.api.colors.gray.GrayColor.gray","text":"The gray value.","title":"gray"},{"location":"reference/photoshop/api/colors/hsb/","text":"Defines an HSB color, used in the SolidColor object. HSBColor Bases: Photoshop An HSB color specification. Source code in photoshop/api/colors/hsb.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 class HSBColor ( Photoshop ): \"\"\"An HSB color specification.\"\"\" object_name = \"HSBColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def brightness ( self ): return round ( self . app . brightness ) @brightness . setter def brightness ( self , value ): self . app . brightness = value @property def saturation ( self ): return round ( self . app . saturation ) @saturation . setter def saturation ( self , value ): self . app . saturation = value @property def hue ( self ): \"\"\"The hue value. Range: 0.0 to 360.0.\"\"\" return round ( self . app . hue ) @hue . setter def hue ( self , value ): self . app . hue = value hue property writable The hue value. Range: 0.0 to 360.0.","title":"hsb"},{"location":"reference/photoshop/api/colors/hsb/#photoshop.api.colors.hsb.HSBColor","text":"Bases: Photoshop An HSB color specification. Source code in photoshop/api/colors/hsb.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 class HSBColor ( Photoshop ): \"\"\"An HSB color specification.\"\"\" object_name = \"HSBColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def brightness ( self ): return round ( self . app . brightness ) @brightness . setter def brightness ( self , value ): self . app . brightness = value @property def saturation ( self ): return round ( self . app . saturation ) @saturation . setter def saturation ( self , value ): self . app . saturation = value @property def hue ( self ): \"\"\"The hue value. Range: 0.0 to 360.0.\"\"\" return round ( self . app . hue ) @hue . setter def hue ( self , value ): self . app . hue = value","title":"HSBColor"},{"location":"reference/photoshop/api/colors/hsb/#photoshop.api.colors.hsb.HSBColor.hue","text":"The hue value. Range: 0.0 to 360.0.","title":"hue"},{"location":"reference/photoshop/api/colors/lab/","text":"LabColor Bases: Photoshop A Lab color specification. Source code in photoshop/api/colors/lab.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 class LabColor ( Photoshop ): \"\"\"A Lab color specification.\"\"\" object_name = \"LabColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def A ( self ): return round ( self . app . A ) @A . setter def A ( self , value ): self . app . A = value @property def B ( self ): return round ( self . app . B ) @B . setter def B ( self , value ): self . app . B = value @property def L ( self ): return round ( self . app . L ) @L . setter def L ( self , value ): self . app . L = value","title":"lab"},{"location":"reference/photoshop/api/colors/lab/#photoshop.api.colors.lab.LabColor","text":"Bases: Photoshop A Lab color specification. Source code in photoshop/api/colors/lab.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 class LabColor ( Photoshop ): \"\"\"A Lab color specification.\"\"\" object_name = \"LabColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) @property def A ( self ): return round ( self . app . A ) @A . setter def A ( self , value ): self . app . A = value @property def B ( self ): return round ( self . app . B ) @B . setter def B ( self , value ): self . app . B = value @property def L ( self ): return round ( self . app . L ) @L . setter def L ( self , value ): self . app . L = value","title":"LabColor"},{"location":"reference/photoshop/api/colors/rgb/","text":"RGBColor Bases: Photoshop The definition of an RGB color mode. Source code in photoshop/api/colors/rgb.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 class RGBColor ( Photoshop ): \"\"\"The definition of an RGB color mode.\"\"\" object_name = \"RGBColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . blue = self . app . blue self . green = self . app . green self . red = self . app . red @property def blue ( self ) -> int : return round ( self . app . blue ) @blue . setter def blue ( self , value : int ): self . app . blue = value @property def green ( self ) -> int : return round ( self . app . green ) @green . setter def green ( self , value : int ): self . app . green = value @property def red ( self ) -> int : return round ( self . app . red ) @red . setter def red ( self , value : int ): self . app . red = value @property def hexValue ( self ): return self . app . hexValue @hexValue . setter def hexValue ( self , value ): self . app . hexValue = value def __str__ ( self ): return f \"[red: { self . red } , green: { self . green } , blue: { self . blue } )]\"","title":"rgb"},{"location":"reference/photoshop/api/colors/rgb/#photoshop.api.colors.rgb.RGBColor","text":"Bases: Photoshop The definition of an RGB color mode. Source code in photoshop/api/colors/rgb.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 class RGBColor ( Photoshop ): \"\"\"The definition of an RGB color mode.\"\"\" object_name = \"RGBColor\" def __init__ ( self , parent ): super () . __init__ ( parent = parent ) self . blue = self . app . blue self . green = self . app . green self . red = self . app . red @property def blue ( self ) -> int : return round ( self . app . blue ) @blue . setter def blue ( self , value : int ): self . app . blue = value @property def green ( self ) -> int : return round ( self . app . green ) @green . setter def green ( self , value : int ): self . app . green = value @property def red ( self ) -> int : return round ( self . app . red ) @red . setter def red ( self , value : int ): self . app . red = value @property def hexValue ( self ): return self . app . hexValue @hexValue . setter def hexValue ( self , value ): self . app . hexValue = value def __str__ ( self ): return f \"[red: { self . red } , green: { self . green } , blue: { self . blue } )]\"","title":"RGBColor"},{"location":"reference/photoshop/api/open_options/eps/","text":"EPSOpenOptions Bases: Photoshop Options for saving a document in EPS format. using the Document.saveAs() Source code in photoshop/api/open_options/eps.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 class EPSOpenOptions ( Photoshop ): \"\"\"Options for saving a document in EPS format. using the `Document.saveAs()` \"\"\" object_name = \"EPSOpenOptions\" def __init__ ( self ): super () . __init__ () @property def antiAlias ( self ): return self . app . antiAlias @property def constrainProportions ( self ): return self . app . constrainProportions @property def height ( self ): return self . app . height @property def mode ( self ): return self . app . mode @property def resolution ( self ): return self . app . resolution @property def width ( self ): return self . app . width @property def embedColorProfile ( self ): return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , boolean ): self . app . embedColorProfile = boolean","title":"eps"},{"location":"reference/photoshop/api/open_options/eps/#photoshop.api.open_options.eps.EPSOpenOptions","text":"Bases: Photoshop Options for saving a document in EPS format. using the Document.saveAs() Source code in photoshop/api/open_options/eps.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 class EPSOpenOptions ( Photoshop ): \"\"\"Options for saving a document in EPS format. using the `Document.saveAs()` \"\"\" object_name = \"EPSOpenOptions\" def __init__ ( self ): super () . __init__ () @property def antiAlias ( self ): return self . app . antiAlias @property def constrainProportions ( self ): return self . app . constrainProportions @property def height ( self ): return self . app . height @property def mode ( self ): return self . app . mode @property def resolution ( self ): return self . app . resolution @property def width ( self ): return self . app . width @property def embedColorProfile ( self ): return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , boolean ): self . app . embedColorProfile = boolean","title":"EPSOpenOptions"},{"location":"reference/photoshop/api/save_options/bmp/","text":"Options for saving a document in BMO format. BMPSaveOptions Bases: Photoshop Options for saving a document in BMP format. Source code in photoshop/api/save_options/bmp.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 class BMPSaveOptions ( Photoshop ): \"\"\"Options for saving a document in BMP format.\"\"\" object_name = \"BMPSaveOptions\" def __init__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"State to save the alpha channels.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): \"\"\"Sets whether to save the alpha channels or not. Args: \"\"\" self . app . alphaChannels = value alphaChannels property writable State to save the alpha channels.","title":"bmp"},{"location":"reference/photoshop/api/save_options/bmp/#photoshop.api.save_options.bmp.BMPSaveOptions","text":"Bases: Photoshop Options for saving a document in BMP format. Source code in photoshop/api/save_options/bmp.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 class BMPSaveOptions ( Photoshop ): \"\"\"Options for saving a document in BMP format.\"\"\" object_name = \"BMPSaveOptions\" def __init__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"State to save the alpha channels.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): \"\"\"Sets whether to save the alpha channels or not. Args: \"\"\" self . app . alphaChannels = value","title":"BMPSaveOptions"},{"location":"reference/photoshop/api/save_options/bmp/#photoshop.api.save_options.bmp.BMPSaveOptions.alphaChannels","text":"State to save the alpha channels.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/eps/","text":"EPSSaveOptions Bases: Photoshop Options for saving a document in EPS format. using the Document.saveAs() Source code in photoshop/api/save_options/eps.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 class EPSSaveOptions ( Photoshop ): \"\"\"Options for saving a document in EPS format. using the `Document.saveAs()` \"\"\" object_name = \"EPSSaveOptions\" def __init__ ( self ): super () . __init__ () @property def embedColorProfile ( self ) -> bool : \"\"\"True to embed the color profile in this document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , boolean : bool ): \"\"\"True to embed the color profile in this document.\"\"\" self . app . embedColorProfile = boolean @property def encoding ( self ): return self . app . encoding @encoding . setter def encoding ( self , value : bool ): self . app . encoding = value @property def halftoneScreen ( self ): return self . app . halftoneScreen @halftoneScreen . setter def halftoneScreen ( self , value : bool ): self . app . halftoneScreen = value @property def interpolation ( self ): return self . app . interpolation @interpolation . setter def interpolation ( self , value : bool ): self . app . interpolation = value @property def preview ( self ): return self . app . preview @preview . setter def preview ( self , value : bool ): self . app . preview = value @property def psColorManagement ( self ): return self . app . psColorManagement @psColorManagement . setter def psColorManagement ( self , value : bool ): self . app . psColorManagement = value @property def transferFunction ( self ): return self . app . transferFunction @transferFunction . setter def transferFunction ( self , value : bool ): self . app . transferFunction = value @property def transparentWhites ( self ) -> bool : \"\"\"True to display white areas as transparent\"\"\" return self . app . transparentWhites @transparentWhites . setter def transparentWhites ( self , value : bool ): \"\"\"True to display white areas as transparent\"\"\" self . app . transparentWhites = value @property def vectorData ( self ): \"\"\"True to include vector data.\"\"\" return self . app . vectorData @vectorData . setter def vectorData ( self , value : bool ): \"\"\"True to include vector data. Valid only if the document includes vector data (text). \"\"\" self . app . vectorData = value embedColorProfile : bool property writable True to embed the color profile in this document. transparentWhites : bool property writable True to display white areas as transparent vectorData property writable True to include vector data.","title":"eps"},{"location":"reference/photoshop/api/save_options/eps/#photoshop.api.save_options.eps.EPSSaveOptions","text":"Bases: Photoshop Options for saving a document in EPS format. using the Document.saveAs() Source code in photoshop/api/save_options/eps.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 class EPSSaveOptions ( Photoshop ): \"\"\"Options for saving a document in EPS format. using the `Document.saveAs()` \"\"\" object_name = \"EPSSaveOptions\" def __init__ ( self ): super () . __init__ () @property def embedColorProfile ( self ) -> bool : \"\"\"True to embed the color profile in this document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , boolean : bool ): \"\"\"True to embed the color profile in this document.\"\"\" self . app . embedColorProfile = boolean @property def encoding ( self ): return self . app . encoding @encoding . setter def encoding ( self , value : bool ): self . app . encoding = value @property def halftoneScreen ( self ): return self . app . halftoneScreen @halftoneScreen . setter def halftoneScreen ( self , value : bool ): self . app . halftoneScreen = value @property def interpolation ( self ): return self . app . interpolation @interpolation . setter def interpolation ( self , value : bool ): self . app . interpolation = value @property def preview ( self ): return self . app . preview @preview . setter def preview ( self , value : bool ): self . app . preview = value @property def psColorManagement ( self ): return self . app . psColorManagement @psColorManagement . setter def psColorManagement ( self , value : bool ): self . app . psColorManagement = value @property def transferFunction ( self ): return self . app . transferFunction @transferFunction . setter def transferFunction ( self , value : bool ): self . app . transferFunction = value @property def transparentWhites ( self ) -> bool : \"\"\"True to display white areas as transparent\"\"\" return self . app . transparentWhites @transparentWhites . setter def transparentWhites ( self , value : bool ): \"\"\"True to display white areas as transparent\"\"\" self . app . transparentWhites = value @property def vectorData ( self ): \"\"\"True to include vector data.\"\"\" return self . app . vectorData @vectorData . setter def vectorData ( self , value : bool ): \"\"\"True to include vector data. Valid only if the document includes vector data (text). \"\"\" self . app . vectorData = value","title":"EPSSaveOptions"},{"location":"reference/photoshop/api/save_options/eps/#photoshop.api.save_options.eps.EPSSaveOptions.embedColorProfile","text":"True to embed the color profile in this document.","title":"embedColorProfile"},{"location":"reference/photoshop/api/save_options/eps/#photoshop.api.save_options.eps.EPSSaveOptions.transparentWhites","text":"True to display white areas as transparent","title":"transparentWhites"},{"location":"reference/photoshop/api/save_options/eps/#photoshop.api.save_options.eps.EPSSaveOptions.vectorData","text":"True to include vector data.","title":"vectorData"},{"location":"reference/photoshop/api/save_options/gif/","text":"GIFSaveOptions Bases: Photoshop Options for saving a document in GIF format. Source code in photoshop/api/save_options/gif.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 class GIFSaveOptions ( Photoshop ): \"\"\"Options for saving a document in GIF format.\"\"\" object_name = \"GIFSaveOptions\" def __init__ ( self ): super () . __init__ () @property def colors ( self ): return self . app . color @colors . setter def colors ( self , value ): self . app . colors = value @property def dither ( self ): return self . app . dither @dither . setter def dither ( self , value ): self . app . dither = value @property def ditherAmount ( self ): return self . app . ditherAmount @ditherAmount . setter def ditherAmount ( self , value ): self . app . ditherAmount = value @property def forced ( self ): return self . app . forced @forced . setter def forced ( self , value ): self . app . forced = value @property def interlaced ( self ): return self . app . interlaced @interlaced . setter def interlaced ( self , value ): self . app . interlaced = value @property def matte ( self ): return self . app . matte @matte . setter def matte ( self , value ): self . app . matte = value @property def palette ( self ): return self . app . palette @palette . setter def palette ( self , value ): self . app . palette = value @property def preserveExactColors ( self ): return self . app . preserveExactColors @preserveExactColors . setter def preserveExactColors ( self , value ): self . app . preserveExactColors = value @property def transparency ( self ): return self . app . transparency @transparency . setter def transparency ( self , value ): self . app . transparency = value","title":"gif"},{"location":"reference/photoshop/api/save_options/gif/#photoshop.api.save_options.gif.GIFSaveOptions","text":"Bases: Photoshop Options for saving a document in GIF format. Source code in photoshop/api/save_options/gif.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 class GIFSaveOptions ( Photoshop ): \"\"\"Options for saving a document in GIF format.\"\"\" object_name = \"GIFSaveOptions\" def __init__ ( self ): super () . __init__ () @property def colors ( self ): return self . app . color @colors . setter def colors ( self , value ): self . app . colors = value @property def dither ( self ): return self . app . dither @dither . setter def dither ( self , value ): self . app . dither = value @property def ditherAmount ( self ): return self . app . ditherAmount @ditherAmount . setter def ditherAmount ( self , value ): self . app . ditherAmount = value @property def forced ( self ): return self . app . forced @forced . setter def forced ( self , value ): self . app . forced = value @property def interlaced ( self ): return self . app . interlaced @interlaced . setter def interlaced ( self , value ): self . app . interlaced = value @property def matte ( self ): return self . app . matte @matte . setter def matte ( self , value ): self . app . matte = value @property def palette ( self ): return self . app . palette @palette . setter def palette ( self , value ): self . app . palette = value @property def preserveExactColors ( self ): return self . app . preserveExactColors @preserveExactColors . setter def preserveExactColors ( self , value ): self . app . preserveExactColors = value @property def transparency ( self ): return self . app . transparency @transparency . setter def transparency ( self , value ): self . app . transparency = value","title":"GIFSaveOptions"},{"location":"reference/photoshop/api/save_options/jpg/","text":"JPEGSaveOptions Bases: Photoshop Options for saving a document in JPEG format. Source code in photoshop/api/save_options/jpg.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 class JPEGSaveOptions ( Photoshop ): \"\"\"Options for saving a document in JPEG format.\"\"\" object_name = \"JPEGSaveOptions\" def __init__ ( self , quality = 5 , embedColorProfile = True , matte = MatteType . NoMatte ): super () . __init__ () self . quality = quality self . embedColorProfile = embedColorProfile self . matte = matte @property def quality ( self ): return self . app . quality @quality . setter def quality ( self , value ): self . app . quality = value @property def formatOptions ( self ): \"\"\"The download format to use.\"\"\" return self . app . formatOptions @formatOptions . setter def formatOptions ( self , value ): self . app . formatOptions = value @property def embedColorProfile ( self ): return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def matte ( self ): \"\"\"The color to use to fill anti-aliased edges adjacent to transparent\"\"\" return self . app . matte @matte . setter def matte ( self , value ): self . app . matte = value @property def scans ( self ): return self . app . scans @scans . setter def scans ( self , value ): self . app . scans = value formatOptions property writable The download format to use. matte property writable The color to use to fill anti-aliased edges adjacent to transparent","title":"jpg"},{"location":"reference/photoshop/api/save_options/jpg/#photoshop.api.save_options.jpg.JPEGSaveOptions","text":"Bases: Photoshop Options for saving a document in JPEG format. Source code in photoshop/api/save_options/jpg.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 class JPEGSaveOptions ( Photoshop ): \"\"\"Options for saving a document in JPEG format.\"\"\" object_name = \"JPEGSaveOptions\" def __init__ ( self , quality = 5 , embedColorProfile = True , matte = MatteType . NoMatte ): super () . __init__ () self . quality = quality self . embedColorProfile = embedColorProfile self . matte = matte @property def quality ( self ): return self . app . quality @quality . setter def quality ( self , value ): self . app . quality = value @property def formatOptions ( self ): \"\"\"The download format to use.\"\"\" return self . app . formatOptions @formatOptions . setter def formatOptions ( self , value ): self . app . formatOptions = value @property def embedColorProfile ( self ): return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def matte ( self ): \"\"\"The color to use to fill anti-aliased edges adjacent to transparent\"\"\" return self . app . matte @matte . setter def matte ( self , value ): self . app . matte = value @property def scans ( self ): return self . app . scans @scans . setter def scans ( self , value ): self . app . scans = value","title":"JPEGSaveOptions"},{"location":"reference/photoshop/api/save_options/jpg/#photoshop.api.save_options.jpg.JPEGSaveOptions.formatOptions","text":"The download format to use.","title":"formatOptions"},{"location":"reference/photoshop/api/save_options/jpg/#photoshop.api.save_options.jpg.JPEGSaveOptions.matte","text":"The color to use to fill anti-aliased edges adjacent to transparent","title":"matte"},{"location":"reference/photoshop/api/save_options/pdf/","text":"Options for saving a document in Adobe PDF format. using the Document.saveAs() method. PDFSaveOptions Bases: Photoshop Options for saving a document in PDF format. Source code in photoshop/api/save_options/pdf.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 class PDFSaveOptions ( Photoshop ): \"\"\"Options for saving a document in PDF format.\"\"\" object_name = \"PDFSaveOptions\" def __init__ ( self , ** kwargs ): super () . __init__ () self . layers = False self . jpegQuality = 12 self . alphaChannels = False self . embedThumbnail = True self . view = False self . annotations = True self . colorConversion = False self . convertToEightBit = True self . description = \"No description.\" self . encoding_types = PDFEncodingType self . downSample = PDFResampleType . NoResample self . embedColorProfile = True if kwargs : if \"encoding\" in kwargs : self . encoding = kwargs . get ( \"encoding\" , self . encoding_types . PDFJPEG ) for key , value in kwargs . items (): setattr ( self , key , value ) @property def alphaChannels ( self ): \"\"\"True to save the alpha channels with the file.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): \"\"\"True to save the alpha channels with the file.\"\"\" self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . anotations @annotations . setter def annotations ( self , value ): \"\"\"If true, the annotations are saved.\"\"\" self . app . annotations = value @property def colorConversion ( self ): \"\"\"If true, converts the color profile to the destination profile.\"\"\" return self . app . colorConversion @colorConversion . setter def colorConversion ( self , value ): \"\"\"If true, converts the color profile to the destination profile.\"\"\" self . app . colorConversion = value @property def convertToEightBit ( self ): \"\"\"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.\"\"\" return self . app . convertToEightBit @convertToEightBit . setter def convertToEightBit ( self , value ): \"\"\"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.\"\"\" self . app . convertToEightBit = value @property def description ( self ): \"\"\"Description of the save options in use.\"\"\" return self . app . description @description . setter def description ( self , text ): \"\"\"Description of the save options in use.\"\"\" self . app . description = text @property def destinationProfile ( self ): \"\"\"Describes the final RGB or CMYK output device, such as a monitor or press standard.\"\"\" try : return self . app . destinationProfile except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @destinationProfile . setter def destinationProfile ( self , value ): \"\"\"Describes the final RGB or CMYK output device, such as a monitor or press standard.\"\"\" self . app . destinationProfile = value @property def downSample ( self ): \"\"\"The downsample method to use.\"\"\" return self . app . downSample @downSample . setter def downSample ( self , value ): \"\"\"The downsample method to use.\"\"\" self . app . downSample = value @property def downSampleSize ( self ): \"\"\"The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit.\"\"\" try : return self . app . downSampleSize except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @downSampleSize . setter def downSampleSize ( self , value ): \"\"\"The size (in pixels per inch) to downsample images to if they exceed the value specified for \u2018down sample size limit\u2019.\"\"\" self . app . downSampleSize = value @property def downSampleSizeLimit ( self ): \"\"\"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).\"\"\" try : return self . app . downSampleSizeLimit except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @downSampleSizeLimit . setter def downSampleSizeLimit ( self , value : float ): \"\"\"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).\"\"\" self . app . downSampleSizeLimit = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value : bool ): \"\"\"If true, the color profile is embedded in the document.\"\"\" self . app . embedColorProfile = value @property def embedThumbnail ( self ): \"\"\"If true, includes a small preview image in Acrobat.\"\"\" return self . app . embedThumbnail @embedThumbnail . setter def embedThumbnail ( self , value : bool ): \"\"\"If true, includes a small preview image in Acrobat.\"\"\" self . app . embedThumbnail = value @property def encoding ( self ): \"\"\"The encoding method to use.\"\"\" try : return self . app . encoding except COMError : return self . encoding_types . PDFJPEG @encoding . setter def encoding ( self , value : str ): \"\"\"The encoding method to use.\"\"\" self . app . encoding = value @property def jpegQuality ( self ): \"\"\"Get the quality of the produced image.\"\"\" return self . app . jpegQuality @jpegQuality . setter def jpegQuality ( self , quality : int ): \"\"\"Set the quality of the produced image. Valid only for JPEG-encoded PDF documents. Range: 0 to 12. \"\"\" self . app . jpegQuality = quality @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers @layers . setter def layers ( self , value : bool ): \"\"\"If true, the layers are saved.\"\"\" self . app . layers = value @property def optimizeForWeb ( self ): \"\"\"If true, improves performance of PDFs on Web servers.\"\"\" return self . app . optimizeForWeb @optimizeForWeb . setter def optimizeForWeb ( self , value : bool ): \"\"\"If true, improves performance of PDFs on Web servers.\"\"\" self . app . optimizeForWeb = value @property def outputCondition ( self ): \"\"\"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.\"\"\" return self . app . outputCondition @outputCondition . setter def outputCondition ( self , value ): \"\"\"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.\"\"\" self . app . outputCondition = value @property def outputConditionID ( self ): \"\"\"The identifier for the output condition.\"\"\" try : return self . app . outputConditionID except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @outputConditionID . setter def outputConditionID ( self , value ): \"\"\"The identifier for the output condition.\"\"\" self . app . outputConditionID = value @property def preserveEditing ( self ): \"\"\"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.\"\"\" try : return self . app . preserveEditing except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @preserveEditing . setter def preserveEditing ( self , value ): \"\"\"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.\"\"\" self . app . preserveEditing = value @property def presetFile ( self ): \"\"\"The preset file to use for settings; overrides other settings.\"\"\" try : return self . app . presetFile except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @presetFile . setter def presetFile ( self , file_name ): \"\"\"The preset file to use for settings; overrides other settings.\"\"\" self . app . presetFile = file_name @property def profileInclusionPolicy ( self ): \"\"\"If true, shows which profiles to include.\"\"\" try : return self . app . profileInclusionPolicy except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @profileInclusionPolicy . setter def profileInclusionPolicy ( self , value ): \"\"\"If true, shows which profiles to include.\"\"\" self . app . profileInclusionPolicy = value @property def registryName ( self ): \"\"\"The URL where the output condition is registered.\"\"\" try : return self . app . registryName except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @registryName . setter def registryName ( self , value ): \"\"\"The URL where the output condition is registered.\"\"\" self . app . registryName = value @property def spotColors ( self ): \"\"\"If true, the spot colors are saved.\"\"\" try : return self . app . spotColors except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @spotColors . setter def spotColors ( self , value ): \"\"\"If true, the spot colors are saved.\"\"\" self . app . spotColors = value @property def tileSize ( self ): \"\"\"The compression option. Valid only when encoding is JPEG2000.\"\"\" try : return self . app . tileSize except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @tileSize . setter def tileSize ( self , value ): \"\"\"The compression option. Valid only when encoding is JPEG2000.\"\"\" if self . encoding not in ( self . encoding_types . PDFJPEG2000HIGH , self . encoding_types . PDFJPEG2000LOSSLESS , self . encoding_types . PDFJPEG2000MED , self . encoding_types . PDFJPEG2000MEDLOW , self . encoding_types . PDFJPEG2000LOW , self . encoding_types . PDFJPEG2000MEDHIGH , ): raise ValueError ( \"tileSize only work in JPEG2000. Please \" \"change PDFSaveOptions.encoding to JPEG2000.\" ) self . app . tileSize = value @property def view ( self ): \"\"\"If true, opens the saved PDF in Acrobat.\"\"\" return self . app . view @view . setter def view ( self , value ): \"\"\"If true, opens the saved PDF in Acrobat.\"\"\" self . app . view = value alphaChannels property writable True to save the alpha channels with the file. annotations property writable If true, the annotations are saved. colorConversion property writable If true, converts the color profile to the destination profile. convertToEightBit property writable If true, converts a 16-bit image to 8-bit for better compatibility with other applications. description property writable Description of the save options in use. destinationProfile property writable Describes the final RGB or CMYK output device, such as a monitor or press standard. downSample property writable The downsample method to use. downSampleSize property writable The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit. downSampleSizeLimit property writable Limits downsampling or subsampling to images that exceed this value (in pixels per inch). embedColorProfile property writable If true, the color profile is embedded in the document. embedThumbnail property writable If true, includes a small preview image in Acrobat. encoding property writable The encoding method to use. jpegQuality property writable Get the quality of the produced image. layers property writable If true, the layers are saved. optimizeForWeb property writable If true, improves performance of PDFs on Web servers. outputCondition property writable An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file. outputConditionID property writable The identifier for the output condition. preserveEditing property writable If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact. presetFile property writable The preset file to use for settings; overrides other settings. profileInclusionPolicy property writable If true, shows which profiles to include. registryName property writable The URL where the output condition is registered. spotColors property writable If true, the spot colors are saved. tileSize property writable The compression option. Valid only when encoding is JPEG2000. view property writable If true, opens the saved PDF in Acrobat.","title":"pdf"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions","text":"Bases: Photoshop Options for saving a document in PDF format. Source code in photoshop/api/save_options/pdf.py 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 class PDFSaveOptions ( Photoshop ): \"\"\"Options for saving a document in PDF format.\"\"\" object_name = \"PDFSaveOptions\" def __init__ ( self , ** kwargs ): super () . __init__ () self . layers = False self . jpegQuality = 12 self . alphaChannels = False self . embedThumbnail = True self . view = False self . annotations = True self . colorConversion = False self . convertToEightBit = True self . description = \"No description.\" self . encoding_types = PDFEncodingType self . downSample = PDFResampleType . NoResample self . embedColorProfile = True if kwargs : if \"encoding\" in kwargs : self . encoding = kwargs . get ( \"encoding\" , self . encoding_types . PDFJPEG ) for key , value in kwargs . items (): setattr ( self , key , value ) @property def alphaChannels ( self ): \"\"\"True to save the alpha channels with the file.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): \"\"\"True to save the alpha channels with the file.\"\"\" self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . anotations @annotations . setter def annotations ( self , value ): \"\"\"If true, the annotations are saved.\"\"\" self . app . annotations = value @property def colorConversion ( self ): \"\"\"If true, converts the color profile to the destination profile.\"\"\" return self . app . colorConversion @colorConversion . setter def colorConversion ( self , value ): \"\"\"If true, converts the color profile to the destination profile.\"\"\" self . app . colorConversion = value @property def convertToEightBit ( self ): \"\"\"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.\"\"\" return self . app . convertToEightBit @convertToEightBit . setter def convertToEightBit ( self , value ): \"\"\"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.\"\"\" self . app . convertToEightBit = value @property def description ( self ): \"\"\"Description of the save options in use.\"\"\" return self . app . description @description . setter def description ( self , text ): \"\"\"Description of the save options in use.\"\"\" self . app . description = text @property def destinationProfile ( self ): \"\"\"Describes the final RGB or CMYK output device, such as a monitor or press standard.\"\"\" try : return self . app . destinationProfile except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @destinationProfile . setter def destinationProfile ( self , value ): \"\"\"Describes the final RGB or CMYK output device, such as a monitor or press standard.\"\"\" self . app . destinationProfile = value @property def downSample ( self ): \"\"\"The downsample method to use.\"\"\" return self . app . downSample @downSample . setter def downSample ( self , value ): \"\"\"The downsample method to use.\"\"\" self . app . downSample = value @property def downSampleSize ( self ): \"\"\"The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit.\"\"\" try : return self . app . downSampleSize except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @downSampleSize . setter def downSampleSize ( self , value ): \"\"\"The size (in pixels per inch) to downsample images to if they exceed the value specified for \u2018down sample size limit\u2019.\"\"\" self . app . downSampleSize = value @property def downSampleSizeLimit ( self ): \"\"\"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).\"\"\" try : return self . app . downSampleSizeLimit except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @downSampleSizeLimit . setter def downSampleSizeLimit ( self , value : float ): \"\"\"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).\"\"\" self . app . downSampleSizeLimit = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value : bool ): \"\"\"If true, the color profile is embedded in the document.\"\"\" self . app . embedColorProfile = value @property def embedThumbnail ( self ): \"\"\"If true, includes a small preview image in Acrobat.\"\"\" return self . app . embedThumbnail @embedThumbnail . setter def embedThumbnail ( self , value : bool ): \"\"\"If true, includes a small preview image in Acrobat.\"\"\" self . app . embedThumbnail = value @property def encoding ( self ): \"\"\"The encoding method to use.\"\"\" try : return self . app . encoding except COMError : return self . encoding_types . PDFJPEG @encoding . setter def encoding ( self , value : str ): \"\"\"The encoding method to use.\"\"\" self . app . encoding = value @property def jpegQuality ( self ): \"\"\"Get the quality of the produced image.\"\"\" return self . app . jpegQuality @jpegQuality . setter def jpegQuality ( self , quality : int ): \"\"\"Set the quality of the produced image. Valid only for JPEG-encoded PDF documents. Range: 0 to 12. \"\"\" self . app . jpegQuality = quality @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers @layers . setter def layers ( self , value : bool ): \"\"\"If true, the layers are saved.\"\"\" self . app . layers = value @property def optimizeForWeb ( self ): \"\"\"If true, improves performance of PDFs on Web servers.\"\"\" return self . app . optimizeForWeb @optimizeForWeb . setter def optimizeForWeb ( self , value : bool ): \"\"\"If true, improves performance of PDFs on Web servers.\"\"\" self . app . optimizeForWeb = value @property def outputCondition ( self ): \"\"\"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.\"\"\" return self . app . outputCondition @outputCondition . setter def outputCondition ( self , value ): \"\"\"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.\"\"\" self . app . outputCondition = value @property def outputConditionID ( self ): \"\"\"The identifier for the output condition.\"\"\" try : return self . app . outputConditionID except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @outputConditionID . setter def outputConditionID ( self , value ): \"\"\"The identifier for the output condition.\"\"\" self . app . outputConditionID = value @property def preserveEditing ( self ): \"\"\"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.\"\"\" try : return self . app . preserveEditing except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @preserveEditing . setter def preserveEditing ( self , value ): \"\"\"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.\"\"\" self . app . preserveEditing = value @property def presetFile ( self ): \"\"\"The preset file to use for settings; overrides other settings.\"\"\" try : return self . app . presetFile except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @presetFile . setter def presetFile ( self , file_name ): \"\"\"The preset file to use for settings; overrides other settings.\"\"\" self . app . presetFile = file_name @property def profileInclusionPolicy ( self ): \"\"\"If true, shows which profiles to include.\"\"\" try : return self . app . profileInclusionPolicy except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @profileInclusionPolicy . setter def profileInclusionPolicy ( self , value ): \"\"\"If true, shows which profiles to include.\"\"\" self . app . profileInclusionPolicy = value @property def registryName ( self ): \"\"\"The URL where the output condition is registered.\"\"\" try : return self . app . registryName except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @registryName . setter def registryName ( self , value ): \"\"\"The URL where the output condition is registered.\"\"\" self . app . registryName = value @property def spotColors ( self ): \"\"\"If true, the spot colors are saved.\"\"\" try : return self . app . spotColors except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @spotColors . setter def spotColors ( self , value ): \"\"\"If true, the spot colors are saved.\"\"\" self . app . spotColors = value @property def tileSize ( self ): \"\"\"The compression option. Valid only when encoding is JPEG2000.\"\"\" try : return self . app . tileSize except COMError : raise ValueError ( \"Should set value first. \" \"This parameter can only be read after the \" \"value has been set.\" ) @tileSize . setter def tileSize ( self , value ): \"\"\"The compression option. Valid only when encoding is JPEG2000.\"\"\" if self . encoding not in ( self . encoding_types . PDFJPEG2000HIGH , self . encoding_types . PDFJPEG2000LOSSLESS , self . encoding_types . PDFJPEG2000MED , self . encoding_types . PDFJPEG2000MEDLOW , self . encoding_types . PDFJPEG2000LOW , self . encoding_types . PDFJPEG2000MEDHIGH , ): raise ValueError ( \"tileSize only work in JPEG2000. Please \" \"change PDFSaveOptions.encoding to JPEG2000.\" ) self . app . tileSize = value @property def view ( self ): \"\"\"If true, opens the saved PDF in Acrobat.\"\"\" return self . app . view @view . setter def view ( self , value ): \"\"\"If true, opens the saved PDF in Acrobat.\"\"\" self . app . view = value","title":"PDFSaveOptions"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.alphaChannels","text":"True to save the alpha channels with the file.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.annotations","text":"If true, the annotations are saved.","title":"annotations"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.colorConversion","text":"If true, converts the color profile to the destination profile.","title":"colorConversion"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.convertToEightBit","text":"If true, converts a 16-bit image to 8-bit for better compatibility with other applications.","title":"convertToEightBit"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.description","text":"Description of the save options in use.","title":"description"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.destinationProfile","text":"Describes the final RGB or CMYK output device, such as a monitor or press standard.","title":"destinationProfile"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.downSample","text":"The downsample method to use.","title":"downSample"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.downSampleSize","text":"The size (in pixels per inch) to downsample images to if they exceed the value specified for down sample size limit.","title":"downSampleSize"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.downSampleSizeLimit","text":"Limits downsampling or subsampling to images that exceed this value (in pixels per inch).","title":"downSampleSizeLimit"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.embedColorProfile","text":"If true, the color profile is embedded in the document.","title":"embedColorProfile"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.embedThumbnail","text":"If true, includes a small preview image in Acrobat.","title":"embedThumbnail"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.encoding","text":"The encoding method to use.","title":"encoding"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.jpegQuality","text":"Get the quality of the produced image.","title":"jpegQuality"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.layers","text":"If true, the layers are saved.","title":"layers"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.optimizeForWeb","text":"If true, improves performance of PDFs on Web servers.","title":"optimizeForWeb"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.outputCondition","text":"An optional comment field for inserting descriptions of the output condition. The text is stored in the PDF/X file.","title":"outputCondition"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.outputConditionID","text":"The identifier for the output condition.","title":"outputConditionID"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.preserveEditing","text":"If true, allows users to reopen the PDF in Photoshop with native Photoshop data intact.","title":"preserveEditing"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.presetFile","text":"The preset file to use for settings; overrides other settings.","title":"presetFile"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.profileInclusionPolicy","text":"If true, shows which profiles to include.","title":"profileInclusionPolicy"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.registryName","text":"The URL where the output condition is registered.","title":"registryName"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.spotColors","text":"If true, the spot colors are saved.","title":"spotColors"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.tileSize","text":"The compression option. Valid only when encoding is JPEG2000.","title":"tileSize"},{"location":"reference/photoshop/api/save_options/pdf/#photoshop.api.save_options.pdf.PDFSaveOptions.view","text":"If true, opens the saved PDF in Acrobat.","title":"view"},{"location":"reference/photoshop/api/save_options/png/","text":"ExportOptionsSaveForWeb Bases: Photoshop Options for exporting Save For Web files. Source code in photoshop/api/save_options/png.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 class ExportOptionsSaveForWeb ( Photoshop ): \"\"\"Options for exporting Save For Web files.\"\"\" object_name = \"ExportOptionsSaveForWeb\" def __init__ ( self ): super () . __init__ () self . format = 13 # PNG self . PNG8 = False # Sets it to PNG-24 bit @property def PNG8 ( self ) -> bool : \"\"\"If true, uses 8 bits. If false, uses 24 bits. Valid only when \u2018format\u2019 = PNG.\"\"\" return self . app . PNG8 @PNG8 . setter def PNG8 ( self , value : bool ): self . app . PNG8 = value @property def blur ( self ) -> float : \"\"\"Applies blur to the image to reduce artifacts.\"\"\" return self . app . blur @blur . setter def blur ( self , value : float ): self . app . blur = value @property def colorReduction ( self ) -> ColorReductionType : \"\"\"The color reduction algorithm.\"\"\" return self . app . colorReduction @colorReduction . setter def colorReduction ( self , value : ColorReductionType ): self . app . colorReduction = value @property def colors ( self ) -> int : \"\"\"The number of colors in the palette.\"\"\" return self . app . colors @colors . setter def colors ( self , value : int ): self . app . colors = value @property def dither ( self ) -> DitherType : \"\"\"The type of dither to use.\"\"\" return self . app . dither @dither . setter def dither ( self , value : DitherType ): self . app . dither = value @property def quality ( self ) -> int : \"\"\"The quality of the output image, from 0 to 100.\"\"\" return self . app . quality @quality . setter def quality ( self , value : int ): self . app . quality = value PNG8 : bool property writable If true, uses 8 bits. If false, uses 24 bits. Valid only when \u2018format\u2019 = PNG. blur : float property writable Applies blur to the image to reduce artifacts. colorReduction : ColorReductionType property writable The color reduction algorithm. colors : int property writable The number of colors in the palette. dither : DitherType property writable The type of dither to use. quality : int property writable The quality of the output image, from 0 to 100. PNGSaveOptions Bases: Photoshop Options for saving file as PNG. Source code in photoshop/api/save_options/png.py 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 class PNGSaveOptions ( Photoshop ): \"\"\"Options for saving file as PNG.\"\"\" object_name = \"PNGSaveOptions\" def __init__ ( self , interlaced : bool = False , compression : int = 6 ): super () . __init__ () self . interlaced = interlaced self . compression = compression @property def interlaced ( self ) -> bool : return self . app . interlaced @interlaced . setter def interlaced ( self , value : bool ): self . app . interlaced = value @property def compression ( self ) -> int : return self . app . compression @compression . setter def compression ( self , value : int ): self . app . compression = value","title":"png"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb","text":"Bases: Photoshop Options for exporting Save For Web files. Source code in photoshop/api/save_options/png.py 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 class ExportOptionsSaveForWeb ( Photoshop ): \"\"\"Options for exporting Save For Web files.\"\"\" object_name = \"ExportOptionsSaveForWeb\" def __init__ ( self ): super () . __init__ () self . format = 13 # PNG self . PNG8 = False # Sets it to PNG-24 bit @property def PNG8 ( self ) -> bool : \"\"\"If true, uses 8 bits. If false, uses 24 bits. Valid only when \u2018format\u2019 = PNG.\"\"\" return self . app . PNG8 @PNG8 . setter def PNG8 ( self , value : bool ): self . app . PNG8 = value @property def blur ( self ) -> float : \"\"\"Applies blur to the image to reduce artifacts.\"\"\" return self . app . blur @blur . setter def blur ( self , value : float ): self . app . blur = value @property def colorReduction ( self ) -> ColorReductionType : \"\"\"The color reduction algorithm.\"\"\" return self . app . colorReduction @colorReduction . setter def colorReduction ( self , value : ColorReductionType ): self . app . colorReduction = value @property def colors ( self ) -> int : \"\"\"The number of colors in the palette.\"\"\" return self . app . colors @colors . setter def colors ( self , value : int ): self . app . colors = value @property def dither ( self ) -> DitherType : \"\"\"The type of dither to use.\"\"\" return self . app . dither @dither . setter def dither ( self , value : DitherType ): self . app . dither = value @property def quality ( self ) -> int : \"\"\"The quality of the output image, from 0 to 100.\"\"\" return self . app . quality @quality . setter def quality ( self , value : int ): self . app . quality = value","title":"ExportOptionsSaveForWeb"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.PNG8","text":"If true, uses 8 bits. If false, uses 24 bits. Valid only when \u2018format\u2019 = PNG.","title":"PNG8"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.blur","text":"Applies blur to the image to reduce artifacts.","title":"blur"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.colorReduction","text":"The color reduction algorithm.","title":"colorReduction"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.colors","text":"The number of colors in the palette.","title":"colors"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.dither","text":"The type of dither to use.","title":"dither"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.ExportOptionsSaveForWeb.quality","text":"The quality of the output image, from 0 to 100.","title":"quality"},{"location":"reference/photoshop/api/save_options/png/#photoshop.api.save_options.png.PNGSaveOptions","text":"Bases: Photoshop Options for saving file as PNG. Source code in photoshop/api/save_options/png.py 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 class PNGSaveOptions ( Photoshop ): \"\"\"Options for saving file as PNG.\"\"\" object_name = \"PNGSaveOptions\" def __init__ ( self , interlaced : bool = False , compression : int = 6 ): super () . __init__ () self . interlaced = interlaced self . compression = compression @property def interlaced ( self ) -> bool : return self . app . interlaced @interlaced . setter def interlaced ( self , value : bool ): self . app . interlaced = value @property def compression ( self ) -> int : return self . app . compression @compression . setter def compression ( self , value : int ): self . app . compression = value","title":"PNGSaveOptions"},{"location":"reference/photoshop/api/save_options/psd/","text":"PhotoshopSaveOptions Bases: Photoshop Options for saving a Photoshop document. Source code in photoshop/api/save_options/psd.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class PhotoshopSaveOptions ( Photoshop ): \"\"\"Options for saving a Photoshop document.\"\"\" object_name = \"PhotoshopSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels () @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . annotations () @annotations . setter def annotations ( self , value ): self . app . annotations = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile () @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers () @layers . setter def layers ( self , value ): self . app . layers = value @property def spotColors ( self ): \"\"\"If true, spot colors are saved.\"\"\" return self . app . spotColors () @spotColors . setter def spotColors ( self , value ): self . app . spotColors = value alphaChannels property writable If true, the alpha channels are saved. annotations property writable If true, the annotations are saved. embedColorProfile property writable If true, the color profile is embedded in the document. layers property writable If true, the layers are saved. spotColors property writable If true, spot colors are saved.","title":"psd"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions","text":"Bases: Photoshop Options for saving a Photoshop document. Source code in photoshop/api/save_options/psd.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 class PhotoshopSaveOptions ( Photoshop ): \"\"\"Options for saving a Photoshop document.\"\"\" object_name = \"PhotoshopSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels () @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . annotations () @annotations . setter def annotations ( self , value ): self . app . annotations = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile () @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers () @layers . setter def layers ( self , value ): self . app . layers = value @property def spotColors ( self ): \"\"\"If true, spot colors are saved.\"\"\" return self . app . spotColors () @spotColors . setter def spotColors ( self , value ): self . app . spotColors = value","title":"PhotoshopSaveOptions"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.alphaChannels","text":"If true, the alpha channels are saved.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.annotations","text":"If true, the annotations are saved.","title":"annotations"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.embedColorProfile","text":"If true, the color profile is embedded in the document.","title":"embedColorProfile"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.layers","text":"If true, the layers are saved.","title":"layers"},{"location":"reference/photoshop/api/save_options/psd/#photoshop.api.save_options.psd.PhotoshopSaveOptions.spotColors","text":"If true, spot colors are saved.","title":"spotColors"},{"location":"reference/photoshop/api/save_options/tag/","text":"TargaSaveOptions Bases: Photoshop Options for saving a document in TGA (Targa) format. Source code in photoshop/api/save_options/tag.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 class TargaSaveOptions ( Photoshop ): \"\"\"Options for saving a document in TGA (Targa) format.\"\"\" object_name = \"TargaSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def resolution ( self ): return self . app . resolution @resolution . setter def resolution ( self , value : TargaBitsPerPixels = TargaBitsPerPixels . Targa24Bits ): self . app . resolution = value @property def rleCompression ( self ): return self . app . rleCompression @rleCompression . setter def rleCompression ( self , value ): self . app . rleCompression = value alphaChannels property writable If true, the alpha channels are saved.","title":"tag"},{"location":"reference/photoshop/api/save_options/tag/#photoshop.api.save_options.tag.TargaSaveOptions","text":"Bases: Photoshop Options for saving a document in TGA (Targa) format. Source code in photoshop/api/save_options/tag.py 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 class TargaSaveOptions ( Photoshop ): \"\"\"Options for saving a document in TGA (Targa) format.\"\"\" object_name = \"TargaSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def resolution ( self ): return self . app . resolution @resolution . setter def resolution ( self , value : TargaBitsPerPixels = TargaBitsPerPixels . Targa24Bits ): self . app . resolution = value @property def rleCompression ( self ): return self . app . rleCompression @rleCompression . setter def rleCompression ( self , value ): self . app . rleCompression = value","title":"TargaSaveOptions"},{"location":"reference/photoshop/api/save_options/tag/#photoshop.api.save_options.tag.TargaSaveOptions.alphaChannels","text":"If true, the alpha channels are saved.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/tif/","text":"TiffSaveOptions Bases: Photoshop Options for saving a document in TIFF format. Source code in photoshop/api/save_options/tif.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 class TiffSaveOptions ( Photoshop ): \"\"\"Options for saving a document in TIFF format.\"\"\" object_name = \"TiffSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . annotations @annotations . setter def annotations ( self , value ): self . app . annotations = value @property def byteOrder ( self ): \"\"\"The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows. \"\"\" return self . app . byteOrder @byteOrder . setter def byteOrder ( self , value ): self . app . byteOrder = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def imageCompression ( self ): \"\"\"The compression type.\"\"\" return self . app . imageCompression @imageCompression . setter def imageCompression ( self , value ): self . app . imageCompression = value @property def interleaveChannels ( self ): \"\"\"If true, the channels in the image are interleaved.\"\"\" return self . app . interleaveChannels @interleaveChannels . setter def interleaveChannels ( self , value ): self . app . interleaveChannels = value @property def jpegQuality ( self ): \"\"\"The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12. \"\"\" return self . app . jpegQuality @jpegQuality . setter def jpegQuality ( self , value ): self . app . jpegQuality = value @property def layerCompression ( self ): return self . app . layerCompression @layerCompression . setter def layerCompression ( self , value ): \"\"\"The method of compression to use when saving layers (as opposed to saving composite data). Valid only when `layers` = true. \"\"\" self . app . layerCompression = value @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers @layers . setter def layers ( self , value ): self . app . layers = value @property def saveImagePyramid ( self ): \"\"\"If true, preserves multi-resolution information.\"\"\" return self . app . saveImagePyramid @saveImagePyramid . setter def saveImagePyramid ( self , value ): self . app . saveImagePyramid = value @property def spotColors ( self ): \"\"\"If true, spot colors are saved.\"\"\" return self . app . spotColors @spotColors . setter def spotColors ( self , value ): self . app . spotColors = value @property def transparency ( self ): return self . app . transparency @transparency . setter def transparency ( self , value ): \"\"\"If true, saves the transparency as an additional alpha channel when the file is opened in another application.\"\"\" self . app . transparency = value alphaChannels property writable If true, the alpha channels are saved. annotations property writable If true, the annotations are saved. byteOrder property writable The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows. embedColorProfile property writable If true, the color profile is embedded in the document. imageCompression property writable The compression type. interleaveChannels property writable If true, the channels in the image are interleaved. jpegQuality property writable The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12. layers property writable If true, the layers are saved. saveImagePyramid property writable If true, preserves multi-resolution information. spotColors property writable If true, spot colors are saved.","title":"tif"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions","text":"Bases: Photoshop Options for saving a document in TIFF format. Source code in photoshop/api/save_options/tif.py 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 class TiffSaveOptions ( Photoshop ): \"\"\"Options for saving a document in TIFF format.\"\"\" object_name = \"TiffSaveOptions\" def __int__ ( self ): super () . __init__ () @property def alphaChannels ( self ): \"\"\"If true, the alpha channels are saved.\"\"\" return self . app . alphaChannels @alphaChannels . setter def alphaChannels ( self , value ): self . app . alphaChannels = value @property def annotations ( self ): \"\"\"If true, the annotations are saved.\"\"\" return self . app . annotations @annotations . setter def annotations ( self , value ): self . app . annotations = value @property def byteOrder ( self ): \"\"\"The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows. \"\"\" return self . app . byteOrder @byteOrder . setter def byteOrder ( self , value ): self . app . byteOrder = value @property def embedColorProfile ( self ): \"\"\"If true, the color profile is embedded in the document.\"\"\" return self . app . embedColorProfile @embedColorProfile . setter def embedColorProfile ( self , value ): self . app . embedColorProfile = value @property def imageCompression ( self ): \"\"\"The compression type.\"\"\" return self . app . imageCompression @imageCompression . setter def imageCompression ( self , value ): self . app . imageCompression = value @property def interleaveChannels ( self ): \"\"\"If true, the channels in the image are interleaved.\"\"\" return self . app . interleaveChannels @interleaveChannels . setter def interleaveChannels ( self , value ): self . app . interleaveChannels = value @property def jpegQuality ( self ): \"\"\"The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12. \"\"\" return self . app . jpegQuality @jpegQuality . setter def jpegQuality ( self , value ): self . app . jpegQuality = value @property def layerCompression ( self ): return self . app . layerCompression @layerCompression . setter def layerCompression ( self , value ): \"\"\"The method of compression to use when saving layers (as opposed to saving composite data). Valid only when `layers` = true. \"\"\" self . app . layerCompression = value @property def layers ( self ): \"\"\"If true, the layers are saved.\"\"\" return self . app . layers @layers . setter def layers ( self , value ): self . app . layers = value @property def saveImagePyramid ( self ): \"\"\"If true, preserves multi-resolution information.\"\"\" return self . app . saveImagePyramid @saveImagePyramid . setter def saveImagePyramid ( self , value ): self . app . saveImagePyramid = value @property def spotColors ( self ): \"\"\"If true, spot colors are saved.\"\"\" return self . app . spotColors @spotColors . setter def spotColors ( self , value ): self . app . spotColors = value @property def transparency ( self ): return self . app . transparency @transparency . setter def transparency ( self , value ): \"\"\"If true, saves the transparency as an additional alpha channel when the file is opened in another application.\"\"\" self . app . transparency = value","title":"TiffSaveOptions"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.alphaChannels","text":"If true, the alpha channels are saved.","title":"alphaChannels"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.annotations","text":"If true, the annotations are saved.","title":"annotations"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.byteOrder","text":"The order in which the bytes will be read. Default: Mac OS when running in Mac OS, and IBM PC when running in Windows.","title":"byteOrder"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.embedColorProfile","text":"If true, the color profile is embedded in the document.","title":"embedColorProfile"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.imageCompression","text":"The compression type.","title":"imageCompression"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.interleaveChannels","text":"If true, the channels in the image are interleaved.","title":"interleaveChannels"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.jpegQuality","text":"The quality of the produced image, which is inversely proportionate to the amount of JPEG compression. Valid only for JPEG compressed TIFF documents. Range: 0 to 12.","title":"jpegQuality"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.layers","text":"If true, the layers are saved.","title":"layers"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.saveImagePyramid","text":"If true, preserves multi-resolution information.","title":"saveImagePyramid"},{"location":"reference/photoshop/api/save_options/tif/#photoshop.api.save_options.tif.TiffSaveOptions.spotColors","text":"If true, spot colors are saved.","title":"spotColors"}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index e30be4d5..f9dc0044 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ