How to access the current application via AppleScript?

1,607 views
Skip to first unread message

Lvood

unread,
Feb 5, 2011, 11:30:38 AM2/5/11
to Blacktree: Quicksilver
Hi,

I often hide (many) windows with cmd-m and then have problems to get
them back by selecting them one by one in the Windows Menu,
as there is no "maximize all windows" standard command in OS X (or
have I missed something?).

So I tried to make a simple apple script which does that for me:

tell current application
repeat with w in (get every window)
set miniaturized of w to false
end repeat
end tell

My problem:
If I launch the script via Quicksilver, the current application is
Quicksilver (and not the last active one).

What can I do to make it work for the "real" current application
(instead of QS)?

Kind regards

Martin

Jon Stovell

unread,
Feb 5, 2011, 2:52:39 PM2/5/11
to Blacktree: Quicksilver
set theApp to ((path to frontmost application) as text)

tell theApp
--your code here
end tell

Lvood

unread,
Feb 5, 2011, 3:52:47 PM2/5/11
to Blacktree: Quicksilver
Thank you very much for your quick help, Jon!

Just a little correction (as it did not work at the beginning):

...
tell Application theApp
...

Kind regards

Martin
Reply all
Reply to author
Forward
0 new messages