Feb 27, '13 07:30:00AM • Contributed by: schuyler
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 &"
