Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Open «System Preferences --> Energy Saver» using Cocoa Scripting Bridge #59

wants to merge 2 commits into


None yet
2 participants

ericbroska commented Jan 28, 2013

  • avoid hardcoded paths
  • profit

codler commented Jan 28, 2013

Thats alot of code just for replacing one hardcoded path. Why is SystemPreferences.h needed and what does it do? Is it a private API class in Apple?


ericbroska commented Jan 29, 2013

@codler yeah, you're right — it's a quite big piece of code, but… I just don't like any kind of hardcode :)
SystemPreferences.h is a declaration of «System Preferences.app»'s Apple Scripting interface, so it's needed for using such things as SystemPreferencesPane and SystemPreferencesApplication. It's the public API and you can generate it yourself:

 $ sdef "/Applications/System Preferences.app" | sdp -fh --basename SystemPreferences -o ~/SystemPreferences.h   

Also, it is possible to remove some code from this header (for instance, we don't need SystemPreferencesItem, SystemPreferencesDocument, SystemPreferencesWindow, SystemPreferencesText and so on).


codler commented Jan 2, 2014

Sry, this wont be merged

@codler codler closed this Jan 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment