Re: Generating an HTML email in Eudora...
Re: Generating an HTML email in Eudora...
- Subject: Re: Generating an HTML email in Eudora...
- From: Malcolm Fitzgerald <email@hidden>
- Date: Fri, 1 Nov 2002 09:20:23 +1100
Malcolm;
I agree with you 'violently'. But, what I generally do to generate
html is to create the html for each record in the database and then
prefix the header to the first record and append the trailer to the
last record. To simulate a Eudora mailbox, I need control over
carriage returns within the header. Within the rest of the file I
don't care if they are there or not.
I could play games with FileMaker (e.g. prefixing multiple records
with a special marker and then deleting them afterwards), but I'd
prefer to play games with AppleScript in this case.
As for the carriage returns between exported records, they don't do
any harm, but I don't really care if they are there or not (in this
case).
I see, you mean that FMP includes its own CRs but it won't let you
add YOUR CRs. Annoying isn't it ;-)
What you're trying to do is a common task (in its generic form). I
can't understand why FMP haven't developed a header and footer tool
that plonks a user defined header and/or footer onto the exported
records. And why can't they provide an option that expands the
option-tabs and carriage returns within the fields into tabs and
carriage returns?
I do a lot of exporting HTML from FMP and most of it is done using
Applescript as a post-processor. I run a set of TID transformations
over the file and it works beautifully (ie, fast, never fails).
They're called from within FMP so the export is a command-key combo.
The second method is basically the one I described earlier: the
master file calls a related file and the export contains one line of
master info and many lines of related info.
It is also possible to get Headers and Footers into the related file
by calculation :
if status(currentRecordNumber) = 1 then (Header)
and
status(currentRecordNumber) = status(CurrentFoundCount) then (Footer)
A third method is to build the content by looping
You need a global text field:
put the Header into the global text field
loop through the records, concat record values to global text field
concat Footer
Go to global text field and copy to clipboard
-- FMP hands ordinary CRs and tabs to the clipboard
-- so no transformation is needed
- David Crowe
I have been trying to find a solid way to generate an html email in
Eudora for some time, and I have finally come up with a solution I'm
comfortable with, so I thought I'd share it.
I had initially thought about changing the setting in Eudora
(<x-eudora-setting:9014>). But, I don't think this would work well,
because this setting is global, which means that you have to send all
ordinary emails, change the setting, send your html emails, and then
reset the setting. What happens if a time-delayed email comes due
just at this time, well, it probably gets set incorrectly.
A somewhat cleaner and more robust method is the following:
Generate html in some fashion (e.g. using FileMaker to set a text
field to the raw html, and then exporting that one field to a
temporary text file). Note that the format of the first few lines is
critical. I use:
From myemailaddress Fri Oct 25 08:08:08 2002
To: email@address
Subject: subject of email
Date: Fri Oct 25 08:09:10 2002
Using AppleScript do the following:
Convert the file type/creator type to TEXT/CSOm so that Eudora thinks
that the text file is a mailbox.
Modify the Vertical Tab characters (11) by carriage returns (13).
inserted by FileMaker which absolutely refuses to put a carriage
return in an exported file.
That's baloney, FMP puts a carriage return after every record.
And for special occasions, when you export a related field it puts
each instance of the related field on a separate line, so you get
lots of carriage returns. If you put the HTML component into a
related file with one paragraph per related record and export only
the related HTML data from the main database your exported file
will separate each "paragraph" with a carriage return. Is that what
you want?
--
Malcolm Fitzgerald
Database Manager
The Australian Society of Authors
phone: 02 9318 0877 fax: 02 9318 0530
http://www.asauthors.org mailto:email@hidden
--
--
Malcolm Fitzgerald email@hidden
Database Manager
http://www.asauthors.org
The Australian Society of Authors ph: 02 93180877 fax: 02 93180530
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.