• 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: Thu, 9 Oct 2008 11:57:00 -0700

On Oct 9, 2008, at 11:52 AM, Christopher Nebel wrote:

This certainly works (there are variants, but they boil down to the same thing), but realize that it's often not necessary.  For instance, if you wanted to set the current printer to the one selected from the list, the printer name would be sufficient, and actually superior to the index:

tell application "Printer Setup Utility"
set myList to name of every printer
tell me
choose from list myList
end tell
set newPrinterName to item 1 of the result
set current printer to printer newPrinterName
end tell

I was going on the assumption that he needed the number for some reason.

Question about your code.  Why not this:

set current printer to printer (get item 1 of the result)

-- Michelle

-- 
Anyone who has ever used SCSI knows there are totally valid technical reasons to sacrifice a chicken.


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

  • Prev by Date: Re: Getting the row number of an item in a list
  • Next by Date: Passing a Applescript Result to a FileMaker9 Variable
  • Previous by thread: Re: 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