I have the following script to send emails via Outlook Express/Entourage;
property default_address : “whoever@wherever.com”
property mail_subject : “Client name”
global attachment_name
on open the_files
set attachment_name to name of (info for (the_files’s item 1))
tell me to activate
if mail_subject is "Client name" then
display dialog "Enter the subject:" default answer mail_subject
set the mail_subject to text returned of the result
end if
set the compression_setting to "No"
tell application "Microsoft Entourage"
activate
set MyMessage to make new draft window with properties ¬
{recipient:default_address, subject:attachment_name & " - " & mail_subject, attachment:the_files}
if class of window 1 is draft news window or class of window 1 is draft window then
tell window 1
try
set theNames to name of every attachment
on error
return -99 -- silent exit
end try
if (count theNames) > 1 then
set messageText to ""
repeat with aName in theNames
set messageText to messageText & return & tab & aName
end repeat
set messageText to messageText & return & return
else if (count theNames) = 1 then
set messageText to return & theNames & return & return
end if
set selection to messageText
end tell
end if
send MyMessage
end tell
tell application "Finder"
activate
end tell
end open
What I want it to do is ask the client name each time you run the script, however, it holds the client name from the first time you entered it and doesn’t give an option to change it. How do I reset this variable each time I drag and drop a file?
Also, would it be possible to attach this script to a watched folder that cycles through the list of files and sends each one as an individual email - they will only ever get sent to the one email address which hopefully makes it easier!
thanks!!