Entourage/ Filemaker tips
Entourage/ Filemaker tips
- Subject: Entourage/ Filemaker tips
- From: Blaine Wilson <email@hidden>
- Date: Mon, 17 Mar 2003 21:25:01 -0800
So, with some help from this list, my script is finally working. (I was
having trouble with "document" vs "database" in FileMaker.
My goal was to have the script remove "unsubscribe" emails in Entourage from
a filemaker database. So, I select the unsubscribe messages in Entourage and
run the script. Some of the script I borrowed from the built in Entourage
scripts, and some of it I wrote. (I'm a newbie at this, so I'm sure it's
quite ugly.)
SO, here's my question. Right now the script is dumping the failed names and
addresses into an Entourage note. Is there any way I could delete the
messages that succeed, which would leave the failed messages in my mailbox?
It seems like it should be possible, but I'm at a loss how to even approach
it. (What's confusing me is that I have all of the messages selected...maybe
it's not a hitch for AppleScript, but it's a hitch in my mind.)
Here's my script so far:
--------------------------------------------------------------
tell application "Microsoft Entourage"
-- get the currently selected message or messages
set selectedMessages to current messages
-- if there are no messages selected, warn the user and then quit
if selectedMessages is {} then
display dialog "Please select a message first and then run this
script." with icon 1
return
end if
set myList to {}
repeat with theMessage in selectedMessages
-- get the information from the message, and store it in variables
set theSender to sender of theMessage
set theAddress to address of theSender
set theName to display name of theSender
set theSender to (theSender as list)
set theAddress2 to "=" & theAddress
tell application "FileMaker Pro"
activate
tell document "Customers.FP5"
--create a find request using data from the variable
create new request
set cell "Email" of request 1 of document 1 to theAddress2
find
set i to count of records of document 1
--save unfound email addresses in a varable
if i < 1 then
set myList to (myList & theName & "," & theAddress &
"~~") as string
else
repeat with i from 1 to i
set cell "Unsubscribe" of record i of document 1 to
"Unsubscribe"
end repeat
end if
end tell
end tell
end repeat
--dump the "not found" emails and addresses into an Entourage note
tell application "Microsoft Entourage"
make new note with properties {name:"Unsubscribe failed",
content:myList}
end tell
end tell
--------------------------------------------------------------
So, if any of you have some suggestions, I'd appreciate it!
Thanks mucho!
Blaine
_______________________________________________
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.