apple-mail

Why doesn't this simple applescript work any more in ML mail.app (as a rule)

时间秒杀一切 提交于 2021-01-24 10:57:23
问题 It works only when you right click on the mail message and choose "run rules", but not on incoming messages (without interaction). The first dialog is shown both when incoming or running manually, but the second dialog (with the id) is only shown when running manually. Nothing is shown in console.log Any ideas? using terms from application "Mail" on perform mail action with messages theMessages for rule theRule tell application "Mail" repeat with theMessage in theMessages display dialog

Using AppleScript to set a mail message to Plain Text

我与影子孤独终老i 提交于 2020-02-15 08:40:28
问题 I have an AppleScript that nicely collates information and creates an email message with attachments. I cannot find a way for the script to set the message format to "Plain Text" which is required by the receiving inbox (rather than the default "Rich Text"). Is there an AppleScript way (or trick) to setting the message format to "Plain Text"? 回答1: I found this question while trying to solve exactly this problem. Eventually I came up with the following solution: tell application "Mail" set

Using AppleScript to set a mail message to Plain Text

限于喜欢 提交于 2020-02-15 08:38:32
问题 I have an AppleScript that nicely collates information and creates an email message with attachments. I cannot find a way for the script to set the message format to "Plain Text" which is required by the receiving inbox (rather than the default "Rich Text"). Is there an AppleScript way (or trick) to setting the message format to "Plain Text"? 回答1: I found this question while trying to solve exactly this problem. Eventually I came up with the following solution: tell application "Mail" set

Using AppleScript to set a mail message to Plain Text

独自空忆成欢 提交于 2020-02-15 08:38:09
问题 I have an AppleScript that nicely collates information and creates an email message with attachments. I cannot find a way for the script to set the message format to "Plain Text" which is required by the receiving inbox (rather than the default "Rich Text"). Is there an AppleScript way (or trick) to setting the message format to "Plain Text"? 回答1: I found this question while trying to solve exactly this problem. Eventually I came up with the following solution: tell application "Mail" set

Launch Mail app (iOS) from my own app

白昼怎懂夜的黑 提交于 2019-12-19 04:33:47
问题 There's a lot of questions on this topic, but no updated answer. I want to open the native iOS mail app WITHOUT the compose view (from within my own app). All answers so for say it's impossible, but the app Slack manages to do this. Anyone have any idea? 回答1: You can launch mail app using message:// url scheme, e.g. NSURL* mailURL = [NSURL URLWithString:@"message://"]; if ([[UIApplication sharedApplication] canOpenURL:mailURL]) { [[UIApplication sharedApplication] openURL:mailURL]; } I was

How to set the sender of the current Mail.app outgoing message via AppleScript?

[亡魂溺海] 提交于 2019-12-18 12:34:53
问题 I'd like to write an AppleScript to set the sender of the current outgoing message in Apple's Mail.app. I've tried this: tell application "Mail" to set sender of front outgoing message to "<my email address>" but I get the error message error "Mail got an error: Can’t set sender of item to any." number -10006 from sender of item to any which doesn't make sense to me. When I try to interrogate the front outgoing message as follows: tell application "Mail" to get properties of front outgoing

Mail Rules with javascript instead of applescript

谁都会走 提交于 2019-12-13 01:45:05
问题 In a Mac mail rule, I am trying to run a javascript instead of an applescript. This has been asked in Mail Rules using JavaScript for Automation instead of AppleScript but the answer is not working for me! I have tried to simplify the code as much as I can. So, the following applescript works fine: on perform mail action with messages theMessages say "running!" end perform mail action with messages but the equivalent javascript is not working. function performMailActionWithMessages(messages)

Add vcard to Contacts with Mail rules and Applescript

你离开我真会死。 提交于 2019-12-12 18:56:23
问题 I receive a lot of customer vcards to a specific email address. I want to automatically add the vcards to my contacts through the Mail rules and an AppleScript. I searched a lot and found something. I modified it a bit. And the opening and adding process works fine. But only when I choose a file. I can't get the file into a variable from the mail message. I tried it but it won't work. Here is my code so far: tell application "Mail" set att to attachment end tell set thefile to att tell

Using AppleScript to Move Mail Messages to Trash

血红的双手。 提交于 2019-12-08 13:14:55
问题 I've written a script that is invoked by a Mail rule. I want the script to move messages to the trash under certain conditions. It didn't work so I've commented out the test and it still didn't work. I got the code from an online tutorial. The tutorial moved the message to "Filed". The rule itself worked when I replaced the call to the script with a move to the trash. Here's what I'm testing: using terms from application "Mail" on perform mail action with messages these_messages for rule this

imap - get attached file

守給你的承諾、 提交于 2019-12-06 18:50:15
问题 How do I get the attached file from this email? This email is sent from an apple computer and the email struture is not like any other (surprise).. here the part with the disposition is one dimension deeper than else.. The script works with every other email where the part with the file is in the first dimension, but not with this one $part->dparameters[0]->value returns the file name, but strlen($data) returns 0 imap stream $structure = imap_fetchstructure($this->stream, $this->msgno); if