Last active
October 22, 2020 19:48
-
-
Save gruber/792364 to your computer and use it in GitHub Desktop.
Prompt with options to "Reply" or "Reply All" when replying to a message with multiple recipients in Apple Mail for Mac OS X. Also does away with top-posting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Mail" | |
set _sel to get selection | |
if (count of _sel) > 1 then | |
-- multiple message selection, usually a conversation thread | |
choose from list {"Reply", "Reply All"} with prompt "Unknown recipient count." default items {"Reply"} | |
try | |
set _menu_command to item 1 of the result | |
on error | |
return | |
end try | |
else | |
set _msg to item 1 of _sel | |
set _count to count recipients of _msg | |
if (_count > 1) then | |
choose from list {"Reply", "Reply All"} with prompt (_count as string) & " recipients:" as string default items {"Reply"} | |
try | |
set _menu_command to item 1 of the result | |
on error | |
return | |
end try | |
else | |
set _menu_command to "Reply" -- Default for messages with single recipient | |
end if | |
end if | |
end tell | |
tell application "System Events" | |
tell process "Mail" | |
delay 0.5 | |
tell menu bar 1 | |
click menu bar item "Message"'s menu "Message"'s ¬ | |
menu item _menu_command | |
end tell | |
-- Delete or comment out the `delay` and `key code` lines below if | |
-- you prefer Mail's default top-posting behavior. | |
delay 0.25 | |
key code 117 -- Forward Delete to nuke top blank line | |
-- Fix trailing whitespace | |
key code 125 using command down -- move to bottom | |
key code 123 using option down -- Option-LeftArrow | |
key code 124 using command down -- Cmd-RightArrow | |
key code 117 using option down -- Option-ForwardDelete | |
key code 36 -- Return | |
key code 36 | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fix the bluetooth audio devices and wireless connection here https://fixconnectionsbluetoothaudiodeviceswirelessdisplayswindows10.net/ those not displays on your window 10 operating system is the most common error occurs when you upgrade your system .