Re: Search & Replace multiple Paragraph returns
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