• 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: Search & Replace multiple Paragraph returns
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Search & Replace multiple Paragraph returns


  • Subject: Re: Search & Replace multiple Paragraph returns
  • From: has <email@hidden>
  • Date: Wed, 8 Jun 2005 19:48:41 +0100

doug rogers wrote:

>The handle returns the same text I load into the variable, and Hog Bay Notebook returns the error that it can't continue SearchReplaceText.
>
>tell application "Hog Bay Notebook"
>	set TheNewsItem to note of selected entry of notebook viewer 1
>	searchReplaceText("
>
>", "
>", TheNewsItem)
>end tell

To send the searchReplaceText message to your script instead of the object specified by the tell block, use 'searchReplaceText(...) of me', or its synonym 'my searchReplaceText(...)'.

I'd also suggest using regular expressions for stripping your multiple linebreaks/returns; it's much simpler, more flexible and more reliable than messing around with TIDs. Example:

tell application "TextCommands" -- [1]
    search TheNewsItem for "[\\r\\n]+" replacing with "\\r" with regex
end tell

HTH

has

[1] http://freespace.virgin.net/hamish.sanderson/index.html#textcommands
--
http://freespace.virgin.net/hamish.sanderson/
 _______________________________________________
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

  • Prev by Date: OT & Overlong: The Future of Orphaned Files...
  • Next by Date: Re: Binary math operations (and, or, etc.)
  • Previous by thread: Search & Replace multiple Paragraph returns
  • Next by thread: Search & Replace multiple Paragraph returns
  • Index(es):
    • Date
    • Thread