Unix Executable app launcher

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

  1. cynricng macrumors newbie

    Joined:
    Aug 24, 2012
    #1
    Hi,

    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,
    Cynric
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    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

    Joined:
    Aug 24, 2012
    #3
    Thanks.

    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.

    http://www.mikechambers.com/blog/2010/08/04/getting-started-with-flash-and-arduino/
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    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

    Joined:
    Aug 24, 2012
    #5
    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:


    AS3:

     

Share This Page