What I am trying to do is that I want to make a single macro that will take care of all the buttons that I might find on the internet and it will press on them with one single hotkey (cmd + m) in my case. So for example I can have something like this :
But I want perform a conditional check for what website I am currently at and then essentially make most common buttons I see on these websites and add them under the conditional if statement. I know I can get the url of currently active window with 'tell application "Safari" to return URL of front document' applescript. But then I need to do some pattern matching and check for a string and if it contains something like https://github then look for these buttons, if not go to next conditional statement and so on.
This brings a few questions. First with more websites and this macro growing bigger and bigger with every button, this seems to be an idea that can't really grow. Or can it? And I am curious whether what I am doing is a good way to go about it.
Thank you for any help.