Hi:
Thought I'd turn toward the group rather than beating my head against a wall for another day.
I want to copy the recipient name, recipient email address, and content from an outgoing email message in Mail.app to a record in a FileMaker Pro 8 database.
But I'm having trouble in two areas: (1) Getting the recipient name, recipient email address, and content from the outgoing message window. (References like front window don't seem to work with Mail.app)
(2) Once I have these three pieces of data in variables, I want to search for the recipient name in the FileMaker Pro database. If there is no existing record for the recipient name, I want to create a new record. I think have the code in place to create the new record, but I get an error message when I run the script--so I need code to work around that.
This is probably pretty simple, but I'm having a hard time getting the syntax right.
Here's what I have so far:
tell application "Mail" --I need language to copy data in fields to variables: name to thePerson, address to theEmail, content to theContent end tell
--switch to FileMaker tell application "FileMaker Pro Advanced" activate
--Switch to Data Entry layout, start at the first record, and find the recipient go to layout "Data entry" show every record do menu menu item "Show All Records" of menu "Records" go to first record show (first record whose cell "person" = thePerson)
--if this is a new recipient --I need something here to catch the error generated by the previous uncommented line set theRecord to create new record tell theRecord set cell "person" to thePerson set cell "email" to theEmail set cell "summary" to theContent end tell save record
else
--if this is an existing recipient do script "Clone a record" save record set cell "summary" of current record to theContent
end if end tell
TIA, Mike
|