Getting Existing Outgoing Message in Mail.app
Getting Existing Outgoing Message in Mail.app
- Subject: Getting Existing Outgoing Message in Mail.app
- From: Jeff Cooper <email@hidden>
- Date: Fri, 21 Dec 2007 13:37:07 -0500
- Thread-topic: Getting Existing Outgoing Message in Mail.app
Title: Getting Existing Outgoing Message in Mail.app
Hi Folks,
(Please bear with me; I’m mainly a FileMaker developer and only a novice AppleScripter.)
I’m trying to send an email from FileMaker through Mail.app. FM has a Send Mail command that can call up Mail, open a new outgoing message and fill in most of the fields (Subject, Body, To, etc). But it’s limited to adding a single attachment. So, I’d like to use AppleScript to add additional attachments. But I’m hitting a wall. The much simplified version of what I’m trying to do follows:
This works:
set att to choose file
tell application "Mail"
activate
set msg to make new outgoing message
tell content of msg
make new attachment with properties {file name:att} at before first paragraph
end tell
end tell
This doesn’t:
set att to choose file
tell application "Mail"
activate
set msg to outgoing message 1 —THIS IS THE LINE GIVNG ME TROUBLE
tell content of msg
make new attachment with properties {file name:att} at before first paragraph
end tell
end tell
The line giving me problems returns “Mail got an error: Can’t get content of outgoing message id 423222320.”
Basically, I’m trying to add an attachment to an already created and open outoing message. I’ve tried setting msg to...
... Outgoing message
... Item 1 of outgoing messages
... frontmost window
...message of front window
... Etc
I figure (HOPE) it’s got to be just syntax/grammer thing; trying to figure out what set of commands givee me the message in the frontmost window or barring that, whatever message was just created. I also ok with looping through the outgoing messages ‘til I find the one I want, I’m not picky.
What’s interesting is when I try getting Outgoing Message 1, I get “Mail got an error: Can’t get content of outgoing message id 423222320.” which to me means it DOES know what message I’m talking about (it spits back a message ID) but for some reason can get any elements or properties of it unless is created within the script.
Thanks,
Jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden