KM newbie - possible to select mail subject line (for reminders share?)

I am looking to automate sending an email in Mac Mail to reminders, via the method of selecting the subject line, right clicking, sharing to reminders, etc. I can figure everything out except the step of selecting text in the email subject line - is that possible? From there, I can automate the right click, share, etc...

Do you mean sharing to Reminders, or using "Remind Me" within Mail? If it's the latter, probably easier to use the "Message"->"Remind Me"->"Remind me in..." menu items once you have the message selected.

If it's selecting the message that's the problem -- how do you determine the message you want to select when doing this manually? That'll be be key to how it can be done programmatically.

I mean sharing to the Reminders app. I think I can select the MESSAGE once I am in the folder, by arrowing down. But once the message is selected, I do not know how to programmatically select the subject line (if it is even possible). All I know to do is manually selecting the subject line with my trackpad.

Is creating a new Reminder with AppleScript enough, or do you want options that only the Share Sheet route provides?

Select an email in Mail and then run this AppleScript, which will create a new Reminder in your default list with the email's Subject as the reminder's title and will also include a link to the email in the reminder's body:

tell application "Mail"
	set theSubject to subject of item 1 of (get selection)
	set theID to message id of item 1 of (get selection)
end tell

tell application "Reminders"
	set theReminder to make new reminder with properties {name:theSubject, body:"message://<" & theID & ">"}
	show theReminder
end tell

If that sort of does what you want we can finesse it -- for example, creating the reminder in a particular list or popping a dialog you can choose a list from.

1 Like

First I am not sure what I did to deserve your volunteering AppleScript for me, but I will gladly take it! (could I Venmo you a little thanks for your trouble?).

Second, happy to use AppleScript for part of the solution -- I wish I would learn so I could do these things for myself, but there is a cost to that learning curve that strikes me as out of proportion to the benefit to most amateurs like me.

Third, as long as you are willing, my ideal scenario would be (after I manually select a message), to: (1) move it to a folder, (2) and then initiate the Reminders dialog to ask for the list, ask for a date, etc.

Are you always moving things to the same folder, or do you want to choose when you run the macro? What's the date to be used for, text or to set the reminder time? What's the "etc"?

Reminders can be created with the following:

name (text) : The name of the reminder
body (text) : The notes attached to the reminder
completed (boolean) : Whether the reminder is completed
completion date (date) : The completion date of the reminder
due date (date) : The due date of the reminder; will set both date and time
allday due date (date) : The all-day due date of the reminder; will only set a date
remind me date (date) : The remind date of the reminder
priority (integer) : The priority of the reminder; 0: no priority, 1–4: high, 5: medium, 6–9: low
flagged (boolean) : Whether the reminder is flagged

These are all great questions! Really what I have been fiddling with is how to automate utilizing reminders with links to mail, where the mail will be downloaded and available on both Mac and (more difficult) iOS. I had planned to use a special folder for both my accounts (Office 365 and Gmail) for this purpose - called "Linked Outlook" and "Linked Gmail," respectively. My conceived workflow was to put emails in one of those folders (depending on which email service the email came from -- I use unified inbox in Apple Mail), and from there set the reminder. Moving to a folder is not really necessary on the Mac side, but it facilitates more readily having the linked items be downloaded and available for link access on the iOS side. So, those were the two options of folders I would be sending the email to within the mail app.

As for the Reminders side, although in theory I could ask every time what Reminders List to send the email to, it might be easier for me to just have a single dedicated Reminders list for this now (as it happens, I have one such list called "Email Snooze" so I could always use that). Probably the only other thing is date and maybe time. I can't think of any other "etc." for now.

Actually, now that I look at your list of factors, I suppose also: "Name" of reminder, and "remind me date" would be good. I don't use the other stuff.....