Am sending an OE message to a list of readers (stored in a FileMaker 5 database) using AppleScript. That script places text from FileMaker in the Contents field of the OE message. If e-mail addresses or URLs are included in the text, OE converts them into links which work on Macs but not on Windows machines. So, created an HTML version of the message text (in SimpleText) but couldn’t place the HTML code in the Contents field in OE.
Next, downloaded Send Complex HTML E 1.1 by Paul Berkowitz and attempted to adapt it to use with OE instead of Entourage. Adapted script does everything but place the HTML code (from the SimpleText document) in the Contents field of the OE message.
Next, searched the net for a URL to download Send Complex HTML OE 1.0.0 by Steve Friesen. However, the 2 URLs that I found no longer work. Could someone point me to a URL which still works? Or, is there a better solution that I’m overlooking?
Model: PowerBook G4
AppleScript: 1.8.3
Browser: iCab 3.0.5; Macintosh; U; PPC Mac OS)
Operating System: Mac OS 9.2.x
Never did find a URL to download Send Complex HTML OE 1.0.0 by Steve Friesen. So, continued modifying Send Complex HTML E 1.1 by Paul Berkowitz until the following version finally did the job.
(* Trigger this script from a button in theDatabase. *)
(* Set the parent folders of theFileName. *)
set Drive to "PwrBk G4" & ":"
set Folder1 to "FILES" & ":"
set Folder2 to "CI" & ":"
set Folder3 to "CORDILLERA INSTITUTE" & ":"
set Folder4 to "VFC" & ":"
(* Describe the file path to theFileName. *)
tell application "FileMaker Pro 5.5"
set Folder5 to cell "Publications::Folder" of current record & ":"
set theFilePath to (Drive & Folder1 & Folder2 & Folder3) as string
set theFilePath to (theFilePath & Folder4 & Folder5) as string
set theFileName to cell "Publications::Template" of current record
set theFile to (theFilePath & theFileName)
set theFileAlias to theFile as alias
-- count the found records in theDatabase
set theRecordsFound to count of records
end tell
(* Set the HTML code in theFile as the content of newMessage. *)
try
set theFileRefNo to (open for access theFileAlias without write permission)
set theHTML to read theFileRefNo
close access theFileRefNo
on error strError number numberError
try
close access theFileAlias
end try
error (strError & return & return & numberError)
end try
repeat with x from 1 to theRecordsFound
(* Set the source fields for newMessage. *)
tell application "FileMaker Pro 5.5"
go to record x
set theContactName to cell "Contacts::Contact Name" of current record
set theEMailAddress to cell "Contacts::EMail Address" of current record
set theTo to theContactName & " <" & theEMailAddress & ">"
set theSubject to cell "Publications::Subject" of current record
end tell
(* Prepare newMessage to send later. *)
tell application "Outlook Express 5.02"
activate
set newMessage to make new outgoing message at out box folder with properties {recipient:theTo, subject:theSubject, content:theHTML, has html:true}
end tell
end repeat
return
The current problem is that the script leaves theFile as read-only. How do I restore ‘write permission’ to theFile? Also, any suggestions to simplify or improve the above script would be much appreciated.