Passing Command-Line Params to Running Instance [RESOLVED]

Mac OSX specific forum
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Passing Command-Line Params to Running Instance [RESOLVED]

Post 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.
Last edited by coder14 on Sun Dec 18, 2016 11:07 am, edited 1 time in total.
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: Passing Command-Line Params to Running Instance

Post 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. :cry:
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: Passing Command-Line Params to Running Instance

Post 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! :|
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: Passing Command-Line Params to Running Instance

Post by coder14 »

coder14 wrote:Still need help for getting the command line params from subsequent launches of the app. :cry:
A solution for the benefit of other readers:

http://www.purebasic.fr/english/viewtop ... 49#p497749

Thank you Fred.
Post Reply