Re: text item delimiter
Re: text item delimiter
- Subject: Re: text item delimiter
- From: David Marshall <email@hidden>
- Date: Fri, 29 Apr 2005 22:52:16 -0400
Well, I'm quite early on the AppleScript learning curve, so my
solutions are rarely as elegant as most of the others I read, and
probably frighteningly inefficient, but it's sure fun to take a pause
from digest reading after coming across this sort of question, and try
rolling my own before seeing what others have done.
Having dabbled in C for a brief spell a while back, I came up with an
ASCII arithmetic approach:
set outputList to {}
set charsToChange to {49, 50, 51, 52}
set theText to "1, 2, buckle my shoe; 3, 4, knock at the door"
set theChars to characters of theText
repeat with n from 1 to count of theChars
set thisChar to item n of theChars
if (ASCII number thisChar) is in charsToChange then
set end of outputList to (ASCII character ((ASCII number thisChar) +
48))
else
set end of outputList to thisChar
end if
end repeat
outputList as string --"a, b, buckle my shoe; c, d, knock at the door"
- - - - -
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden