Page 1 of 1

Passing parameters through shell question

Posted: Tue May 07, 2013 10:10 pm
by mtalluto
Below are two ways I have been testing starting up a binary executable on Mac X. Both methods work to some degree. I really need to be able to pass a parameter. Does anyone know how to pass a param using the "open method"?

--DIRECT METHOD
--BLOCKING
--TERMINAL NOT VISIBLE
--CAN PASS A PARAM
put shell(tPath & "/appName paramWorks")

--OPEN METHOD
--NON BLOCKING
--TERMINIAL VISIBLE
--CAN NOT PASS A PARAM
put shell("open appName --args -paramNotWorking")

Re: Passing parameters through shell question

Posted: Wed May 08, 2013 1:13 am
by wsamples
Mark, try the "shell without wait" here:

http://www.howsoft.com/runrev/extensions/

The concept is working under Snow Leopard. I just tried it with Safari, passing a URL as a parameter.

Good luck!

Re: Passing parameters through shell question

Posted: Wed May 08, 2013 1:38 am
by mtalluto
I figured out a solution to the problem. Hope this helps someone else down the road.

Code: Select all

get shell("open -n -a" && tAppPath & "/appName" && "--args helloWorld")
FYI: The order of the -n -a is important. It does not work the other way around.
The benefits are it is non blocking, does not open the terminal, and you can pass parameters.
This has been tested on Macs. I believe you can make this work on windows by exchanging the 'open' with 'start'.

Re: Passing parameters through shell question

Posted: Wed May 08, 2013 1:39 am
by mtalluto
wsamples wrote:Mark, try the "shell without wait" here:

http://www.howsoft.com/runrev/extensions/

The concept is working under Snow Leopard. I just tried it with Safari, passing a URL as a parameter.

Good luck!

Thanks Warren for your suggestion. I ended up figuring it out using the solution I posted earlier.

Re: Passing parameters through shell question

Posted: Tue Sep 17, 2013 9:55 pm
by FourthWorld
mtalluto wrote:I figured out a solution to the problem. Hope this helps someone else down the road.

Code: Select all

get shell("open -n -a" && tAppPath & "/appName" && "--args helloWorld")
FYI: The order of the -n -a is important. It does not work the other way around.
The benefits are it is non blocking, does not open the terminal, and you can pass parameters.
This has been tested on Macs. I believe you can make this work on windows by exchanging the 'open' with 'start'.
With the same args on Win?

Anyone here know if the Mac flags also work similarly on Linux?

Faceless and asyc across platforms would be cool.