how do I start x11's program?

Discussion in 'General Mac Discussion' started by chrislee8, Aug 13, 2004.

  1. macrumors regular

    Joined:
    Jul 26, 2004
    Location:
    NY, NY
    #1
    so I installed this GIMP which run under(do I phrase it right?) X11.

    so basically I have to start X11 first, then type something like /sw/bin/gimp & to start GIMP,

    I want to make my own life just a little bit easier, how to I automate this process? by writing some kind of script?

    Thanks
     
  2. jsw
    Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #2
    I installed the GIMP from here (Gimp.app), and it starts X11 for me. No scripts, no pain.
     
  3. thread starter macrumors regular

    Joined:
    Jul 26, 2004
    Location:
    NY, NY
    #3
    I have 10.2 Jaguar, GIMP.app doesn't support Jaguar!!!

    thanks tho, plus, I guess I could do a little scripting to do that, I don't mind learnning a little bit on the scripting.

    :)
     
  4. jsw
    Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #4
    Sorry! Guess I should have known that from other posts. Simple AppleScript ought to do it....
     
  5. thread starter macrumors regular

    Joined:
    Jul 26, 2004
    Location:
    NY, NY
    #5
    applescript, huh?

    I am on it. thanks
     
  6. jsw
    Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #6
    Simple...

    Open AppleScript editor, type in:
    Code:
    tell application "X11" to activate
    delay 5
    tell application "Gimp" to activate
    
    That delay of 5 seconds might not be necessary. Plus, the Gimp app might be called something else for you. Anyway, save it as an application, then you can double click on it and off you go!

    I'm pretty sure this'll work under Jaguar. It works under Panther. Let me know!
     
  7. thread starter macrumors regular

    Joined:
    Jul 26, 2004
    Location:
    NY, NY
    #7
    man, u should have told me in the first place!!

    nah, just kidding, u've been great!, here was what i digged out:

    tell application "X11"
    activate
    end tell

    set results to do shell script "/sw/bin/gimp &"

    I did save it as Application. and I put it in my dock, hahaha

    now i need to give it a custom icon. hehe

    thanks man
     
  8. jsw
    Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #8
    Hey, sorry! I posted back within six minutes ;) - just had to make sure it worked. Sorry to make you look up the "do shell script" part. Just curious: is the "set results to" part required?
     
  9. thread starter macrumors regular

    Joined:
    Jul 26, 2004
    Location:
    NY, NY
    #9
    to my 6 minutes lookup knowledge, yes, set result seem to be required, because applescript won't do 'do shell script' itself

    if u want to do 'do shell script' alone, u need project builder, which I will do next because I want a custom icon.
     
  10. jsw
    Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #10
    Ah. 'do shell script "...whatever.."' works in Panther, just in Script Editor. No need for the first part. Nice improvement. Regardless, I'm glad you got it to work!
     

Share This Page