Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[17,401 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 whoever posted them. This site is not responsible for what they say.
10.3: Activate Exposť via an AppleScript
Authored by: sTvN on Jan 20, '04 11:53:55AM

This assumes that you use the default keys for expose.



[ Reply to This | # ]
10.3: Activate Exposť via an AppleScript
Authored by: JayBee on Jan 20, '04 12:52:21PM

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 Jan 20, '04 02:13:41PM

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 Jan 20, '04 02:17:08PM

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 Jan 20, '04 06:29:31PM

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 Jan 20, '04 06:34:58PM

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 Jan 20, '04 07:35:59PM

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 Jan 21, '04 02:12:49PM

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 | # ]