• 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
Re: Calling script libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Calling script libraries (From: Malcolm Fitzgerald <email@hidden>)

  • Prev by Date: Re: Log out
  • Next by Date: RE: Log out
  • Previous by thread: Calling script libraries
  • Next by thread: Re: Calling script libraries
  • Index(es):
    • Date
    • Thread