• 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, delete all blank lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextEdit, delete all blank lines


  • Subject: Re: TextEdit, delete all blank lines
  • From: Axel Luttgens <email@hidden>
  • Date: Sat, 9 May 2009 10:52:02 +0200

Le 9 mai 09 à 08:13, Satyam Satyanarayana a écrit :

Hi, Is there a way using apple script to delete all the blank lines in the "rtf" file created by a TextEdit?

Hello Satyam,

TextEdit's AppleScript implementation is rather basic; so, unless I missed the way to devise a clever whose clause, this seems to be a prototype of the way to go with TextEdit:

tell application "TextEdit"
	tell text of document of front window
		repeat with P from (count of paragraphs) to 1 by -1
			if characters of paragraph P is {linefeed} then delete paragraph P
		end repeat
	end tell
end tell

HTH,
Axel _______________________________________________
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
  • Follow-Ups:
    • Re: TextEdit, delete all blank lines
      • From: John Masters <email@hidden>
References: 
 >RE: RE: Excel Save as text question (From: "Christian Sonntag <email@hidden>" <email@hidden>)
 >TextEdit, delete all blank lines (From: Satyam Satyanarayana <email@hidden>)

  • Prev by Date: TextEdit, delete all blank lines
  • Next by Date: Re: TextEdit, delete all blank lines
  • Previous by thread: TextEdit, delete all blank lines
  • Next by thread: Re: TextEdit, delete all blank lines
  • Index(es):
    • Date
    • Thread