• 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: Newbie search replace problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie search replace problem


  • Subject: Re: Newbie search replace problem
  • From: Bernard Azancot <email@hidden>
  • Date: Sat, 11 Nov 2006 11:54:09 +0100

Quick and neat !
Thanks Michael.



Le 11 nov. 06 à 10:30, Michael Ghilissen <email@hidden> wrote:

Bonjour Bernard,

Nice !


Here is one way with regular expressions.

Note that {2,} allows for 2 or more occurrences 'new line'. You can
adapt to your specific need, or simply use (\\n\\n). Also note that
you may have to try with '\\p' or '\\r'  depending on how the new
line is coded in the original text.

set theText to "  aaa


aaa

aaa


b " tell application "TextCommands" set theNewtext to theText as Unicode text set the theNewtext to (search theNewtext for "(\\n){2,}" replacing with "\\n" with regex) end tell theNewtext

HTH,

Michael


On Nov 11, 2006, at 3:40 AM, Bernard Azancot wrote:

I have written a simple  cleaning search replace TextEdit script,
using the excellent TextCommands osax.

I would like to add a double CR, by a simple one, replacement, to
this script.

Any suggestion will be appreciated.
Thx in advance.

_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
  • Prev by Date: Re: Newbie search replace problem
  • Next by Date: Re: Security Movie
  • Previous by thread: Re: Newbie search replace problem
  • Next by thread: Icon Files - Where?
  • Index(es):
    • Date
    • Thread