I wrote a script that I (eventually) want to run using launchd.
In this script I use the SQLite Lib to create and use an in-memory database.
Running it in scriptdebugger or by double clicking the created .app works fine.
When I try running it from the commandline using osascript I get an error:
Desktop % osascript database-test.app
database-test.app: execution error: The bundle “FMDBAS” couldn’t be loaded. (-4960)
OK. I have some progress, but getting another error now.
I created a new script using the applet template.
I added SQLite Lib2.scptd to the Resources
Saved the script to update-calendar.app
Running it from SD or finder works without a problem.
Running it using osascript:
I tried 3 options for the database “in file” parameter: missing value, empty string and a on-disk database. All work as long as I don’t try to run the app using osascript.
I’m not sure if it can be done without ASObjC, but this works:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions
set theArgs to current application's NSProcessInfo's processInfo()'s arguments() as list
display dialog last item of theArgs
With:
open -a /Users/shane/Desktop/Applet_test.app --args hello