Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.3: Activate Exposé via an AppleScript Desktop
If you want to call one of the Exposé functions from an AppleScript, you can do the following (Note: This script assumes you have the default Exposé key bindings; if you've changed them, this will not work as expected!):

-- All windows
tell application "System Events" to key code 101
-- Application windows
tell application "System Events" to key code 109
-- See desktop
tell application "System Events to key code 103
-- See desktop in slow motion
tell application "System Events" to key code 103 using shift down
For example, you can freak out people with this :-)

tell application "System Events"
  set ap to 109
  set desk to 103
  set win to 101
  repeat with a in ¬
   {ap, desk, win, win, desk, ap, desk, ap, ap, ¬
   ap, desk, win, ap, desk, desk, win, ap, desk, desk}
    key code a
  end repeat
end tell
[robg adds: OK, I think that this just might be the funniest AppleScript we've ever published ... and consider it with remote activation via SSH!]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[11,331 views]  

10.3: Activate Exposé via an AppleScript | 8 comments | Create New Account
Click here to return to the '10.3: Activate Exposé via an AppleScript' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.3: Activate Exposé via an AppleScript
Authored by: sTvN on Tue, Jan 20 2004 at 11:53AM PST
This assumes that you use the default keys for expose.

[ Reply to This | # ]
10.3: Activate Exposé via an AppleScript
Authored by: JayBee on Tue, Jan 20 2004 at 12:52PM PST
Yeah, you might want to point this out in the hint. I ran the script and had a tonne of windows launch as I have F9-F11 bound to apps via KeyXing...

:(

[ Reply to This | # ]
10.3: Activate Exposé via an AppleScript
Authored by: robg on Tue, Jan 20 2004 at 2:13PM PST
Sorry, should have caught that. I just added a note to the hint.

-rob.

[ Reply to This | # ]
10.3: Activate Exposé via an AppleScript
Authored by: pwharff on Tue, Jan 20 2004 at 2:17PM PST
Can someone please explain this to those of us who do not know AppleScript? And why it's funny? Sorry for being out of the loop on this.

[ Reply to This | # ]
10.3: Activate Exposé via an AppleScript
Authored by: roy.s on Tue, Jan 20 2004 at 6:29PM PST
Go to:-
Applications---AppleScript---Script Editor, open it.
copy-paste the script into the blank area.
click run.

How to make it a real script? I have no idea, try help,
but this shows the effect.

(last time I attempted to make a program was on a spectrum48k, 3days to make ping-pong in basic,I promised never to try again, but maybe apple script one day!!!!!!it looks easier.)
Roy

[ Reply to This | # ]
10.3: Activate Exposé via an AppleScript
Authored by: roy.s on Tue, Jan 20 2004 at 6:34PM PST
ps.
only the second script works?
Maybe someone can explain more about scripts here.
Roy

[ Reply to This | # ]
10.3: Activate Exposé via an AppleScript
Authored by: robg on Tue, Jan 20 2004 at 7:35PM PST
The first script is just examples of the commands to use; the second script is an actual executable script.

-rob.

[ Reply to This | # ]
10.3: Activate Exposé via an AppleScript
Authored by: gregpare on Wed, Jan 21 2004 at 2:12PM PST
Does anyone know how to change the key codes to something else? I use command-F1, command-F2, and command-F3. I don't want to change the keys, but I would like to make another script that uses exposé.

[ Reply to This | # ]