Lisp HUG Maillist Archive

Calling AppleScripts

Can someone tell me how to call an AppleScript from LispWorks? I'd  
also like to know how to include a parameter and receive the result,  
if possible. Extra points if you can refer me to the documentation.

Thanks!

Laughing Water



Re: Calling AppleScripts


On Apr 8, 2009, at 12:51 PM, Laughing Water wrote:

>
> Can someone tell me how to call an AppleScript from LispWorks? I'd  
> also like to know how to include a parameter and receive the result,  
> if possible. Extra points if you can refer me to the documentation.
>

(sys:run-shell-command "osascript /Users/raffaelc/Library/Scripts/ 
emptytrash.scpt")

<http://developer.apple.com/DOCUMENTATION/DARWIN/Reference/ManPages/man1/osascript.1.html 
 >

<http://www.lispworks.com/documentation/lw51/LWRM/html/lwref-742.htm>

warmest regards,

Ralph





Raffael Cavallaro, Ph.D.
raffaelcavallaro@mac.com


Re: Calling AppleScripts


On Apr 8, 2009, at 4:44 PM, Laughing Water wrote:

> Thanks! Good points.

Of course all the escaping and double quoting could be avoided if you  
simply rename your AppleScript to Alarmscript or alarmscript or  
AlarmScript so that its path has no spaces in it. Then you can pass  
the path as an arg to osascript without quotes of any kind as I showed  
in my first example.

In general, if you think you might ever use something from the command  
line or a script in Mac OS X it's a good idea to make sure in advance  
that there are no spaces in its path. Then you won't have to quote it  
when you pass it as an arg to a command line tool.

warmest regards,

Ralph





Raffael Cavallaro, Ph.D.
raffaelcavallaro@mac.com


Re: Calling AppleScripts


On Apr 9, 2009, at 4:09 AM, Pascal J. Bourguignon wrote:

> On the other hand, on a MacOSX file system you MUST expect spaces

True. This even bit Apple in one MacOS X software update where volumes  
with spaces in their names were erased by the update!

warmest regards,

Ralph




Raffael Cavallaro, Ph.D.
raffaelcavallaro@mac.com


Updated at: 2020-12-10 08:41 UTC