• 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
Re: Getting the row number of an item in a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the row number of an item in a list


  • Subject: Re: Getting the row number of an item in a list
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 8 Oct 2008 19:23:27 -0700

On Oct 8, 2008, at 6:52 PM, Peter Baxter wrote:

tell application "Printer Setup Utility"
set myList to name of every printer
tell application "System Events"
choose from list myList
end tell
set newPrinter to --the number of the relevant printer in my list.  If I choose the 5th printer in the list, I get 5.
end tell

tell application "Printer Setup Utility"
set myList to name of every printer
tell application "System Events"
choose from list myList
end tell
set theSelection to item 1 of the result
end tell
repeat with i from 1 to count of myList
if item i of myList is theSelection then
set newPrinter to i
exit repeat
end if
end repeat

-- Michelle

-- 
"What we have in this country is socialism for the rich and free enterprise for the poor."  -- Gore Vidal


 _______________________________________________
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: Getting the row number of an item in a list
      • From: Christopher Nebel <email@hidden>
    • Re: Getting the row number of an item in a list
      • From: Peter Baxter <email@hidden>
References: 
 >Getting the row number of an item in a list (From: Peter Baxter <email@hidden>)

  • Prev by Date: Getting the row number of an item in a list
  • Next by Date: Re: Getting the row number of an item in a list
  • Previous by thread: Getting the row number of an item in a list
  • Next by thread: Re: Getting the row number of an item in a list
  • Index(es):
    • Date
    • Thread