Skip to content

action_descriptor

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()

Last update: 2024-11-17
Created: 2024-11-17