1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Scripting question

Discussion in 'Mac Programming' started by Macman1993, Jun 27, 2008.

  1. macrumors 6502


    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
  2. macrumors 6502a

    This seemed to work for me:

    tell application "Safari"
    end tell

    (P.S. Use [code] and [/code] tags to wrap your code and preserve tabs)
  3. macrumors 6502


    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?
  4. macrumors 6502a


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

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

Share This Page