Running app from Terminal saved with Applescript Editor...

Discussion in 'Mac Programming' started by orbdrums, Mar 3, 2011.

  1. orbdrums macrumors member

    Joined:
    Dec 13, 2008
    #1
    I wrote a few applescripts, saved them as .apps and ran them from "Terminal" with no problem. I'm not sure what changed but when I write new scripts and save them as .apps they will not run in "Terminal". I open Terminal manually and type in the path and bash returns "...is a directory". The following is an example of before and now.

    /Users/username/Programming/Rng.app - When saved before it executes the app.

    -bash: /Users/username/Programming/RnG.app: is a directory - Now it returns this message with no execution.

    I would appreciate any help with this because it's driving me nuts...
     
  2. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    I don't know what changed. Looks like before you were just creating binaries with a .app extension. You weren't creating proper MacOS application, which are indeed directories with a specific directory structure.

    Either use the open command:

    Code:
    open /Users/username/Programming/Rng.app
    
    or run the binary within the .app directory

    Code:
    /Users/usernames/Programming/Rng.app/Contents/MacOS/Rng
    
     
  3. orbdrums thread starter macrumors member

    Joined:
    Dec 13, 2008
    #3
    Wow. Thanks so much for your input. I was pulling my hair out and I don't have any left. open worked. As I'm sure you know, I'm new to Apple...
     
  4. foidulus macrumors 6502a

    Joined:
    Jan 15, 2007
    #4
    You also may want to look into osascript, it allows you to directly execute applescript from the terminal(or inside scripts).
     
  5. orbdrums thread starter macrumors member

    Joined:
    Dec 13, 2008
    #5
    I have looked at osascript and used it but my goal is to have an .app run at different times throughout the day. I downloaded "Lingon" but since I downloaded it, it is now an app store product. I guess my next goal is to learn the launchd command. Like I said, I'm new to the UNIX environment so I need a lot of patience, which the app store does not seem to be providing because of the influx of interest in apps.

    I'm still glad that I jumped off the sinking ship that is?

    Onward and upward!
     

Share This Page