Re: Calling an Applet's Library Handlers
Re: Calling an Applet's Library Handlers
- Subject: Re: Calling an Applet's Library Handlers
- From: has <email@hidden>
- Date: Thu, 30 Jun 2016 00:26:45 +0100
Christopher Stone wrote:
> You can call an applet's top-level handlers with no problem ... But
can you do something similar to this on El Capitan when the applet
contains embedded script libraries?
Yes, but you have to bind the script library (or - preferably - a
reference to it) to a property; using the `use` statement doesn't work:
-- TestApplet (saved as stay-open application)
use ulib : script "TypeSupport"
property plib : a reference to script "TypeSupport"
script scpt
to asNumber(n)
n as number
end asNumber
end script
-- test script
tell application "TestApp"
asNumber("3") of scpt of it --> 3
asNumber("3") of plib of it --> 3
asNumber("3") of ulib of it -- Fails (because... honestly, what did
you expect?)
end tell
HTH
has
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden