• 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 Caps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEdit Find/replace Caps


  • Subject: Re: TextEdit Find/replace Caps
  • From: hd <email@hidden>
  • Date: Sun, 3 Jan 2010 18:41:26 +0000

tell application "TextEdit"
set char_count to count characters of document 1
repeat with x from 1 to char_count
	set next_letter to character x of document 1
	if next_letter is "a" then set character x of document 1 to "A"
end repeat
end tell

But this will probably be very slow with large documents.

Alternatively, unless you absolutely must use TextEdit, third-party text editors Tex-Edit Plus http://www.tex-edit.com/ (shareware) or TextWrangler http://www.barebones.com/products/textwrangler/ (free) both have scriptable tools to change capitalisation.

If it's a plain text file you could also use AS's file read-write commands and change the text using any number of the available GREP tools.

HTH





On 3 Jan 2010, at 09:32, ba95 wrote:

> In a simple search/replace script, in TextEdit, is it possible make the difference between lowercase and appercase (f. e. between "a" and "A").
>
> Example
> -- set TheText to my SearchReplace(TheText, "√®", "è")
>
> _______________________________________________
> 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/archives/applescript-users
>
> This email sent to email@hidden

 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

References: 
 >TextEdit Find/replace Caps (From: ba95 <email@hidden>)

  • Prev by Date: Re: Say "What?"
  • Next by Date: Re: Use AS operators dinamically
  • Previous by thread: Re: TextEdit Find/replace Caps
  • Next by thread: Re: TextEdit Find/replace Caps
  • Index(es):
    • Date
    • Thread