• 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
choose from list broken in leopard???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

choose from list broken in leopard???


  • Subject: choose from list broken in leopard???
  • From: Robert Poland <email@hidden>
  • Date: Sat, 3 Nov 2007 15:28:17 -0600

Hi,

Has the "choose from list" been broken with Leopard?

The script below no longer allows the use of number keys to select from the list. Entering the "2" key selects "1" and "2". Then it gets weirder as I click other numbers.

This script is for setting the index color of finder folder files.

set tiger to ((system attribute "sysv") ≥ 4159) -- <= 1039

tell application "Finder"
if exists Finder window 1 then -- make sure there is a window 
(* use variable for window so script doesn't get confused. Use "finder window" instead of "window" so if the front window in the Finder is an info window, the clipboard, a clipping window, etc., the script will work properly. *)
set wdw to Finder window 1
if selection is not {} then
set colorchoice to (label index of item 1 in (get the selection))
set colorchoice to colorchoice + 1
else
set colorchoice to 1 -- no selection, default to "none"
end if
else
tell application "System Events"
activate
beep
display dialog "There is no Finder Window" buttons "OK" default button 1 giving up after 2
return
end tell
end if


if tiger then
set theColorList to {"1-none", "2-orange", "3-red", "4-yellow", "5-blue", "6-purple", "7-green", "8-gray"}
else
set theColorList to {"none", "orange", "red", "yellow", "blue", "purple", "green", "gray"}
end if
set theDefaultList to text item colorchoice of theColorList


set theChoice to (choose from list theColorList default items theDefaultList with title "Color Selection" with prompt "Option key to select entire folder.")
if (theChoice is false) then return -- "User canceled."


-- get color selected
repeat with i from 1 to count theColorList
if item i of theColorList is in theChoice then
set myLabelIndex to i - 1
exit repeat
end if
end repeat


tell application "Extra Suites"
set optionKeyDown to (ES option down)
end tell


if optionKeyDown then
set the label index of the front window's items to myLabelIndex
else
repeat with eachItem in (get selection)
set the label index of eachItem to myLabelIndex
end repeat
end if
select {} -- deselect items
beep
end tell
Bob Poland - Fort Collins, CO



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: choose from list broken in leopard???
      • From: Robert Poland <email@hidden>
  • Prev by Date: Re: prevent user input question
  • Next by Date: Re: Crash with AppleMail on Leopard
  • Previous by thread: Re: AppleScript-Users Digest, Vol 4, Issue 526
  • Next by thread: Re: choose from list broken in leopard???
  • Index(es):
    • Date
    • Thread