General Question

makemo's avatar

Is there an AppleScript method that can toggle miniaturized state of certain windows?

Asked by makemo (531points) November 10th, 2008

I want to assign a keyboard shortcut to toggle the minmized (miniaturized?) state of the (one and only) window in the application Skitch.

The keyboard shortcut deal—how to trigger an AppleScript with a hotkey—I’ve solved myself.

BUT.

I can’t solve the getting and setting of the window’s minimized state… Here is my foul hack of an AppleScript, but it doesn’t really work at all:

tell application “System Events”

if (window “Skitch” is miniaturized) then
set window “Skitch” to not miniaturized
else if (window “Skitch” is not miniaturized) then
set window “Skitch” to miniaturized
end if

end tell

Observing members: 0 Composing members: 0

2 Answers

blastfamy's avatar

You could try opening the dictionary of commands (cmd + shift + o). This gives you the syntax of every applicable command for every app you have on your machine.

makemo's avatar

Yep, I’m aware of that part. Using Script Debugger for dictionary lookups. My problem is, I can’t seem to get my head around AppleScript and I’ve waded too many forums/resources on the Internet, but can’t find a quick solution for this particular problem. I’m sure I’ve probably stepped over it somewhere, without noticing, and I’m in a little bit of hurry, so I thought I’d see if someone knew how this little snippet would look like.

No problem, though. I found out that one could use Keyboard Maestro to toggle Skitch’s window on and off. Thanks.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther