On May 19, 2016, at 02:59 PM, Christopher Stone < email@hidden> wrote:
I'm looking for a way to manage within the current library system's methods though.
Hi Chris,
Okay, how about this? The usual is to do this, which defines the library property upon compilation of the script:
-- define the library use _Filer : script "Filer_v1r0" -- defined upon compilation -- call a library handler set {targetPath, showingInvisibles, usingQuotedForm} to {"/Users/stanc/Desktop/", false, true} set {dirList, errText} to _Filer's directoryList(targetPath, showingInvisibles, usingQuotedForm)
Try this variation, which defines (and clears) the library property upon execution of the script:
-- define the library property _Filer : missing value set _Filer to script "Filer_v1r0" -- defined upon execution -- call a library handler set {targetPath, showingInvisibles, usingQuotedForm} to {"/Users/stanc/Desktop/", false, true} set {dirList, errText} to _Filer's directoryList(targetPath, showingInvisibles, usingQuotedForm) -- clear the library when done set _Filer to missing value
Other than the differences in retention, functionality would be the same, I believe. Both load a property with library code using the script keyword. The error generated by the code below seems to confirm that the use and property commands are equivalent:
-- define the library, twice use _Filer : script "Filer_v1r0" property _Filer : missing value --> AppleScript Compile Error --> The _Filer property is specified more than once. --> error number -2751
Regards, Stan C.
|