Title: Bryan's "SelectATemplate" script
Just wanted to report that Bryan’s script for quickly pulling up any boilerplate/templates works brilliantly. It reads any and all emails that I have been placed into a root level folder called Templates. Running the script pulls up a separate window where all of them are listed, and I simply click on the one I want and presto. Thanks Bryan!
--
Scott
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

From: "Entourage:mac Talk" <[EMAIL PROTECTED]>
Date: Mon, 30 Oct 2000 20:00:01 -0800
To: "Entourage:mac Talk" <[EMAIL PROTECTED]>
Subject: Entourage-Talk Digest - 10/30/00

-- Open Template
-- script by Bryan Harris, [EMAIL PROTECTED], 30 October 2000

--
This script allows the user to select a template
-- from the "TEMPLATE" folder (at the root folder level).


tell application "Microsoft Entourage"
   
   activate
   
   with timeout of 600 seconds
       
       try
           set theMsgs to (every message of folder "TEMPLATES")
       on error
           display dialog "Can't find a \"TEMPLATES\" folder.  This script requires that there be a folder named \"TEMPLATES\" at the root folder level with messages in it to be used as templates." with icon stop
           return
       end try
       
       set theCount to count of theMsgs
       
       if theCount is 0 then
           display dialog "There are no templates in the \"TEMPLATES\" folder.  Please drag at least one message to that folder to use this script." with icon stop
           return
       end if
       
       set theSubs to {}
       
       repeat with theMsg in theMsgs
           set theSubs to theSubs & (subject of theMsg as string)
       end repeat
       
       set theTemp to (choose from list theSubs with prompt "Select a template:" without multiple selections allowed and empty selection allowed) as string
       
       set iFound to false
       set i to 0
       repeat until iFound
           set i to i + 1
           if i > theCount then
               display dialog "Script error 1.  Contact Bryan Harris ([EMAIL PROTECTED]) to report this." with icon stop
               return
           end if
           if (item i of theSubs) is theTemp then set iFound to true
       end repeat
       
       set theSubj to (subject of item i of theMsgs)
       set theCont to (content of item i of theMsgs)
       
       make new draft window with properties {subject:theSubj, content:theCont}
       
   end timeout
   
end tell

Reply via email to