Scripting question

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

  1. macrumors 6502

    Macman1993

    Joined:
    Nov 23, 2007
    #1
    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

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #2
    This seemed to work for me:

    Code:
    tell application "Safari"
    	activate
    end tell
    
    Todd

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

    Macman1993

    Joined:
    Nov 23, 2007
    #3
    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

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #4
    You mean bring all the windows forward? I guess you could use:

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

Share This Page