I am looking for scripts to encrypt and decrypt messages in PowerMail by
using PGP 8 Freeware.

I've found some that require Frontier. But they don't run under Mac OS X.

How do I have to modify these scripts, so that they works without the
Frontier extensions?

Thank's for your help

Ruediger

--Use with caution. This will replace the contents of your
--message permanently with the decrypted information.

tell application "PowerMail"
        set theMessages to current messages
        repeat with msg in theMessages
                --              if status of msg is not draft then
                --                      display dialog "PGP Error: You can only 
encrypt outgoing message."
with icon stop buttons {"Cancel"} default button 1
                --              else
                try
                        set windowContent to content of front window as Unicode 
text
                        set messageNum to ID of displayed message of front 
window
                on error
                        set windowContent to ""
                end try
                if (count of every recipient of front window) is not 0 then
                        set windowRecipientsList to address of address of every 
recipient of
front window
                else
                        set windowRecipientsList to {}
                end if
                if windowContent is not "" then
                        -- Encrypt and sign the content
                        tell application "PGP"
                                activate
                                set windowContent to encrypt and sign text 
windowContent to
windowRecipientsList
                        end tell
                        activate
                        set AppleScript's text item delimiters to the ASCII 
character 10
                        try
                                set the lineList to every text item of 
windowContent
                                set AppleScript's text item delimiters to the 
return
                                set windowContent to the lineList as string
                                set AppleScript's text item delimiters to ""
                                try
                                        set content of front window to 
windowContent
                                on error
                                        try
                                                set content of message id 
messageNum to windowContent
                                        on error
                                                make new message with 
properties {content:windowContent}
                                        end try
                                end try
                        on error
                                set AppleScript's text item delimiters to ""
                        end try
                else
                        display dialog "PGP Error: There is nothing to encrypt 
& sign." with
icon stop buttons {"Cancel"} default button 1
                end if
                --              end if
        end repeat
end tell


Reply via email to