Re: Unwrapping mail
Re: Unwrapping mail
- Subject: Re: Unwrapping mail
- From: Dan Doughtie <email@hidden>
- Date: Sat, 29 Jul 2006 21:27:42 -0400
- Thread-topic: Unwrapping mail
Title: Re: Unwrapping mail
To keep from using third party apps I simply do a search and replace of any punctuation (the replace routine that Apple had on the AppleScripting site) that is followed by a return with wildcards. Then strip out any remaining returns, then replace the wild cards with the original punctuation and a return. Doesn’t do well with headlines etc that have no punctuation but you can sometimes guess that headlines would be on the first two lines and to ignore the first two lines. I also add logic to strip out brackets and such that sometimes mess up emails that have been forwarded.
But for the most part I use this for cleaning up emailed stories for editors. Saves considerable amount of time and doesn’t require the editor to have any special software.
Dan
From: Michelle Steiner <email@hidden>
Reply-To: Applescript Users <email@hidden>
Date: Sat, 29 Jul 2006 19:25:51 -0400
To: Applescript Users <email@hidden>
Conversation: Unwrapping mail
Subject: Unwrapping mail
There is no convenient way to unwrap text in email. Mail softwraps text in outgoing messages, but many servers, list servers, and clients convert them to hard wrapped text. There is a utility called Smartwrap that handled this, but it is broken under Tiger. This script will do a simple unwrap; it is not as sophisticated as Smartwrap, but it can handle simple jobs.
It takes advantage of the freeware TextWrangler from Bare Bones Software.
To use the script, select the text in an outging message window, and run the script.
tell application "Mail"
activate
set the clipboard to ""
tell application "System Events" to keystroke "c" using command down
my unwrap()
activate
tell application "System Events" to keystroke "v" using command down
end tell
to unwrap()
tell application "TextWrangler"
set foo to make new document
set the contents of foo to the clipboard
select the text of foo
remove line breaks the selection
copy the selection
close foo saving no
end tell
end unwrap
--
Failure is not an option. It comes bundled with the software.
_______________________________________________
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
_______________________________________________
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