Skip to content

action_reference

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)

Last update: 2024-03-05
Created: 2024-03-05