Re: Libraries Using Libraries?
Re: Libraries Using Libraries?
- Subject: Re: Libraries Using Libraries?
- From: Stan Cleveland <email@hidden>
- Date: Tue, 29 Mar 2016 13:45:51 -0700
> On Mar 29, 2016, at 12:20 PM, Christopher Stone <email@hidden> wrote:
>
> Is it possible for libraries to call other libraries? I've tried placing:
> use FLb : script "FLb"
> use scripting additions
>
> In a secondary library (sLB) and calling a handler that uses my change-text handler:
> on someHandler()
> set srcData to "Is this Goofy?"
> set srcData to cng("Goofy", "Kosher", srcData) of FLb
> return srcData
> end someHandler
>
> So: use sLB : script "sLB"
> use scripting additions
> someHandler() of sLB
> Returns to the calling script: "Is this Goofy?"
>
> The cng() handler is not executed. Am I going to have to build another monolithic library?
Hi Chris,
It seems to work here. I set up three scripts (using OS 10.11.4).
Script one named "FLb.scptd" saved in ~/Library/Script Libraries/:
on cng(findStr, replaceStr, theText)
tid(findStr)
set parts to text items of theText
tid(replaceStr)
set newText to parts as text
tid("")
return newText
end cng
on tid(d)
set AppleScript's text item delimiters to d
end tid
Script two named "sLb.scptd" also saved in ~/Library/Script Libraries/:
use FLb : script "FLb"
on someHandler()
set srcData to "Is this Goofy?"
set newData to cng("Goofy", "Kosher", srcData) of FLb
return newData
end someHandler
And script three:
use sLB : script "sLB"
someHandler() of sLB
When run, the string "Is this Kosher?" is returned.
Regards,
Stan C.
_______________________________________________
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