Re: Speeding Up Script
Re: Speeding Up Script
- Subject: Re: Speeding Up Script
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 23 Nov 2000 01:02:18 -0800
On 11/23/00 12:45 AM, "Chris Nebel" <email@hidden> wrote:
>
Assuming all the calls are for unique items, you've got to find a faster way
>
to
>
get your answer. An item's position in its enclosing window (or the desktop,
>
in this case) is stored in the file's Finder info. The Finder lets you get
>
this, obviously, but so does "info for", which is faster than the Finder,
>
especially if you send the event to yourself. Try replacing your script with
>
this one:
>
>
on run filename
>
icon position of (info for file ((path to desktop as string) &
>
filename))
>
end run
If I may add, if Chris has no objection to using a 3rd-party scripting
addition, Akua Sweets' 'basic info for' is (much) faster again than 'info
for', principally because it doesn't try to get the size of the file, just a
few basic properties including the position. So, with Akua Sweets installed
in Scripting Additions folder:
on run fileName
finder location of (get basic info for alias ((path to desktop as
string) & filename))
end run
--
Paul Berkowitz