Re: trying to build text in an applescript to point to a variable
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
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