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")
Passing parameters through shell question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Passing parameters through shell question
Mark Talluto
--
Canela
design - develop - deploy: https://appli.io
Database and Cloud for LiveCode Developers: https://livecloud.io
Company: https://canelasoftware.com
--
Canela
design - develop - deploy: https://appli.io
Database and Cloud for LiveCode Developers: https://livecloud.io
Company: https://canelasoftware.com
Re: Passing parameters through shell question
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!
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
I figured out a solution to the problem. Hope this helps someone else down the road.
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'.
Code: Select all
get shell("open -n -a" && tAppPath & "/appName" && "--args helloWorld")
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'.
Last edited by mtalluto on Wed May 08, 2013 1:41 am, edited 5 times in total.
Mark Talluto
--
Canela
design - develop - deploy: https://appli.io
Database and Cloud for LiveCode Developers: https://livecloud.io
Company: https://canelasoftware.com
--
Canela
design - develop - deploy: https://appli.io
Database and Cloud for LiveCode Developers: https://livecloud.io
Company: https://canelasoftware.com
Re: Passing parameters through shell question
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.
Mark Talluto
--
Canela
design - develop - deploy: https://appli.io
Database and Cloud for LiveCode Developers: https://livecloud.io
Company: https://canelasoftware.com
--
Canela
design - develop - deploy: https://appli.io
Database and Cloud for LiveCode Developers: https://livecloud.io
Company: https://canelasoftware.com
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Passing parameters through shell question
With the same args on Win?mtalluto wrote:I figured out a solution to the problem. Hope this helps someone else down the road.
FYI: The order of the -n -a is important. It does not work the other way around.Code: Select all
get shell("open -n -a" && tAppPath & "/appName" && "--args helloWorld")
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'.
Anyone here know if the Mac flags also work similarly on Linux?
Faceless and asyc across platforms would be cool.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn