Re: jmlbeud ceararhtcs
Re: jmlbeud ceararhtcs
- Subject: Re: jmlbeud ceararhtcs
- From: Brennan <email@hidden>
- Date: Sun, 21 Sep 2003 19:49:51 +0200
On Sun, 21 Sep 2003 09:17:27 -0700, Walter Ian Kaye
<email@hidden> wrote:
>
The problem is that punctuation marks are being considered as word
>
breaks, so when you get the words of the string, you've lost them.
>
>
What you can do is the following:
>
>
set lastLetter to 0
>
repeat with w in (words of str)
>
set firstLetter to AtOffset(w, str, lastLetter + 1)
>
set lastLetter to firstLetter + (length of w) - 1
>
--do your stuff here
>
>
end repeat
>
>
>
on AtOffset(find, within, beg)
>
local find, within, beg, pos
>
try
>
set pos to offset of find in (text beg thru -1 of within)
>
if pos > 0 then
>
return pos + (beg - 1)
>
else
>
return 0
>
end if
>
on error
>
return 0
>
end try
>
end AtOffset
That's not working for me. It still seems to strip the punctuation. (Also
had to adjust because your 'firstletter' and 'lastletter' are indexes,
whereas mine are single character strings). Still, I can see where you're
coming from.
Brennan
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.