Some Touch Bar Buttons/Widgets for Microsoft Word: font style, size, color, alignment, highlight

I made some AppleScript buttons/widgets for Word. The preset includes:

  • button for saving. Button is gray as long as there haven't been any changes since the last save
  • bold/italc/underlined buttons. They are highlighted if the selected text is bold/italc/underlined
  • buttons for increasing and decreasing font size and, just for fun, a slider widget for adjusting the font size
  • alignment buttons. Highlighted according to the alignment of the selected paragraph
  • Widgets for highlighting text and changing the font color

Download: https://share.folivora.ai/sharedPreset/9fb07bc4-8bd3-4b8d-8bd8-e8941ce67846

Only tested with Word 16.31 (Office 2019)

I would suggest only activating some of those widgets and/or increasing the "Execute script every X seconds" for battery reasons.

Something useful I discovered which is not included in the preset:
In the word menu, under extras, you can "adjust keyboard", meaning you can create your own hotkeys for some functionalities. For exaple, this can be used to create a Touch Bar widget that shows wether the style of the current paragraph is "Normal" and msets the style to "Normal" upon pressing the button. Use this code for the appearance of the widget:

if application "Microsoft Word" is running then
tell application "Microsoft Word"
try
return name local of style of selection
end try
end tell
end if

Set the Alternate Color Regex to "Normal". Then set a hotkey for toggling the "Normal" style in the Word settings. Now assign this hotkey as the action of the widget.

Thank you very much for writing and sharing this. I've been struggling immensely to get my computer to be less of a hindrance and more of a help.

I don't really know anything about coding etc.... but I managed to get some of your presets to work for OneNote by just changing "Microsoft Word" to "Microsoft OneNote". If it is possible, is there any chance can you help me to change your presets for changing font size to work for OneNote please?

I know OneNote doesn't have the increase/decrease font size things like Word. Perhaps it would be possible to make a few buttons for preset font sizes?

I would really appreciate any help but don't feel obligated to - just the fact that I've managed to get many of the things I use over and over onto the Touch Bar due to your presets is like a second Christmas.

Hey, I'm happy to hear that you like the preset. I just checked and unfortunately, OneNote does not offer an AppleScript dictionary (you can check in the script editor app under File > Open Dictionary). I didn't find much on AppleScript and OneNote on google either. So I'm afraid I don't know how to help you.

If, as you said, some of the buttons work with OneNote though, OneNote seems to support AppleScript in general, so it might be possible somehow.

Thank you for the response!

It seems I was mistaken though. Like I said, I changed the scripts from "Microsoft Word" to "Microsoft OneNote" and the BTT was happy to accept the scripts but when I actually tested I didn't test the ones that use your scripts - I tested the ones that simply press keyboard shortcuts. Silly of me.

Thank you though - I'm still using your preset for Word, it's immensely useful.

1 Like
Imprint | Privacy Policy