There have been many requests to be able to pass the selected text to a translation or web lookup / search like this
Most work around suggestions are to use a 3rd party macro tool such as AutoHotKey. However, there is a Windows Scripting tool built into most versions. So here is a configurable method using that tool.
' Script template to paste selected word(s) in browser ' Expects a word or more has been selected e.g. double click will select that word ' Save this file as WebSearch.vbs in a known path ' ' Usage:- Add to SumatraPdf-settings.txt replacing existing entry ' ' ExternalViewers [ ' [ ' CommandLine = "C:\Windows\System32\wscript.exe" "C:\known path\WebSearch.vbs" ' Name = &Browser Search ' Filter = *.* ' ] ' ] ' ' select some text e.g. double click a word then use shortcut ALT+F+B or file menu item "Open in Browser Search" ' ' Set WshShell = WScript.CreateObject("WScript.Shell") ' Copy selected text to clipboard WshShell.Sendkeys "^c" 'Fetch Text from clipboard and prep for search Set objClipboard = CreateObject("htmlfile") SearchString = objClipboard.ParentWindow.ClipboardData.GetData("Text") ' remove the ' from start of only one of "MyBrowser" setting below or replace with your own 'MyBrowser="C:\PortableApps\FirefoxPortable\FirefoxPortable.exe" 'MyBrowser="C:\Program Files (x86)\Microsoft\Edge Beta\Application\msedge.exe" MyBrowser="C:\Program Files\Internet Explorer\iexplore.exe" ' remove the ' from start of only one of "MySearch" setting below or replace with your own 'MySearch="https://www.startpage.com/do/dsearch?query=" 'MySearch="https://www.google.com/search?q=" 'MySearch="https://duckduckgo.com/?q=" 'The following are for a Dictionary look-up (use with single words) 'MySearch="https://chambers.co.uk/search/?title=21st&query=" 'MySearch="https://www.merriam-webster.com/dictionary/" ' The following are examples for translate English to français (use website address bar to see codes for other languages 'MySearch="https://www.deepl.com/en/translator#en/fr/" MySearch="https://translate.google.co.uk/#view=home&op=translate&sl=auto&tl=fr&text=" ' ensure value is not too low otherwise commands may fail WScript.Sleep 10 WshShell.Run "c:\windows\System32\cmd.exe /c "+""""+""""+MyBrowser+""""+" "+""""+MySearch+SearchString+""""+"""", 2
Ensure you select everything in the code window and save to a filename such as WebSearch.vbs beware the extension must be .vbs NOT .vbs.txt
Note the correct path to that .vbs file and use the guide at start of file as to how to add the CommandLine into
Settings > Advanced Options especially the need to replace “known path” with the folder location you used.