Results 1 to 2 of 2

Thread: Applescript for Toggling Energy Saver Presets

  1. #1

    Member Since
    Mar 16, 2008
    Applescript for Toggling Energy Saver Presets
    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
    exit repeat
    end if
    end try
    end tell
    end repeat
    end tell
    end tell

    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.

  2. #2

    Soulwar's Avatar
    Member Since
    Jan 27, 2008
    Estero, FL
    When all else fails, try everything!
    The Rep System and you.
    Life's a joke...If you're not laughing, then you didn't get it.

    June 2008

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help with Screen Saver / Energy Saver stuff?
    By stumpleg in forum macOS - Operating System
    Replies: 3
    Last Post: 04-16-2010, 12:40 PM
  2. Energy Saver Preferences are gone!
    By AEROX711 in forum macOS - Operating System
    Replies: 13
    Last Post: 03-17-2009, 05:08 PM
  3. energy saver
    By iChaliki in forum Switcher Hangout
    Replies: 4
    Last Post: 11-02-2008, 02:58 PM
  4. Energy saver/screen saver question.
    By cubby in forum Switcher Hangout
    Replies: 3
    Last Post: 08-31-2008, 11:52 AM
  5. Energy Saver
    By Graeme43 in forum Apple Notebooks
    Replies: 0
    Last Post: 05-03-2004, 05:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts