Re: Offset in paragraphs
Re: Offset in paragraphs
- Subject: Re: Offset in paragraphs
- From: "Arthur J Knapp" <email@hidden>
- Date: Fri, 17 Nov 2000 11:55:48 -0500
>
Date: Fri, 17 Nov 2000 10:04:24 +1200
>
From: Stephen Fitchett <email@hidden>
>
Subject: Offset in paragraphs
>
Is there any way of getting an offset of something in paragraphs, not
>
characters, preferably without any third party OSAX? I'm making a
>
conversation simulater in AppleScript and I need to get the offset in
>
paragraphs to generate a reply properly.
set the_paragraphs to "abc" & return & "def" & return & "ghi"
set find_this to "e"
GetLineIndex(the_paragraphs, find_this)
to GetLineIndex(str, sub)
repeat with x from 1 to count of paragraphs in str
if paragraph x of str contains sub then return x
end repeat
return 0
end GetLineIndex
>
conversation simulater in ...
Simulating conversation, are we? Kind of sounds like what
AppleScript thinks it's doing. ;-)
--
{
Arthur J Knapp, of STELLARViSIONs ;
http://www.STELLARViSIONs.com ;
mailto:email@hidden ;
http://developer.apple.com/techpubs/
macos8/InterproCom/AppleScriptScripters/
AppleScriptLangGuide/
}