OSX app started from commandline
Posted: Tue May 29, 2018 11:40 pm
Hello, dear livecoders i need some help.
At the end i’am trying to write a small app which will be started from the osx command line with a phone number as parameter, asking an internal web service for details about this number.
After compiling my app as a standalone for osx it works like expected if i start it with double-click in finder.
When i’am starting it from command line using this command:
open -a '/Users/mimu/Desktop/cmParamTest/cmParamTest.app' --args '015115676045'
The app opens, the parameter is written to a field. But posting to my webservice fails.
To track things down i tried a couple of things:
1.
a Button with this script:
on mouseUp
put field "urlAddress" into tUrl
put url tUrl into field "webpagetext"
end mouseUp
works if standalone app started with double-click in finder, clicking this button nothing happens when app started from commandline
2.
another button with this script to check the loaded extensions:
on mouseUp
answer the loadedExtensions
end mouseUp
- app started in finder, i get an answer dialog listing the loaded Extensions.
- app started from commandline i get the following messagewindow:
Do you want to save changes to stack „cmParamTest“ and all other stacks in the file „cmParamTest.livecode“ before closing.
What i’am doing wrong?
using Livecode 9 business, on osx 10.13
Little test stack attached
standalone inclusions: Internet, JsonLib, tsnet
compile it and start from commandline:
open -a '/Users/username/Desktop/test/MacOSX/test.app'
At the end i’am trying to write a small app which will be started from the osx command line with a phone number as parameter, asking an internal web service for details about this number.
After compiling my app as a standalone for osx it works like expected if i start it with double-click in finder.
When i’am starting it from command line using this command:
open -a '/Users/mimu/Desktop/cmParamTest/cmParamTest.app' --args '015115676045'
The app opens, the parameter is written to a field. But posting to my webservice fails.
To track things down i tried a couple of things:
1.
a Button with this script:
on mouseUp
put field "urlAddress" into tUrl
put url tUrl into field "webpagetext"
end mouseUp
works if standalone app started with double-click in finder, clicking this button nothing happens when app started from commandline
2.
another button with this script to check the loaded extensions:
on mouseUp
answer the loadedExtensions
end mouseUp
- app started in finder, i get an answer dialog listing the loaded Extensions.
- app started from commandline i get the following messagewindow:
Do you want to save changes to stack „cmParamTest“ and all other stacks in the file „cmParamTest.livecode“ before closing.
What i’am doing wrong?
using Livecode 9 business, on osx 10.13
Little test stack attached
standalone inclusions: Internet, JsonLib, tsnet
compile it and start from commandline:
open -a '/Users/username/Desktop/test/MacOSX/test.app'