Skip to content

notifiers

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

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