03-16-2008, 09:36 PM #1
Applescript for Toggling Energy Saver Presets
- Member Since
- Mar 16, 2008
Hello everybody, I'm a somewhat of a poweruser seeking to realize the full potential of my MacBook. After experimenting w/ Linux, I was wondering if it were possible to set OS X to lock my screen upon pressing ctrl + alt + L (without causing the "Require pass word to wake this computer from sleep or screen saver" setting to checked in the Security Preference Pane). After spending some time googling, I was able to do so by setting a Trigger in Quicksilver to run a Applescript file with the following contents:
activate application "SystemUIServer"
tell application "System Events"
tell process "SystemUIServer"
repeat with i from 1 to number of menu bar items of menu bar 1
tell menu bar item i of menu bar 1
if name of menu item 1 of front menu is "Lock Screen" then
click menu item "Lock Screen" of front menu
As it turns out, the script performs this function as if I had moused over to the lock menubar item and selected "Lock Screen", complete w/ the item's visibility for a brief moment. In light of this, I was wondering if it were also possible for Applescript to toggle between two Energy Saver presets, also for the purpose of being used for a Quicksilver Trigger. Basically, I want to tell my OS the following "Click on the battery icon in the menubar. If Normal is checked, click Custom. If Custom is checked, click Normal". Is this possible? If so, what do I need to put in an Applescript file in order for it do this? Thanks in advanced to anyone who takes the time to read this and/or tries to help. A break down of what each line of text does would also be appreciated for educational purposes.
03-17-2008, 09:58 PM #2
When all else fails, try everything!
- Member Since
- Jan 27, 2008
- Estero, FL
- iMac 17" 1Ghz G4 iPhone 3G 10.5.5
The Rep System and you.
Life's a joke...If you're not laughing, then you didn't get it.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By stumpleg in forum OS X - Operating SystemReplies: 3Last Post: 04-16-2010, 01:40 PM
By AEROX711 in forum OS X - Operating SystemReplies: 13Last Post: 03-17-2009, 06:08 PM
By iChaliki in forum Switcher HangoutReplies: 4Last Post: 11-02-2008, 02:58 PM
By cubby in forum Switcher HangoutReplies: 3Last Post: 08-31-2008, 12:52 PM
By Graeme43 in forum Apple NotebooksReplies: 0Last Post: 05-03-2004, 06:21 PM