• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Offset in paragraphs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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/
}


  • Prev by Date: Re: coerce lists to records
  • Next by Date: Re: coerce lists to records
  • Previous by thread: Re: Offset in paragraphs
  • Next by thread: re: Offset in paragraphs
  • Index(es):
    • Date
    • Thread