Extending Power Manager
Use Power Manager to get a head start with your own projects and let us do the heavy lifting.
Power Manager provides a complete Application Programming Interface (API).
Developer Documentation
Every API parameter, request, and structure is documented in the developer guide. A wide selection of AppleScript examples are included in the scripting guide.
In Your Language
You can work with Power Manager using a wide range of scripting languages. A selection of languages and recommended interfaces are listed below:
- AppleScript
- Use the Power Manager application's scripting dictionary.
- Python & Ruby
- Scripting Bridge the Power Manager application
- Perl
- Use the Mac::Glue CPAN module
- Command line interface
- Use pmctl
An Example in Multiple Languages
How easy is Power Manager to work with? The following examples all request a list of events.
Events in AppleScript
A few of lines of AppleScript is enough to gather all the events in Power Manager.
tell application "Power Manager" -- Get all the events set myEvents to the events of the Event Store end tell
Events in the Shell
Power Manager includes a command line tool called pmctl
. To make your scripts even easier to write, pmctl
's replies can be formatted in plist or json formats.
bash% cd /Applications/Power\ Manager.app/Contents/Tools/ bash% ./pmctl eventstore.events
Where to Learn More
The best way to learn how to work with Power Manager is to install a copy on your Mac, and refer to the developer guide.