p1r2c1
(Philip)
December 2, 2021, 6:07pm
#1
I need to call an AppleScript script from a library via its handler in a shell script. I have this:
osascript -e 'script \"myLibrary\"'s test()'
I think I need to escape the brackets too but nothing I try seems to work. Any help greatly appreciated!
I think anything passed that way has to be standalone. It doesn’t look as if either of those names (myLibrary
, and test
) are actually bound to anything there.
Hi.
The problem’s confusion between the single quotes and the apostrophe. This works:
do shell script "osascript -e " & quoted form of "script \"myLibrary\"'s test()"
As do:
do shell script "osascript -e 'test() of script \"myLibrary\"'"
… and …
do shell script "osascript -e 'tell script \"myLibrary\" to test()'"
p1r2c1
(Philip)
December 3, 2021, 8:25pm
#5
Brilliant thank you! Sometimes it’s the simplest things that stump me.