Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Microsoft Word keyboard shortcut to close the sidebar Apps
Microsoft Word 2011 does not, as far as I can tell, offer a means of assigning a keyboard shortcut to close the sidebar. The AppleScript described here provides that functionality, and sets a keyboard shortcut that will trigger it.

Name the following Applescript "MicrosoftWordCloseSidebar\mosH.scpt" (notice the reversed slash) and save it in ~/Library/Application Support/Microsoft/Office/Word Script Menu Items:
do shell script "osascript -e '
tell application \"System Events\" to tell process \"Microsoft Word\"
 	set {frontmost, itemFound} to {true, false}
 	repeat with w in windows
 		tell w to repeat with g in groups
 			tell g to repeat with c in checkboxes
 				tell c to if value of its attribute \"AXHelp\" = \"Close the Sidebar\" then
 					set itemFound to true
 					click
 					exit repeat
 				end if
 			end repeat
 			if itemFound then exit repeat
 		end repeat
 		if itemFound then exit repeat
 	end repeat
end tell
' >/dev/null 2>&1 &"
When you press Command-Option-Shift-H, the close button of the sidebar is clicked, and the sidebar closes. The keyboard shortcut comes from the "mosH" part of the Applescript name (m=Command, o=Option, s=Shift, H=the letter H). That shortcut was chosen to complement the existing shortcut to open the Find/Replace Sidebar (Command-Shift-H) and may be altered to suit a particular user's needs. The script is constructed as a background osascript to get around a problem that occurs when trying to GUI-script Microsoft Word from its script menu.
    •    
  • Currently 3.29 / 5
  You rated: 2 / 5 (7 votes cast)
 
[4,496 views]  

Microsoft Word keyboard shortcut to close the sidebar | 6 comments | Create New Account
Click here to return to the 'Microsoft Word keyboard shortcut to close the sidebar' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Microsoft Word keyboard shortcut to close the sidebar
Authored by: kikjou on Feb 27, '13 07:55:19AM

Why not simply make a keyboard shortcut in System Preferences -> Keyboard? I tested it with Microsoft Word in Lion and Mountain Lion.



[ Reply to This | # ]
Microsoft Word keyboard shortcut to close the sidebar
Authored by: llee on Feb 27, '13 08:49:39AM

You might have to press the shortcut twice to close the sidebar, unless you had a different shortcut for each item in the sidebar sub menu, right?



[ Reply to This | # ]
Microsoft Word keyboard shortcut to close the sidebar
Authored by: schuyler on Feb 28, '13 06:15:32AM

Yes, a separate shortcut would have to be assigned to each of the sidebar menu items (four in my version of Word). The current script generically closes the sidebar independent of which specific sidebar is open.



[ Reply to This | # ]
Microsoft Word keyboard shortcut to close the sidebar
Authored by: maelcum on Mar 03, '13 12:35:11PM

Hi,

Could you elaborate on this? How do you define the shortcut?

Thanks

mael



[ Reply to This | # ]
Microsoft Word keyboard shortcut to close the sidebar
Authored by: schuyler on Mar 04, '13 10:57:41PM

Are you referring to the keyboard shortcut made through System Preferences, or the one made through the special naming of the Applescript saved in ~/Library/Application Support/Microsoft/Office/Word Script Menu Items?



[ Reply to This | # ]
Microsoft Word keyboard shortcut to close the sidebar
Authored by: schuyler on Mar 03, '13 10:41:47AM

Correction: the existing Microsoft Word shortcut to open the Find/Replace Sidebar is Command-Shift-H (not Command-Option-H).



[ Reply to This | # ]