Create a keyboard shortcut to Google Lens - google-chrome

Recently there is this "Search images with Google Lens" in the contextual menu (triggered from the right click) in Chrome browser, which is super useful.
For those who doesn't know yet, if you click on that item you can define a screenshot area and then Google Lens page opens with the image you just framed. And then it lets you search for "things" inside this image.
What I try to do is to find a way to assign a hotkey to trigger that menu item without being forced to use the mouse (e.g. ctrl + alt + s). The reason I want to do that is because I overuse this functionality and I am in a keyboard-over-mouse increase productivity mind of set.
My first thinking was to make a page script that would trigger that contextual menu and click the item but as far as I know there is nothing in the JavaScript API with that much power
(There is this " JavaScript - simulate click on contextmenu " but they are not talking about the native Chrome contextual menu I believe.)
Another option would be to use some key automation program like AutoHotKey in windows but there is one problem, the contextual menu is not always located in the same position relative to the mouse (e.g. if the menu is triggered at the bottom of the page it will appear above the mouse pointer).
Other than that I don't really see another solution.
I am digging for some idea and maybe you could help me if you are interested in the same outcome.
EDIT: For whoever may be interested
I made this python script
https://github.com/vdegenne/lens-clicker
It works on my computer, I can now get the result I want. But I keep this question opened for more ideas, seeking a better solution.
(You can also contribute to the project on the GitHub page).

I use Vimium, an extension to allow vim-like keybindings for browser navigation.
You can add search engines, for example Google Lens as so:
i https://lens.google.com/uploadbyurl?url=%S Google Lens
So once I have the URL of the image in the clipboard, I type o, i, Space, Ctrl + v, Enter
I'm working on finding a way of getting the URL of the image, but am not sure Vimium supports this. If not, using the URL template (above) to search Google Lens is still a much more robust way than by automating clicks on a menu, so hopefully that's helpful.

Related

Auto-filling web forms

I have to create video-tutorial as help. We have a document with help, but customer want video.
I have found chrome extensions for this purpose - Screencastify (https://www.screencastify.com) for recording chrome tab contenct. It is cool that this tool highlight user clicks.
The best trouble is filling forms. I can't find any tool, or chrome extension or something, whitch is able to fill fluently forms. When I am filling forms, i make some typing errors and typing is not fluent - video tutorial looks unprofesionall and chaotic.
I have tried UI Vision RPA (https://ui.vision/), but this tool does not simulate user click (yes with some extension, but before simulation user click screen becomes green for a while), but there are no highlighted clicked position.
Is there a tool that can simulate a smooth form fill according to a prepared script or a macro - basically something like an auto-run UI test, such as a keyboard shortcut that is able to simulate mouse clicks and fluently write defined form content?
There are lot of ways to do it. All below three allow record and play back.
1. VBA macros in excel,
2. Automated test tools and frameworks like Selenium
3. RPA tools like WinAutomation or automation anywhere etc.
Once you record, you can go to recorded script, correct any spelling mistakes, add any pauses needed, start your screen recorder and play back the script.

How do I get a keyboard shortcut to translate a google chrome webpage? Not looking for auto-translate options

I need to frequently translate the webpage manually for work purpose. Although not looking for auto-translate options, I need a keyboard shortcut or a handy extension to translate the page. The right click option on google or the google chrome translator extension need multiple clicks in order to translate. The middle mouse button to translate the whole web page would do some good to me.
I tried looking out for extensions out of which context menus was related to my issue. I couldn't figure out how it works.
The right click option on chrome has 7th option for translate page which is not handy. I need it to be the first option on right click or the middle mouse button to translate the google page would help.
I am working on windows and not MAC.

ArcMap editor panel window not opening

I have installed ArcMap Desktop 10.5.1 on a new computer and have a problem. I have never experienced with any previous versions of ArcMap.
Pressing the button of the toolbar for the Editor
I can’t access the toolbar.
I also can see that the program notices that I have pressed the button by the ArcMap-window ‘flickering’ and I see the Editor-window that should open for less than a second at some occasions.
I have tried to see if it ends up hidden somewhere, but it does not seems like it.
Printscreen of the ArcMap window with the editor button
Does anyone know what can be the problem and how to handle it?
I have tried to search for answers both at the ESRI help-page, here in stackoverflow and in other broad search engines, but this doesn’t seem to be a common problem.
This problem can have many causes and there are 2 different ways to open the editor toolbar.
Try click Customize > Toolbars > Editor (I will add a pic for it)
Right-click while your mouse on the main menu. The toolbar will be open directly and check the editor. Same solution.
If you have still this problem you must see another reason for the problem.
For example, do you using a second monitor? If you using it maybe the editor toolbar coming from another monitor. Check your monitor/monitors also.
If you still have problems, please write. There is another solution.
However, I am not writing now because it will reset usage of interface.

Is there a Surround With for aptana studio plugin?

Is there some way to get "surround with" in the Aptana perspective in Eclipse like you have in the Java perspective. I would love to be able to surround text with html tags like eg: <div></div> with a keyboard shortcut. Is there some way of doing that with the snippets rubles?
Thanks,
You can do this with AutoHotKey, which has the added benefit of being available across all apps. I have a script which launches a 'surround' menu when I select some text and press CTRL+SHIFT+C
To use it, install AutoHotKey, and create a new .txt file with the following code, and replace the extension with .ahk
http://pastebin.com/48ipiXsG
At the top of the file you'll find a number of groups of items, in the following format
<h1>~<h1>##</h1>
the ~ character divides the name of the function and the function content. The bit before ~ is what appears on your menu, and after the ~ is the code. ## represents where your selected text will go. So if you select the text 'AutoHotKey' and press CTRL+SHIFT+C, and then select <h1> from the menu, it'll replace the with <h1>AutoHotKey</h1>
There are several menus in the script, set up to launch based on what app you press CTRL+SHIFT+C in. For example, I get different shortcuts if I'm in Visual Studio than if I'm in SQL Server. You can modify these easily enough, but the generic menu should work fine for you. Feel free to chop and change but you have to leave GENERIC at the top of the script.
PS: I use this script everyday, and there is one small bug. The script saves whatever you have in the clipboard in a variable, and then writes it back to the clipboard when it's done. Sometimes, instead of surrounding text it replaces it with whatever you had in the clipboard. This is easily undone with CTRL-Z and usually works the second time you try it. I've never been able to figure out what causes this, maybe some autohotkey heads can help out?
PPS : This script is based on some other scripts from the AHK forums, including this one
http://www.autohotkey.com/docs/scripts/FavoriteFolders.htm
So you may find comments that don't make sense. I've seen a few references to the middle click, as the script above uses the middle mouse button instead of CTRL+SHIFT+C.

Shortcut (programmatically) open a link in a new tab without focus to that tab

Google search + Google Chrome browser have this implemented, when you browse the google search results using your up and down arrows (only possible in Chrome browser) and than press CTRL+ENTER it opens the search result selected in a new tab but without focus to that tab. You can now use up and down keys in the same list of search results and CTRL-ENTER more results in new tabs to visit later on.
Does anyone have any idea how this is done? As it only works with Google Chrome at the moment I suspect something is added to the browser as well but I can't find anything on this subject.
The way I have seen this done before is for the webpage to listen for key presses (e.g., j/k) and simply focus() the desired link. Then, when the user presses Enter or Ctrl-Enter, he is simply performing the default operation on the focused link.
Sure enough, when I type this into the javascript console on a Google search result page, I see the links that are being focused.
document.addEventListener('focus', function(e) {console.log(e.target)}, true);
So Google is still using the same technique, although it's not so obvious because they hide the dotted outline around the focused link using CSS (a.noline{outline:0}).