Question

is it possible to pass selected text to browser (chrome) from notepad ++? howto pass not path to TEMP_FILE but content?

//—need a correction—
set ChromeRun = C:\Documents and Settings\My\Local Settings\Application Data\Google\Chrome\Application\chrome.exe
set TEMP_FILE = $(SYS.TEMP)\npp_sel.txt
// save current selection as ANSI text file
SEL_SAVETO $(TEMP_FILE) :a
// run Chrome.exe for this file
$(ChromeRun) –-homepage $(TEMP_FILE)

could you help me out with this script, please

Was it helpful?

Solution

NppExec can refer directly to a highlighted word(s) using $(CURRENT_WORD). So you don't need sel_saveto or temporary files.

The snippet below works with Firefox. You should be able to modify it for Chrome in the obvious way.

In NppExec console window:

     `npp_run firefox $(CURRENT_WORD)`,

where $(CURRENT_WORD) is, for example, a URL (http://google.com) that you have highlighted in the current file in Notepad++.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top