Hey guys. Try this.

<applescript>
set targetApp to "PowerMail"
tell application "System Events"
        set processExists to exists process targetApp
end tell


if processExists is true then
        tell application "PowerMail"
                repeat with i from 1 to (count of windows)
                        try
                                if window i is modified then
                                        close window i with saving
                                end if
                        end try
                end repeat
                quit
        end tell
end if
</applescript>

Andy

-- 
Andy Fragen

On Fri, Jul 14, 2006, Wayne Brissette said:

>An open window is not considered a message, because it's not a message
>there isn't any way to use any of the standard AppleScript commands on
>the window. So, you have to use the Window commands. While there are a
>bunch of window commands, one is not save or save as draft.






Reply via email to