Re: Detect if third word in string contains a number
Re: Detect if third word in string contains a number
- Subject: Re: Detect if third word in string contains a number
- From: theDaniel <email@hidden>
- Date: Mon, 07 May 2012 11:33:21 -0400
Hi Folks,
Thank-you Shane and Michelle. I its really simple, now that I see it, but I don't have very good applescript skills nor do I have an intuitive mind so I never understood how to coerce something to something else. But maybe I have a better idea now.
I'm GUI scripting with multiple conditionals so I'll probably get stumped again. Thanks again!
-Daniel On May 6, 2012, at 10:12PM, Shane Stanley wrote: You try to coerce it to a number:
try (word -1 of _selection) as number say "contains a number" using "Bruce" on error say "contains no numbers" using "Victoria" end
On May 7, 2012, at 12:05AM, Michelle Steiner wrote: On May 6, 2012, at 7:07 PM, theDaniel wrote: How can I make this work?:
set _selection to "I am 12"
if word 1 of _selection is "I" then try word 3 of _selection as number say "contains a number" using "Bruce" on error say "contains no numbers" using "Victoria" end try end if
|
_______________________________________________
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