Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'eMail Attachments.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
eMail Attachments.
Authored by: LostOnline on Jan 21, '05 04:46:57PM

I am having a problem that I'm sure someone out there would consider common sense. Unfortunately my sense is just not that common. I am new to the applescript world so I don't know too much. I have programed in C, C+, basic, and G7, so I understand technobabble just fine.
What I'm trying to do is get Mail.app on my MAC OSX v. 10.3.7 to save the attachments automatically. We get the same 2 E-Mails every day, from the same person, with a file attachment with the same filename.
What I'm trying to do is write a script that will save the attachment (which I can't figure out) rename it (easy enough) with adding the date to the end of the file (still working on, with no success), and changing the file type (because for some reason it makes it a textedit document instead of a text document, which it was when we used AOL)

So what I need to know is what tags to use to tell it to save the attachments.

And then I need to know how to add todays date to the filename when I save it

here's what I got
[code] tell application "Mail"
activate
open selected messages
save attachment as "TEXT"
end tell
tell application "Finder"
activate
set file type of document file "3456A.csv" of folder "Desktop" of folder "me" of folder "Users" of startup disk to "TEXT"
set name of document file "3456A.csv" of folder "Desktop" of folder "me" of folder "Users" of startup disk to "3456A.csv" {HERE I NEED TO INSERT THE DATE PREFERABLE IN M/D/YY FORMAT SO THAT IT LOOKS LIKE "3456A.csv1/21/05" or "3456A.csv 1/21/05"}
end tell [/code]
[code] tell application "Finder"
activate
set file type of document file "3456A_up.csv" of folder "Desktop" of folder "me" of folder "Users" of startup disk to "TEXT"
set file type of document file "3456A.csv" of folder "Desktop" of folder "me" of folder "Users" of startup disk to "TEXT"
set name of document file "3456A_up.csv" of folder "Desktop" of folder "me" of folder "Users" of startup disk to "3456A_up.csv"
set name of document file "3456A.csv" of folder "Desktop" of folder "me" of folder "Users" of startup disk to "3456A.csv"
end tell [/code]
This second one is the one I'm currently running just to changethe file type to TEXT so that I can import it into Filemaker Pro

Any help would be appriciated

Thanks,
LostOnline



[ Reply to This | # ]