Hi, thanks I want to batch process a couple of hundreds of mails. I was thinking on something like set this.item to editable. So this means, if the messages contains the search text, I need to open it in a seperate window, bring that window to front and continue replacing the unwanted text with something else. Oh man .....
Thanks anyway and all the best Matthias ----------------------------------------------- Admilon Consulting GmbH http://www.admilon.com Tel. +81-736-56-3905 ----------------------------------------------- Am/On Sun, 30 Jul 2006 10:31:56 -0700 schrieb/wrote Dave Nathanson: >Hi, > I asked a similar question some time ago & after some minor mods, now >use the script below. This is the script I used to use with Claris >Emailer to edit/change incoming messages. > >Before running this script, highlight all the message text, copy & paste >into any other place to edit it. Then highlight all the replacement text, >and run the script to replace ALL the message text with whatever text you >have on the clipboard. Anyway, the net result is that it works to edit >incoming messages. > >as always: watch the line breaks! > >Replace ALL text with Clipboard >========================================= >-- Script to replace message of open PowerMail message with clipboard contents >-- Adapted by Dave Nathanson with help from Cheshirekat; based on script for >-- Claris Emailer by Allen Watson, 5/25/99 > >tell application "PowerMail" > activate > try > set theMsg to the displayed message of the front window > on error > display dialog "There must be an open message for this script > to work" > return > end try > try > set theCopy to (the clipboard) as text > on error > display dialog "Cannot access clipboard; may be empty." > end try > if length of theCopy = 0 then > display dialog "Clipboard empty; nothing to replace WITH" > return > end if > try > set snippet to text 1 thru 60 of (theCopy as text) > on error > set snippet to theCopy as text > end try > display dialog "Choose: Replace entire message contents with clipboard? >or replace selection? >1st 60 characters are: " & snippet buttons {"Contents", "Cancel"} default >button 1 > set theChoice to button returned of result > if theChoice = "Cancel" then return > if theChoice = "Contents" then > set the content of theMsg to theCopy > else > set theWindow to the front window > set theSel to selection of theWindow > set howLong to length of theSel > if howLong = 0 then > display dialog "Nothing selected." > return > end if > set theWhole to content of theMsg > set whereTo to (offset of theSel in theWhole) > --Pick out parts before and after theSel; handle when first/last >character selected > if whereTo <= 1 then > set partA to "" > else > set partA to text 1 thru (whereTo - 1) of theWhole > end if > if (whereTo + (length of theSel)) >= (length of theWhole) then > set partB to "" > else > set partB to text (whereTo + howLong) thru -1 of > theWhole > end if > set theNew to partA & theCopy & partB > set the content of theMsg to theNew as text > end if >end tell >============================================== > >Hope this helps. > >Best, > Dave Nathanson > Mac Medix > >in reply to ([EMAIL PROTECTED]), Matthias Schmidt's message of 7:19 >AM, 7/30/06 > >>Hello, >> >>a question for the AppleScript Gurus: >>how can I set a received message to "write". >>I want to change some predefined text in a couple of received mails. >>Is that possible? >> >>All the best >> >>Matthias >> >>----------------------------------------------- >>Admilon Consulting GmbH >> http://www.admilon.com >>Tel. +81-736-56-3905 >>----------------------------------------------- >> >> > > > >

