3

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

1
  • 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. Oct 26, 2011 at 22:05

1 Answer 1

3

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

2
  • How can you tell what is in the application's Applescript dictionary?
    – cwd
    Oct 27, 2011 at 19:27
  • 1
    @cwd Open Dictionary (⇧⌘O) in AppleScript Editor.
    – Lri
    Oct 28, 2011 at 4:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .