Ehhh, yes I got it running, and then NOT...
It turns out this Fonts window is rather spooky (what happens in the font window stays in the font window, but you'll never know how it happened).
I found out, by clicking, that the dark square on the left side gives you access to font-colour, so if you change that from black, the saved 'image' will not be found... similar for the triangular shape in the middle.... tsk tsk...
So I changed the selection image to this:
And it works (for now) after I have made the offset from lower right image-corner to 10 pixels to the right and minus 5 pixels down. This is a random/good guess, since I cannot use the 'Go/Get' on the evaporizing Fonts window.
There is however one caveat, the top font must be 'Gujarati MT' and 'Regular' for the recognition to be made... and looking into the Font Window from macros, this is not the case. It happens (in my case) only in the Font Window called from Scrivener. Stll I chose to include this, because then hitting the sweet spot for the next macro steps, setting value to '36' would be "somewhere near to the right..."
So I just wonder, will the script you mention make the Font window accesible for the 'Get' option? Because that would make it simpler to pinpoint the offset!
Oh, and I prefer, 'my choice', to have all headings in size 36. It gives more even look and better visual searchability.
Why?
Think of looking for food recipes via your browser, first you copy relevant text, including photos, and then streamline the headings, because some are just 12 points, other may be 96 points
As a PS: I have "same" set of macros running in Lightmode, that gives some hurdles too for defining the 'best' image capture.