Re: AppleScript's text item delimiters have stopped working
Re: AppleScript's text item delimiters have stopped working
- Subject: Re: AppleScript's text item delimiters have stopped working
- From: "Mark J. Reed" <email@hidden>
- Date: Sun, 4 Jul 2010 07:28:03 -0400
"item 2" of a string is the second character. you want "text item 2".
On Sun, Jul 4, 2010 at 7:07 AM, tom wible
<email@hidden> wrote:
i have a top-level handler:
to extractValFrom(txt, delim)
log "extractValFromDelim(" & delim & ")"
set AppleScript's text item delimiters to {delim}
set val to item 2 of txt
set AppleScript's text item delimiters to DEFAULT_TID -- previously set
log "extractValFrom(" & txt & ")=" & val & "="
return val
end extractValFrom
which i call thusly:
extractValFrom("run longer =30", "=")
and there's what i get:
(*extractValFromDelim(=)*)
(*extractValFrom(run longer =30)=u=*)
this used to work, until i implemented s.o. constructors:-(
_______________________________________________
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
--
Mark J. Reed <
email@hidden>
_______________________________________________
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