• 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: TextEdit find/replace script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEdit find/replace script


  • Subject: Re: TextEdit find/replace script
  • From: Rob Stott <email@hidden>
  • Date: Mon, 16 Oct 2006 12:31:53 +0100


On 16 Oct 2006, at 11:36, Bernard Azancot wrote:

Ihave written a very simple script performing the correction of OCR mistakes in a TextEdit RTF file.

Il use TextCommands osax.


Hi,

I think (or rather "guess", since my French is very bad) that the others have already mentioned that there is no 'change' command in either TextEdit or TextCommands. Not sure where you got that from!


This won't win any prizes, but should do the job...

tell application "TextEdit"
tell front document
set theText to text 1
set text 1 to my replaceTheText(theText, " cie ", " de ")
end tell
end tell

on replaceTheText(theText, theFromString, theToString)
tell application "TextCommands"
search theText for theFromString replacing with theToString
end tell
end replaceTheText


...bear in mind that it won't respect any text formatting though.

Hope that's of some help.

r.






---

Rob Stott
Production Workflow Developer

Watt Gilchrist Ltd
Albion Mills, Albion Road 
Bradford, BD10 9TQ 

http://www.gilchrist.co.uk
Internal extension: 467



 _______________________________________________
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

  • Follow-Ups:
    • Re: TextEdit find/replace script
      • From: Bernard Azancot <email@hidden>
References: 
 >TextEdit find/replace script (From: Bernard Azancot <email@hidden>)

  • Prev by Date: Re: SCRIPTING INDESIGN: Question About Labels
  • Next by Date: Re: TextEdit find/replace script
  • Previous by thread: Re: TextEdit find/replace script
  • Next by thread: Re: TextEdit find/replace script
  • Index(es):
    • Date
    • Thread