Re: Reload Library?
Re: Reload Library?
- Subject: Re: Reload Library?
- From: Shane Stanley <email@hidden>
- Date: Fri, 20 May 2016 09:49:05 +1000
On 20 May 2016, at 6:20 AM, Christopher Stone <email@hidden> wrote:
>
> Then I change the library handler and save it.
>
> I also recompile and save the calling script.
>
> FastScripts will still call the originally loaded version of the library and NOT the updated version.
>
> This also happens with some peculiarities in Script Debugger 5.
>
> Is there a way to force the library to be reloaded in the calling script?
Not generally, although it might help to know what's happening.
A typical application that runs but doesn't scripts, such as FastScripts or some other app with a Scripts menu or panel, usually uses a single default AppleScript component instance. Script libraries are cached per-component instance, so once FastScripts (or InDesign or whatever) loads a library, the only way to update it is to quit and relaunch the app.
Editors tend to be different. Script Editor gives each document its own AppleScript component instance, and creates a new one each time you compile. Script Debugger 5 gives each document its own component instance, which is used as long as the document is open. You can see this when you try to compile a script and you change the case of a variable; you can only have one style per component instance.
ASObjC Explorer creates a new instance each time you compile or run. As you can see here <http://blog.latenightsw.com/?p=1009>, Script Debugger 6 will use a new instance each time you compile. I think Smile uses a single instance throughout, but I'm not sure.
There's no reason apps can't use separate instances; it's largely a historical thing. And it still catches people out, because a single instance means text item delimiters is a shared property -- set them in one FastScript script, for example, and that's what the next one will use.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
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