0

I would like to have a global shortcut key to send a new message using Thunderbird in Mac OS. How can I do this?

1

You can assign a keyboard shortcut to a script like this:

tell application "Thunderbird"
    reopen
    activate
end tell
tell application "System Events" to tell process "Thunderbird"
    repeat 10 times
        try
            click menu item "Message" of menu 1 of menu item "New" of menu "File" of menu bar 1
            return
        on error
            delay 0.1
        end try
    end repeat
end tell

If Thunderbird was not open before the script was run, there is a short delay before the menu bar is populated.

Edit: this does not reopen the main window or switch desktops if the main window is already open on a different desktop:

launch application "Thunderbird"
tell application "System Events" to tell process "Thunderbird"
    repeat 10 times
        try
            click menu item "Message" of menu 1 of menu item "New" of menu "File" of menu bar 1
            exit repeat
        on error
            delay 0.1
        end try
    end repeat
    set frontmost to true
end tell

Edit 2: The second script also sometimes switches desktops, but I couldn't figure out how to prevent it.

4
  • Thanks, this mostly works, but still has the problem that the workspace changes and that the main Thunderbird window reopens. I just would like to have a new message window in the current workspace.
    – anumi
    Sep 21 '13 at 7:53
  • @anumi I edited the answer to add a second script.
    – Lri
    Sep 21 '13 at 8:05
  • The second solution does not reopen the main window, but still switches workspaces. But that's an improvement!
    – anumi
    Sep 23 '13 at 20:37
  • How do i do the same thing for Windows?
    – Brian
    Nov 19 '17 at 5:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .