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'
OSX app started from commandline
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 76
- Joined: Tue Mar 05, 2013 7:00 pm
- Location: Berlin
- Contact:
OSX app started from commandline
- Attachments
-
- test.livecode.zip
- (1.76 KiB) Downloaded 185 times
Re: OSX app started from commandline
An application bundle (a .app file) is actually a bunch of directories. Instead of using open and the .app name, you can actually move into it and start the actual binary. For instance:
$ cd /Applications/LittleSnapper.app/
$ ls
Contents
$ cd Contents/MacOS/
$ ./LittleSnapper
That is the actual binary that might accept arguments (or not, in LittleSnapper's case).
That is the actual binary that might accept arguments (or not, in LittleSnapper's case).
$ cd /Applications/LittleSnapper.app/
$ ls
Contents
$ cd Contents/MacOS/
$ ./LittleSnapper
That is the actual binary that might accept arguments (or not, in LittleSnapper's case).
That is the actual binary that might accept arguments (or not, in LittleSnapper's case).
-
- VIP Livecode Opensource Backer
- Posts: 76
- Joined: Tue Mar 05, 2013 7:00 pm
- Location: Berlin
- Contact:
Re: OSX app started from commandline
Excuse me, his hint doesn't help.
The main problem is that the externals and even networking is not loaded. (when started von commandline)
The main problem is that the externals and even networking is not loaded. (when started von commandline)