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

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


  • Subject: Re: trying to build text in an applescript to point to a variable
  • From: Philip Aker <email@hidden>
  • Date: Fri, 12 Sep 2008 11:33:28 -0700

On Sep 12, 2008, at 11:18 AM, David A. Cox wrote:

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

set noun to "Hoover"
set HList to {"Hankering", "Horrible", "Helping handed", "Harping", "Hardboiled", "Hairbrained", "Hippity Hoppity", "Hatchet nosed"}
--set adj to first word of (some item of HList)
set adj to some item of HList
adj & space & noun


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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

References: 
 >trying to build text in an applescript to point to a variable (From: "David A. Cox" <email@hidden>)

  • Prev by Date: trying to build text in an applescript to point to a variable
  • Next by Date: Re: trying to build text in an applescript to point to a variable
  • Previous by thread: trying to build text in an applescript to point to a variable
  • Next by thread: Re: trying to build text in an applescript to point to a variable
  • Index(es):
    • Date
    • Thread