Re: Calling script libraries
Re: Calling script libraries
- Subject: Re: Calling script libraries
- From: Jon Pugh <email@hidden>
- Date: Thu, 18 Apr 2002 08:20:48 -0700
At 4:50 PM +1000 4/18/02, Malcolm Fitzgerald wrote:
>
I'd like to get some feed back on the best way to call script libraries.
Personally, I do it this way:
prop lib1alias : alias "foo:bar:baz"
prop lib1 : load script lib1alias
prop lib1moddate : modification date of info for lib1alias
on run
try
set newerdate to modification date of info for lib1alias
if newerdate > lib1moddate then
set lib1 to load script lib1alias
set lib1moddate to newerdate
end if
end try
tell lib1
-- do stuff
end
end
This loads the script at compile time so you don't need a copy of the libraries when moving the script, but if the library exists and is newer, then it will update automatically when run.
I think it is about the best strategy you can use for this sort of thing.
Jon
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.