While there is a nice albeit a bit crude way to add buttons to a Google Sheet, there is unfortunately no such option in Google documents. So how can I automate repetitive tasks that necessitate running Apps Script within a Google Doc (or within Google Sheets, or Slides, or …)?
It was actually not overly complicated even for a complete AppleScript novice who is still on trial by Script Debugger. (I have still a day left in my trial version of Script Debugger and still wondering what is the difference between AppleScript scripts, bundles libraries and apps; but of course 60 years of teaching CS doesn’t hurt…)
Moreover, the script can be easily adapted to clicking on any page element on any web page and for instance insert the text or image from the clipboard there or select a part of the page and copy it into the clipboard (my next task). And so on - I see quite a few interesting possibilities in my projects… (Could I even insert <script> into the page and run it?)
Hope some of you will find it useful…
PS: If you like movies then you may enjoy the recording of the above AppleScript in action.
PSS: I’m sure that you experts will find a lot of improvements - please comment!
PSSS: I am voice typing and when I dictated “debugger” I got “day bugger”! Hmmm, Apple’s AI is on the spot given that it took me more than one day to learn how to use AppleScript - nevertheless they could be a bit less condescending…
PSSSS: I really enjoy Script Debugger, really great job Mark @alldritt!
PSSSSS: Maybe a script that goes through the elements on a page to find the one you clicked and gives you the nicest unique CSS selector so that you don’t need to mess with Google’s messy HTML - Hmmm, how arrogant! (Well, "aria-label"s are nice and, after all, probably fairly common and unique so it can’t be overly difficult in most cases…)