Mail to FMP
Mail to FMP
- Subject: Mail to FMP
- From: JL <email@hidden>
- Date: Thu, 19 Sep 2002 18:33:13 +0200
Hi all,
I have modified a script I've used with Entourage for use with OSX's
Mail app (OSX 10.2). Not as easy as I presumed. Now I got it working
EXCEPT for the "theBody" part where I get distorted text in FMP. All
return characters are gone which make it look like a mess.
What I really like to achieve is the same as when I copy (or drag) the
text from Mail (set to "plain text") into FMP. Then I retain the color
for quoted text. I have tried following the "Unicode" topic but the
suggestions I see there doesn't work for me. I just get error messages.
Here is the script I'm working with:
tell application "Mail"
set theSelection to selection
set handledMessage to false
repeat with theMessage in theSelection
set handledMessage to true
end repeat
if handledMessage = false then
display dialog "You have not selected a mail!" with icon note buttons
{"OK"} default button "OK"
error number -128
else
set theMessage to item 1 of theSelection
set theSubject to subject of theMessage
if theSubject is false or theSubject is equal to "" ,
then set theSubject to "<no subject>"
set theSender to sender of theMessage
set theDate to date sent of theMessage
set theBody to the content of theMessage
end if
tell application "FileMaker Pro"
activate
if not (exists database 1) then
with timeout of 60 seconds
try
open file ((choose file with prompt "Choose a Mail database:") as
string)
on error
display dialog "You Canceld." buttons {"Cancel"} default button 1
return
end try
end timeout
end if
do script "New Record"
go to last record
set newrec to current record of database 1
try
set cell "tSubj" of newrec to theSubject
set cell "tFrom" of newrec to theSender
set cell "tDate" of newrec to theDate as text
set cell "tBody" of newrec to theBody
on error errMsg number errNum
display dialog errMsg & " " & errNum
end try
end tell
end tell
--
Jan Lowenberg
Sweden
_______________________________________________
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.