MacGapProject / MacGap1

Desktop WebKit wrapper for HTML/CSS/JS applications.
Other
3.55k stars 208 forks source link

Passing arguments or environment variables to an app #13

Open judofyr opened 12 years ago

judofyr commented 12 years ago

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
maccman commented 12 years ago

Sounds like a plan - make it :)

judofyr commented 12 years ago

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?

liamks commented 12 years ago

@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 12 years ago

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

subtleGradient commented 12 years ago

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.