• 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
trying to build text in an applescript to point to a variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trying to build text in an applescript to point to a variable


  • Subject: trying to build text in an applescript to point to a variable
  • From: "David A. Cox" <email@hidden>
  • Date: Fri, 12 Sep 2008 11:18:19 -0700

I am looking to choose a variable based on some user input. I thought it would be most efficient via something like what I have below, but it is not working for me, and I have not found a good way to get it to actually do what I want. Rather than get one of the items from the list that exists (what I want) I get a random letter from the name of the list. I can fully see why this is happening, but I am not seeing a way around this. If this is not possible, I can go the about the longer way of aiming at the list, but that will be sort of a pain with 26 lists to choose from.



set NounToUse to "Hoover"

set TheListToUse to (the first character of NounToUse) & "List"

set HList to {"Hankering", "Horrible", "Helping handed", "Harping", "Hardboiled", "Hairbrained", "Hippity Hoppity", "Hatchet nosed"}

set the list_count to the count of TheListToUse
set pick to random number from 1 to list_count
set AdjectiveToUse to item pick of TheListToUse as string

return AdjectiveToUse & " " & NounToUse

--Thanks for any help you can give....
_______________________________________________
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: trying to build text in an applescript to point to a variable
      • From: Eric C Saunders <email@hidden>
    • Re: trying to build text in an applescript to point to a variable
      • From: Philip Aker <email@hidden>
  • Prev by Date: Consternation resulting from trying to use Apple Mail as a Gmail IMAP Client
  • Next by Date: Re: trying to build text in an applescript to point to a variable
  • Previous by thread: Re: Consternation resulting from trying to use Apple Mail as a Gmail IMAP Client
  • Next by thread: Re: trying to build text in an applescript to point to a variable
  • Index(es):
    • Date
    • Thread