Show / Hide Window

I’ve been using Yojimbo, for a long while now but Eystein has been pestering me to give Evernote a shot. Common for both of these is that you don’t want to spend any time when you’re dropping stuff into them. I want one key that’ll toggle the visibility of the app. I want to hit my hotkey, dump stuff in, hit my hotkey again and continue what I was doing. Of course, neither of these apps come with that functionality (Well. Yojimbo does come with a “Quick input”-window, but for some reason I never got to loving it.) so here’s an AppleScript to fix that.

Just change the name in the script to whatever app you want to target, create a Quicksilver trigger for it and Bob’s your uncle.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
on run
  tell application "Finder" to set en to name of first ¬
                        process whose frontmost is true
  if en = "Evernote" then
    tell application "System Events" to set visible ¬
                of process "Evernote" to false
    set notHidden to false
  else
    tell application "System Events" to set visible ¬
                of process "Evernote" to true
    activate application "Evernote"
    set notHidden to true
  end if
end run

I’m really enjoying messing around with AppleScript these last few days. For such a light-weight language the benefits of it commanding the OS are huge.

Possibly related posts:

  1. Center and resize window with AppleScript I use a 15″ MacBook Pro that I carry between...
  2. OmniFocus clippings from Firefox Summary: In which Martin has created an AppleScript to remedy...
  3. Some Path Finder AppleScripts How’s that for a TitleCased title? So I’ve been checking...
  4. TextMate theme-switcher script Summary: In which Martin ponders solutions on how to quickly...
  5. Clean flashlog.txt with a keystroke Scenario: You’re working with the Flex SDK and you’re tracing...

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*