Re: items selected
Re: items selected
- Subject: Re: items selected
- From: Robert Poland <email@hidden>
- Date: Sun, 23 Oct 2005 13:21:22 -0600
In general I've had best luck by asking simply for "selection" which
will return a list of items. Sometimes it seems you can apply
property settings directly to the list, and sometimes you have to
enumerate them. Does this do something like what you're ultimately
looking for?
tell application "Finder"
set myLabelIndex to 3
set myItems to selection
repeat with thisItem in myItems
set label index of thisItem to myLabelIndex
end repeat
end tell
On Oct 23, 2005, at 1:19 PM, Robert Poland wrote:
tell application "Finder"
activate
if window 1 contains items selected then beep 3
end tell
Thanks to both of you. Here is the finished product. I activate it
with an iKey shortcut combo. Works great.
(* set_Label_Index - 10/23/05 - Change label colors - with help
from and Daniel Jalkut <email@hidden>Michelle Steiner
<email@hidden>
*)
tell application "Finder"
set theDefaultList to {"none"}
set theColorList to {"none", "orange", "red", "yellow",
"blue", "purple", "green", "gray"} (* 0 = none , 1 = orange, 2 = red,
3 = yellow, 4 = blue, 5 = purple, 6 = green, 7 = gray *)
set theChoice to (choose from list theColorList default items
theDefaultList with prompt "Select desired index color.")
-- get color selected
repeat with i from 1 to number of items in theColorList
if item i of theColorList is in theChoice then set
myLabelIndex to i - 1
end repeat
if the selection is not {} then
repeat with eachItem in (the selection as list)
set the label index of eachItem to myLabelIndex
end repeat
else
set folder1 to window 1
tell application "Finder" to set label index of every
file of folder1 to myLabelIndex
tell application "Finder" to set label index of every
folder of folder1 to myLabelIndex
end if
end tell
--
Bob Poland - Fort Collins, CO
http://www.ibrb.org/
_______________________________________________
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