• 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
Script Library caching
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Script Library caching


  • Subject: Script Library caching
  • From: Chris Page <email@hidden>
  • Date: Thu, 07 Jan 2016 06:40:35 -0800

> On Jan 5, 2016, at 5:31 PM, has <email@hidden> wrote:
>
> Furthermore, there seems to be some degree of caching going on, possibly in AS, possibly in SE, possibly in something else, because sometimes when I move my dummy script in or out of the 'Script Libraries' folder the test script still manifests the previous behavior the next time I run it. Recompiling seems to make it catch up to the change, but that itself is hardly a reassurance.

AppleScript caches the locations of libraries so it doesn't have to search files every time a library is referenced. Once a library is loaded, the cache allows it to locate the one in memory without I/O. Script Editor creates a new instance of AppleScript each time you compile a script document, thereby resetting the cache (and causing it to load the latest library from disk the next time it is referenced). You should find that compiling (at least with Script Editor and osacompile) will always find libraries as they are currently on disk. If it doesn't, please file a bug report: https://developer.apple.com/bug-reporting/

This is one reason why it is preferable for each component instance to be able to have different library versions loaded. If an instance loads a library, the library should be the same library as long as it is still referenced, but OSA clients have the flexibility of creating a new instance to pick up a different version, even while still executing scripts in another instance that are still using one that was loaded earlier. Script Editor gives each open document its own AppleScript instance, and creates a new instance with each compile, so each script's “universe” is up to date, without interfering with other open documents, which may be executing at the time.

--
Chris Page
The other, other AppleScript Chris


 _______________________________________________
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


References: 
 >A wild OS X security hole appears!!!! [Was: Application library ?] (From: has <email@hidden>)
 >Re: A wild OS X security hole appears!!!! [Was: Application library ?] (From: has <email@hidden>)

  • Prev by Date: Re: A wild OS X security hole appears!!!! [Was: Application library ?]
  • Next by Date: Re: [ANN] CalendarLib, improved Calendar scripting
  • Previous by thread: Re: A wild OS X security hole appears!!!! [Was: Application library ?]
  • Next by thread: Re: A wild OS X security hole appears!!!! [Was: Application library ?]
  • Index(es):
    • Date
    • Thread