appArgs under Mac OS
Archives Forums/MacOS X Discussion/appArgs under Mac OS
| ||
Hi, I have a problem with the coand AppArgs(). If I build a GUI app and set an argument to ist (with the Terminal) it doesnt accept it. In console-apps it works fine. has anyone the same problems? Thanks |
| ||
GUI apps aren't really designed to be started from the terminal. How are you running the application? With the "open" command? According to the open man page ("man open"), you can add --args to the command. For example : > open myapp.app --args 1 2 3 For a console app, you would do this : myapp 1 2 3 Hope this helps. |
| ||
no, without open... thanks but with open it doesn't work, too. |
| ||
It works for me with open. I even tested it just to be sure what happens... Here is my example : SuperStrict Local s:String For Local args:String = EachIn AppArgs s :+ args + " " Next Notify s When run, this will display a message box with all of the app args. Compiled as GUI app. Run with no arguments : open term_test.debug.app Result of Notify : /Users/brucey/Documents/programming/Blitz/term_test.debug.app/Contents/MacOS/term_test.debug (The first argument is always the path to the app itself) Run with arguments, as per the docs of open : open term_test.debug.app --args test Result of Notify : /Users/brucey/Documents/programming/Blitz/term_test.debug.app/Contents/MacOS/term_test.debug test Note that "test" is the first actual parameter. Note also that you cannot Print or DebugLog when running a GUI app from the terminal, because the output does NOT go to the terminal. Which is why I used Notify. :-) |
| ||
thanks you very much :) i tested it with --args -lol <- this is a no-go! but without - its perfect. thank you! |