PDA

View Full Version : Scripting question




Macman1993
Jun 27, 2008, 12:58 PM
I've set hotkeys to execute scripts and they work but they only open the application but the application is hidden and to see it I have to click its icon in the dock which completely defeats the hotkeys purpose. Heres one of the scripts I have can someone tell me what I have to add into it so that the application opens and comes to the front of my screen when I hit the hotkey

tell application "safari"
open (yes I know a tab goes before "open" but this site wouldnt let me type it)
end tell



toddburch
Jun 27, 2008, 04:37 PM
This seemed to work for me:


tell application "Safari"
activate
end tell


Todd

(P.S. Use and tags to wrap your code and preserve tabs)

Macman1993
Jun 27, 2008, 08:17 PM
Thanks that worked and I have one more question what is the script to move an already open application to the front of my screen?

Sayer
Jun 28, 2008, 11:51 AM
Thanks that worked and I have one more question what is the script to move an already open application to the front of my screen?

You mean bring all the windows forward? I guess you could use:

tell application "Safari"
tell window 1 to activate
end tell