• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calling an Applet's Library Handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Calling an Applet's Library Handlers
  • Next by Date: Re: Convert HTML Text to Plain Text
  • Previous by thread: Calling an Applet's Library Handlers
  • Next by thread: window order
  • Index(es):
    • Date
    • Thread