Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Passing arguments or environment variables to an app #13

Open
judofyr opened this Issue Jan 15, 2012 · 5 comments

Comments

Projects
None yet
4 participants

judofyr commented Jan 15, 2012

I'm going to use MacGap for tiny utilities on the command-line and need a way to pass arguments to the app.

I guess macgap.env is simplest; then I can simply call (probably wrapping it in a shell script):

SOMETHING=foo App.app/Contents/MacOS/App
Contributor

maccman commented Jan 15, 2012

Sounds like a plan - make it :)

judofyr commented Jan 15, 2012

I just realized that it might be useful to send "messages" to an app that's running. What's the best way to accomplish that? AppleScript?

Contributor

liamks commented Jan 15, 2012

@judofyr are you hoping to have a non MacGap app send messages to a MacGap app? Or messaging from one MacGap app to another? If it's the second option you can use websocket (although that relies on a server).

judofyr commented Jan 15, 2012

@liamks Non MacGap; more precisely: a shell script (which could of course invoke some AppleScript).

Cf. https://github.com/subtleGradient/Appify-UI
At Facebook, I'm writing an app using this. The startup script of my app is a bash script which then launches a node.js app that sets up an http server and then launches the PhoneGap mac binary using the node.js child_process module.
It then communicates with node.js via socket.io. I need to port it over to MacGap soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment