Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I love caffeine, but I really wish it were just a keyboard shortcut or perhaps a command line / terminal command. Has anyone figured out a way to activate / deactivate Caffeine using another method besides clicking?

enter image description here

share|improve this question
    
Ask the developer to implement a shortcut ? Otherwise you have two options : NO, or you can make a UI applescript hack to access the menubar and click it for you. –  Kassym Dorsel Oct 26 '11 at 22:05

1 Answer 1

up vote 2 down vote accepted

Caffeine has a tiny AppleScript dictionary:

tell application "Caffeine"
    if active then
        turn off
    else
        turn on
    end if
end tell

Assign a shortcut to running a script in OS X - Super User

share|improve this answer
    
How can you tell what is in the application's Applescript dictionary? –  cwd Oct 27 '11 at 19:27
1  
@cwd Open Dictionary (⇧⌘O) in AppleScript Editor. –  ؘؘؘؘ Oct 28 '11 at 4:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.