I want to create a workflow on my Mac where I select text on a Chrome webpage and then press a hotkey combination to change the title of tab to be the selected text.
I generate lots of tabs that get identical titles and I want to tag them with something based on the contents to be able tell them apart. I use the Chrome extension Tabs Outliner that displays a tree diagram of my tabs with their titles. Once the tab structure is in Tabs Outliner, I can do various things like copy the tree of that window and paste it into Google docs as an archive of the tabs I created, my research, testing versions, whatever.
But all my various archiving flows depend on the tabs having meaningful titles. The website(s) are not doing that sufficiently for my purposes, so I want to manually tag them, in most cases as quickly and easily as possible. Select text and press a hotkey seems about as quick as I can get short of having the computer read my mind and track my eye movements. Maybe add the complexity of stopping to allow me to edit the pasted text and then pressing another hotkey to confirm and move on.
My idea is to have the hotkey initiate something like the following automatic flow.
- Cmd+C: Copy the selected text.
- Ctrl+Shift+A: Open the RenameTab Chrome extension.
- Cmd+V: Paste the copied text into the RenameTab text field in the dropdown.
- CLICK the "Lock Title (beta)" button in the RenameTab dropdown.
- Ctrl+Tab: Move to the next browser tab.
I can write a simple Service to send all the keystrokes. But don't know how to automate the Click that is required.
I want to be able to do this approximately 20-40 times a day, day after day, so I cannot presume that the Chrome window will be at the same screen location, on the same monitor, the same window size, or any of the other assumptions that basic click-automation scripts like Cliclick seem to require.
I can presume that the RenameTab dropdown will be at the same relative location to the Upper Right corner of the Chrome window (actually relative to the extension button which is mostly stable). The image here is on Windows, from the Chrome web store, but I'm working on a Mac.
I've found references to Selenium as possibly able to do that click, but the Selenium tutorials that I've found want to put me through weeks of becoming a Test Automation expert.
I presume that Selenium can do its thing in a way that defaults to the current browser window, current browser tab. But how do I tell Selenium where to click?
Can Selenium recognize that the browser frame, not the current web page, has displayed a dropdown window and can it find the button by name? All the stuff I've been able to understand about Selenium so far is that it seems to deal with the displayed web page, so maybe it cannot deal with being able to identify content that's generated by the browser frame itself.
Do I maybe need to forgo Selenium instead using more basic click automation tools and capture the current window size and then subtract the coordinates based on the Upper Right corner to get the click coordinates relative to the current window? Do I need to also deal with the current window position on the screen?
Sorry for dumping all the details, but I don't know how to ask the question more simply without running the risk of presuming what the solution is when I really don't know. So I'm trying to explain exactly what I want to do, in what context, and why. In researching this, over and over I find that the descriptions of various tools are enthusiastic descriptions of how the tool works in use cases that don't seem to overlap with mine, without ever explaining the underlying operating mechanism so that I can determine whether or not the tool is even possibly equipped to do the job.
Any experienced guidance would be appreciated. If you can tell me things like "Cliclick presumes this so you won't be able to ..." or "Selenium can only deal with what it gets from ... so you'll have to ..." or point me to where the basic operating principles are outlined, I would be grateful.