Is it possible for a macOS application to listen for specific events originating from another application?
I'd like to detect when Time Machine backups are initiated, in order to create point-in-time snapshots of the NAS folder where the sparsebundle is located.
The Time Machine engine sends distributed notifications.
Add an observer
Objective-C
Swift
and implement the corresponding selector
Objective-C
Swift
You have to filter the notifications related to Time Machine. You can also observe specific notifications via the
nameparameter