gingerbeardman Posted July 30, 2013 Share Posted July 30, 2013 (edited) I find it cumbersome to move to the Body section of a new message in Apple Mail. Sure, you can use Tab to move through the fields of the window, but if you have Full Keyboard Access on, that can be many. You may also often add cc: and bcc: which also alters how many presses of Tab are required to land in the body section. Also, if you Tab too many times then you start adding tab characters in your email. Argh! So, I wanted to find a way to instantly focus the body section. I used Apple's Accessibility Inspector (comes as part of Xcode) to find out the UI element I needed to target, and the property I needed to change to apply focus. Then it was just a mater of a few lines of AppleScript. Here it is, wrapped in a workflow that can be summoned by a hotkey. I chose Cmd+` but you can configure it to your liking. Download: Focus Body.alfredworkflow (2013-08-29) AppleScript: tell application "System Events" tell process "Mail" set value of attribute "AXFocused" of UI element 1 of scroll area 4 of front window to true end tell end tell Edited August 29, 2013 by gingerbeardman Link to comment
gingerbeardman Posted August 20, 2013 Author Share Posted August 20, 2013 V2: improved apple script to only run if the frontmost window isn't your inbox. Link to comment
gingerbeardman Posted August 20, 2013 Author Share Posted August 20, 2013 (edited) Added Focus Subject (2013-08-29) which works in a similar way to focus the Subject field. Edited August 29, 2013 by gingerbeardman Link to comment
dirk Posted August 20, 2013 Share Posted August 20, 2013 (edited) Added Focus Subject which works in a similar way to focus the Subject field. or switch: activate application "Mail" tell application "System Events" tell process "Mail" if title of window 1 does not contain "Inbox" then if value of attribute "AXFocused" of text field 1 of front window is true then set value of attribute "AXFocused" of UI element 1 of scroll area 4 of front window to true else set value of attribute "AXFocused" of text field 1 of front window to true end if end if end tell end tell Edited August 20, 2013 by dirk gingerbeardman 1 Link to comment
gingerbeardman Posted August 21, 2013 Author Share Posted August 21, 2013 That's a nice approach, but it assumes a you'll always want to switch from the body to the subject line. This is not always the case for me. Thanks for your idea, though! Link to comment
gingerbeardman Posted August 29, 2013 Author Share Posted August 29, 2013 V3 of both workflows added. They no longer activate Mail.app, so your window z-order is respected. Link to comment
gingerbeardman Posted October 22, 2013 Author Share Posted October 22, 2013 (edited) or switch: I checked this code and it does work, my apologies for dismissing it previously. Here's V4 as a single workflow, but it is only for Mac OS X 10.9 Mavericks: Toggle Focus Body/Subject Cheers, matt Edited October 22, 2013 by gingerbeardman Link to comment
Cor roC Posted February 18, 2016 Share Posted February 18, 2016 Hey Gingerbeardman --- I sent a pm re: this script. Currently not working on my end, likely a PICNIC problem. Would love to pick your ear if you have a few minutes. Thanks! Link to comment
Vero Posted February 19, 2016 Share Posted February 19, 2016 Hey Gingerbeardman --- I sent a pm re: this script. Currently not working on my end, likely a PICNIC problem. Would love to pick your ear if you have a few minutes. Thanks! Hi Cory, could you please fill in your Powerpack email address in your forum profile before taking part in Powerpack-related discussions? Thanks! Link to comment
gingerbeardman Posted February 25, 2016 Author Share Posted February 25, 2016 (edited) Hey I've not tested this on El Capitan as far as I can remember. Happy to help where I can, though! Edited February 25, 2016 by gingerbeardman Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now