Applescript

Jump to First Reply
Posted:
in Genius Bar edited January 2014
I just wrote this to open GIMP



tell application "X11" to activate

do shell script "DISPLAY=:0.0 /opt/local/bin/gimp &"



it works but it doesn't close after opening GIMP



help

Comments

  • Reply 1 of 6
    Tell application "X11"

    quit

    end tell
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 6
    Quote:

    Originally posted by DMBand0026

    Tell application "X11"

    quit

    end tell




    nono



    I want the actual applescript to quit
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 6
    How do you use the script? Are you running it from the script editor? Have you saved it as an application?



    You should be able to save it as an application. When saving, select Application from the pop up menu. Do not check the little box that says "stay open". It should execute then terminate.
     0Likes 0Dislikes 0Informatives
  • Reply 4 of 6
    Quote:

    Originally posted by neutrino23

    How do you use the script? Are you running it from the script editor? Have you saved it as an application?



    You should be able to save it as an application. When saving, select Application from the pop up menu. Do not check the little box that says "stay open". It should execute then terminate.




    i did such thing but it does not terminate. it stays open and i have to force quit it.



    any ideas?
     0Likes 0Dislikes 0Informatives
  • Reply 5 of 6
    Quote:

    Originally posted by soulcrusher

    i did such thing but it does not terminate. it stays open and i have to force quit it.



    any ideas?




     0Likes 0Dislikes 0Informatives
  • Reply 6 of 6
    OK, so the whole script looks like this:



    tell application "X11" to activate

    do shell script "DISPLAY=:0.0 /opt/local/bin/gimp &"

    end tell



    Is that right?



    If the script gets as far as the "end tell" statement then it should terminate. This makes me think that somehow it is hanging in the shell script.



    I did a quick google search on "AppleScript" and "Shell Script" and "how" and found this developers note.



    http://developer.apple.com/technotes/tn2002/tn2065.html



    It may give you some ideas. I don't use shell scripts but the first part of the document made me think of possible ways the shell script could be getting confused. Hope it helps.
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.