Title: Re: Entourage AppleScript for the "Rules" option [LONG SCRIPT]
On 12/9/00 14:31, Allen Watson wrote:
> What follows is a quick modification of an older script. It will save any
> selected messages as individual Simple Text files (see the comments to change
> to use BBEdit or Tex-Edit or even Entourage files).
And what follows here is another take on this. This script also works only with selected messages, but simply uses Entourage's default text format (which is SimpleText), then calls on Finder to change it only if necessary.
See the comments for customization.
George
property saveFolder : ""
(* Leave saveFolder as above, and you'll be asked
the first time you run the script for a folder to
save messages in. Thereafter that folder will be
used. If you want to select a folder each time,
change this to "ask"
*)
property creatorCode : ""
(*
Use "TBB6" as the creatorCode for TexEdit+,
or "R*ch" for BBEdit, or whatever creator
code you prefer. Leave blank (i.e., "") to create a
SimpleText file, the default type in Entourage
*)
-- check to be sure the chosen folder, if any, still exists
if saveFolder is not "" and saveFolder is not "ask" then
set temp to saveFolder as string
try
set temp to temp as alias
-- we could use Finder's exists, but this amounts to the same thing
on error
set temp to "The folder you had previously chosen no longer seems to exist. "
set temp to temp & "Do you want to set a new permanent folder, or do you "
set temp to temp & "want to be asked each time for a folder?"
display dialog temp buttons {"Set Permanent", "Ask Me"} default button 1
if button returned of result is "Ask Me" then
set saveFolder to "ask"
else
set saveFolder to ""
end if
end try
end if
if saveFolder is "" or saveFolder is "ask" then
set tempFolder to (choose folder with prompt "Select folder for saving messages")
if saveFolder is "" then set saveFolder to tempFolder
else
copy saveFolder to tempFolder
end if
set tempFolder to tempFolder as string
tell application "Microsoft Entourage"
set themsgs to current messages
if themsgs is {} then error "No messages selected!"
repeat with themsg in themsgs
save themsg in tempFolder as text
end repeat
end tell
if creatorCode is not "" then
tell application "Finder"
set oldFiles to {}
try
set oldFiles to name of every file in folder tempFolder
end try
set waitCount to (count of oldFiles) + (count of themsgs)
repeat
try
set newFiles to name of every file in folder tempFolder
if (count of newFiles) = waitCount then exit repeat
end try
end repeat
repeat with thefile in newFiles
if oldFiles does not contain thefile then
set creator type of file (tempFolder & thefile) to creatorCode
end if
end repeat
end tell
end if
- Entourage AppleScript for the "Rules" option Alex Bottinelli
- Re: Entourage AppleScript for the "Rules" o... Allen Watson
- George Clark
