• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Existing Entourage Message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Existing Entourage Message


  • Subject: Re: Existing Entourage Message
  • From: Jamie Jordan <email@hidden>
  • Date: Sun, 16 Sep 2001 18:05:49 -0400

Here9s the final script. It may not be the best but it works. You can
select a message that you have received, reply to it which opens a 3draft2
message, then you pick the script below from the Entourage Script menu. It
attaches 2 documents and then inserts text in the body of the message. Many
thanks to Jolly Roger and to Paul Berkowitz.

I do have a question however about the variables. If you put the line

set theFile to alias {startupDiskName & ":Desktop Folder:Email Scripts:Agent
Cover Note Text"}

Inside the tell application 3Finder2 section it says 3theFile2 is not
defined. How come?

Script starts here:


set startupDiskName to ""
set theAttachments to {""}
set theFile to ""

tell application "Finder"
set startupDiskName to name of startup disk
set theAttachments to {startupDiskName & ":Desktop Folder:Email
Scripts:emInvoice.doc", startupDiskName & ":Desktop Folder:Email
Scripts:emCHStudAppAttch.doc"}
end tell

set theFile to alias {startupDiskName & ":Desktop Folder:Email Scripts:Agent
Cover Note Text"}

tell application "Microsoft Entourage"

activate

if class of window 1 is draft window then

set theMsg to window 1

end if

repeat with i from 1 to (count theAttachments)
set theAttachment to item i of theAttachments
make new attachment at theMsg with properties {file:theAttachment}
end repeat
end tell

insertFile(theFile)

on open (fileList)
repeat with theFile in fileList
insertFile(theFile)
end repeat
end open

on insertFile(theFile)

try
set fileRef to open for access theFile
set textToInsert to read fileRef
on error errString
display dialog "There was an error reading the file because:" &
errString ,
buttons {"OK"}
return
end try

try

end try

try
tell application "Microsoft Entourage"
set selection to textToInsert
end tell
on error errString
display dialog "This script can only insert into the body of a
message" buttons {"OK"}
return
end try
end insertFile





Jamie Jordan
Founder & Developer
--
macs@work
Helping People Who Choose Macintosh
@work, @home, @school, @play

http://www.macs-at-work.com


  • Follow-Ups:
    • Re: Existing Entourage Message
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: How to wait for a PostScript file to finish it's creation?
  • Next by Date: Re: Creating list references in handlers. Bad code or bug?
  • Previous by thread: Re: Existing Entourage Message
  • Next by thread: Re: Existing Entourage Message
  • Index(es):
    • Date
    • Thread