Running app from Terminal saved with Applescript Editor...

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

  1. orbdrums macrumors member

    Dec 13, 2008
    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 " a directory". The following is an example of before and now.

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

    -bash: /Users/username/Programming/ 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


    Dec 16, 2010
    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:

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

  3. orbdrums thread starter macrumors member

    Dec 13, 2008
    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

    Jan 15, 2007
    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

    Dec 13, 2008
    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