On Fri, Mar 12, 2004, the following words from Don V. Zahniser
[EMAIL PROTECTED], emerged from a plethora of SPAM ...
>Any chance of adapting this to use AppleWorks?
>
>I've poked around but the combination of my Applescript illiteracy with
>the variability of the Applescript dictionary between applications is
>beyond me at the moment...
>
>TIA
>
> -- -- -- -- -- -- --
> Don V. Zahniser
> <[EMAIL PROTECTED]>
>
>On Monday, March 8, 2004, Andy Fragen said:
>
>>Ask and you shall receive.
>>
>>====
>>tell application "PowerMail"
>> set theMessages to current messages
>> repeat with msg in theMessages
>> set s to source of msg
>> tell application "BBEdit"
>> make new window
>> set contents of front window to s
>> end tell
>> end repeat
>>end tell
>>====
>>
>>====
>>tell application "PowerMail"
>> set theMessages to current messages
>> repeat with msg in theMessages
>> set s to source of msg
>> tell application "TextEdit"
>> make new document at the beginning of documents with
>> properties {text:s}
>> end tell
>> end repeat
>>end tell
>>====
>
<Begin AppleScript>
to makeDoc from the msgSource
tell application "AppleWorks 6"
make new document at beginning with data the msgSource
end tell
end makeDoc
tell application "PowerMail"
set the msgList to the current messages
repeat with varMsg in the msgList
set the msgSource to the source of the varMsg
makeDoc of me from the msgSource
end repeat
end tell
<End AppleScript>
If you use the free and scriptable script/text editor, Smile:
<Begin AppleScript>
to makeDoc from the msgSource
tell application "Smile"
set the newWin to make new text window at front
set text of the newWin to the msgSource
end tell
end makeDoc
tell application "PowerMail"
set the msgList to the current messages
repeat with varMsg in the msgList
set the msgSource to the source of the varMsg
makeDoc of me from the msgSource
end repeat
end tell
<End AppleScript>
View the message source in Word X:
<Begin AppleScript>
to makeDoc from the msgSource
tell application "Microsoft Word"
set the newMWdoc to make new document
set the text of the front document to the msgSource
end tell
end makeDoc
tell application "PowerMail"
set the msgList to the current messages
repeat with varMsg in the msgList
set the msgSource to the source of the varMsg
makeDoc of me from the msgSource
end repeat
end tell
<End AppleScript>
To use the shareware text editor, Style:
<Begin AppleScript>
to makeDoc from the msgSource
tell application "Style"
make new document at beginning with data the msgSource
end tell
end makeDoc
tell application "PowerMail"
set the msgList to the current messages
repeat with varMsg in the msgList
set the msgSource to the source of the varMsg
makeDoc of me from the msgSource
end repeat
end tell
<End AppleScript>
Finally, here's a script to view the message source in PowerMail instead
of having to use another application.
<Begin AppleScript>
property deleteReminder : "DELETE ME AFTER VIEWING!!"
to showSource from the msgSource
tell application "PowerMail"
set the tempMsg to make new message with properties {subject:the
deleteReminder, content:the msgSource}
open the tempMsg
end tell
end showSource
tell application "PowerMail"
set the msgList to the current messages
repeat with varMsg in the msgList
set the msgSource to the source of the varMsg
showSource of me from the msgSource
end repeat
end tell
<End AppleScript>
Hope this helps. I like having the same script work with different
applications (if possible) when I'm away from a power source. My 15"
G4 867 PowerBook battery drains quickly if I open too many apps as I tend
to do when home and connected to power. (I won't confess to how many
applications were open earlier today when I was in the other room
creating a new FileMaker Pro database for the hubby. I was too lazy to
grab the AC adapter but still had 30% power after 3 hours when the new
database was finished.) Having scripts that can utilize an already open
application really helps.
--
Sometimes even to live is an act of courage.
- Lucius Annaeus Seneca, writer and philosopher
* 867 PowerBook G4 * OS X 10.2.6 * 768 MB Ram *