Scripting the Notifications
Count Pending Events
Counts the number of pending Events.
| Line | |
|---|---|
| 1 | tell application "Power Manager Scripting" |
| 2 | tell notifications |
| 3 | set numEvents to count PMEvents |
| 4 | end tell |
| 5 | end tell |
Name of the Next Event
Get the name of the next Event to perform
| Line | |
|---|---|
| 1 | tell application "Power Manager Scripting" |
| 2 | tell notifications |
| 3 | set myName to name of first PMEvent |
| 4 | end tell |
| 5 | end tell |
Action of the Next Event
Get the action of the next Event to perform.
| Line | |
|---|---|
| 1 | tell application "Power Manager Scripting" |
| 2 | tell notifications |
| 3 | set myAction to type class of action of first PMEvent |
| 4 | end tell |
| 5 | end tell |
Date and Time of the Next Event
Get the trigger date of the next Event to perform.
| Line | |
|---|---|
| 1 | tell application "Power Manager Scripting" |
| 2 | tell notifications |
| 3 | set myDate to date of trigger of first PMEvent |
| 4 | end tell |
| 5 | end tell |
Delay an Event
Delays the pending Event called "Morning" by 5 minutes.
| Line | |
|---|---|
| 1 | tell application "Power Manager Scripting" |
| 2 | tell notifications |
| 3 | delay unique id (unique id of PMEvent "Morning") as string seconds (5 * 60) |
| 4 | end tell |
| 5 | end tell |
Cancel an Event
Cancels the next pending Event.
| Line | |
|---|---|
| 1 | tell application "Power Manager Scripting" |
| 2 | tell notifications |
| 3 | cancel unique id (unique id of first PMEvent) as string |
| 4 | end tell |
| 5 | end tell |
Cancel Next Shut Down Event
Cancels the next Event with a Shut Down action.
| Line | |
|---|---|
| 1 | tell application "Power Manager Scripting" |
| 2 | tell notifications |
| 3 | cancel unique id (unique id of first PMEvent whose type class of action is shutdown) as string |
| 4 | end tell |
| 5 | end tell |
- Previous: Scripting the Events
- Next: Sample Script - Weekday to Everyday Events