Unix Executable app launcher

Discussion in 'Mac Programming' started by cynricng, Aug 24, 2012.

  1. cynricng macrumors newbie

    Aug 24, 2012

    I am currently working on something that needs a Unix Executable file that launches apps, however I want it to take in the location of the app as an argument and launch it, so I can launch different apps with the same Unix Executable file.

    I heard that it can be done with applescript, but actually I'm trying to call it from an Adobe AIR program through native process, which doesn't seem to let me open .app or applescipt programs (Not entirely sure about this, I just assumed its the case since I couldn't get it to work), therefore I got to do it with an Unix Executable file.

    Thank you,
  2. chown33 macrumors 604

    Aug 9, 2009
    There already is one. It's the 'open' command. Read the man page for it. Be sure to look at the examples in the man page.
  3. cynricng thread starter macrumors newbie

    Aug 24, 2012

    Sorry for not being precise, actually the part that I'm stuck is how to pass arguments into the file.

    I apologize if the questions sound really dumb, I have no experience with Unix at all.

    Actually I tried out the example of calling TinkerProxy's Unix Exec file with arguments, so basically I'm trying to do the same thing, but TinkerProxy's file is not open source, I haven't been able to figure out how its done on the Unix's side.

  4. chown33 macrumors 604

    Aug 9, 2009
    I'm not familiar with how AIR launches external commands, so please post how that happens now. For example, if the goal was to run the ping or ls command, what would that look like in AIR?

    If you don't know, then you need to find that out first. Because if you don't know how to run a Unix Executable in the first place, then making one won't really solve anything.

    Also, which OS version are you using? Which AIR version?
  5. cynricng thread starter macrumors newbie

    Aug 24, 2012
    Sorry for the late reply, got sick for a few days.

    I managed to have it work after some trial and error, here is the code if anyone is interested.

    Shell script:



Share This Page