0

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

Yurij73
  • 5,281
  • 3
  • 15
  • 14

1 Answers1

3

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++.

Assad Ebrahim
  • 6,234
  • 8
  • 42
  • 68
  • Thanks, your suggestion about $(CURRENT_WORD) was useful for me in Gnome/LINUX. Now, It works! `set avant = "C:\Program Files\Avant Browser\avant.exe" npp_run $(avant) $(CURRENT_WORD)` Just one note if we deal in Windows, there is standard **Notepad++** **ALT+F2** doing the same... – Yurij73 Aug 20 '12 at 13:01
  • It seems the question have to be closed, as you helped me with this – Yurij73 Aug 20 '12 at 13:06
  • @Yurij73, Glad it worked. If you're happy with it, suggest that you accept the answer. That will signal that the problem is closed. An upvote never hurts either ;) – Assad Ebrahim Aug 20 '12 at 15:21