Unwrap Lines

2001.03.08 

 

http://www.barefeetware.com/appleworks/unwrap/

Description

 

This AppleWorks command combines consecutive paragraphs of the selected text. Useful for removing hard returns from pasted email messages.

Enhancement
Pack

 

This is one of 40 features in the Enhancement Pack for AppleWorks.

     


Detail
The “Unwrap Lines” item is in the “Text” sub-menu of AppleWorks Scripts Menu.

Select some paragraphs that contain “hard” returns, then run this script. It joins consecutive paragraphs (ie empty paragraphs are not changed) of the selected text. The paragraphs are joined by deleting the return character between them. If the preceding paragraph does not end with a space, one is inserted.

Useful for removing hard returns from pasted email messages or web page text.

Sample
Before:
This text is an example of what you might paste in
from an email message or web page. Note that
there are carriage returns in the middle of
sentences.

The line above is empty, so will be treated by the
Unwrap Lines script as a true paragraph break.

After:
This text is an example of what you might paste in from an email message or web page. Note that there are carriage returns in the middle of sentences.

The line above is empty, so will be treated by the Unwrap Lines script as a true paragraph break.

Requirements
Operates on the selected text in a word processing document or text frame.

This script works with AppleWorks 6 and AppleWorks 5.

Only registered users are permitted to use the supplied files after 14 days or edit them.

Download
This script is included in the Enhancement Pack for AppleWorks, not supplied separately.

Scripting
You don’t need to open this script to use it, but you can if you are curious. This script is editable. Some significant lines of code are:

repeat with charN from textLength - 1 to 2 by -1
   set thisChar to character charN in oldText
   if thisChar is return and character (charN + 1) in oldText is not return then
     set previousChar to character (charN - 1) in oldText
     tell application "AppleWorks 6"
       if previousChar is space then
         delete character charN in textRef
       else if previousChar is not return then
         set character charN in textRef to space
       end if
     end tell
   end if
end repeat


© 2000 BareFeetWare

Please email us any queries about this page.