Re: Setting labels of Finder items in Panther? You can, but... (coda)
Re: Setting labels of Finder items in Panther? You can, but... (coda)
- Subject: Re: Setting labels of Finder items in Panther? You can, but... (coda)
- From: Charles Arthur <email@hidden>
- Date: Thu, 30 Oct 2003 13:07:48 +0000
On Wed, 29 Oct 2003 14:47:55 +0000, Nigel Garvey
<email@hidden> wrote:
..
(re setting labels of Finder items..)
>
It's to do with the different ways the two Finders handle some reference
>
expressions. The result of *getting* the selection - or of setting a
>
variable to it - is, as you say, a list in both cases. And both Finders
>
can (apparently) set the label index of a file or of a list of files.
>
>
But in the expression 'label index of selection', 'selection' is a
>
reference to a property of the Finder, not a list as such. Before OS X,
>
'selection' would work as part of a longer Finder reference. In X, it
>
doesn't. You have to 'get' the selection first and then use the result.
>
This is annoying, but not uncommon in application scripting.
Fair enough. As a coda, the following *doesn't* work in the Panther Finder:
--for the situation where you have multiple items selected and want to
label them all the same, eg 2
tell application "Finder"
set theselection to selection -- yields multi-item list of references
set label index of every item of theselection to 2 --fails
end tell
..which the OS9 Finder was OK with, I believe. (Anyone care to check?)
Instead, you have to set up a repeat loop and label each item separately.
Don't know if it recognises items selected in separate Finder windows as
being properly selected for these purposes.. maybe try that later.
Still, labels are good. I foresee much cron-run scripts to tidy up my folders.
Charles
--
----------------------------
http://www.ukclimbing.com : 1100+ British crags, 350+ British climbing
walls - searchable by distance and anything else you care to think of -
with weather forecasts for every one, plus maps, articles, news and
features. And there's even a cool shop attached.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________
_______________________________________________
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.