Page 1 of 1
Passing Command-Line Params to Running Instance [RESOLVED]
Posted: Thu Dec 01, 2016 5:24 am
by coder14
Can we send the command-line params from a second program launch to the running process? Mac has a single-process lock so no risk of multiple instances running. But how can we get the params of the subsequent launch attempts?
I am also still trying to figure out how to do file associations.
Any help is hugely appreciated.
Re: Passing Command-Line Params to Running Instance
Posted: Thu Dec 01, 2016 7:18 am
by coder14
Found out that the file associations are stored in the app's plist file. Tried editing the bundle icon and "LSIsAppleDefaultForType" manually and it works. Any way to do this through PureBasic code?
Still need help for getting the command line params from subsequent launches of the app.

Re: Passing Command-Line Params to Running Instance
Posted: Thu Dec 01, 2016 7:51 am
by coder14
OK! After the app is compiled the plist file can be be opened and edited from inside the bundle. File associations DONE! (Hope I'm not missing any important steps??)
Now still struggling with the command line params from subsequent launches. HELP!

Re: Passing Command-Line Params to Running Instance
Posted: Fri Dec 02, 2016 7:09 am
by coder14
coder14 wrote:Still need help for getting the command line params from subsequent launches of the app.

A solution for the benefit of other readers:
http://www.purebasic.fr/english/viewtop ... 49#p497749
Thank you Fred.