Re: items selected
Re: items selected
- Subject: Re: items selected
- From: Yvan KOENIG <email@hidden>
- Date: Sun, 23 Oct 2005 21:26:00 +0200
Le 23 oct. 2005 , à 21:15, Michelle Steiner a écrit :
On Oct 23, 2005, at 12:00 PM, Paul Berkowitz wrote:
tell application "Finder"
if the selection is not {} then
repeat with eachItem in (the selection as list)
set the label index of eachItem to 5
end repeat
end if
end tell
'selection' always is a list in the Finder - no need to coerce it, and
'repeat' for an empty list does not error nor waste any time, so the
'if'
clause is not necessary. This can therefore be pared down to
tell application "Finder"
repeat with eachItem in (get the selection)
set the label index of eachItem to 5
end repeat
end tell
Did you actually try your code?
tell application "Finder"
the selection
--> {folder "Applications" of startup disk of application "Finder",
folder "Developer" of startup disk of application "Finder", folder
"Library" of startup disk of application "Finder", folder "System" of
startup disk of application "Finder"}
count the selection
--> 0
class of the selection
--> property
count (the selection as list)
--> 4
end tell
Hello Michelle
It seems that you didn't read well the Paul's script.
He didn't wrote:
repeat with eachItem in (the selection)
BUT:
repeat with eachItem in (get the selection)
May you, try:
tell application "Finder"
count (get the selection)
end tell
Yvan KOENIG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden