开发者

Notepad++: Writing a run command using an installed plugin

I am trying to find a way to take the syntax highlighted text from N++ and then open it within say MS Word. I have found the plugin NppExport which can save the highl开发者_StackOverflowighted text to a rtf file. But it seems N++'s macros are not able to really utilize it. Any suggestions to automate this process? Thanks!

Basic steps are 1) call "Export to RTF" 2) Save to ${FULL_PATH_NAME}.RTF 3) open the RTF file 3) Open MS word

Note: I have 4 figured out using

"C:\Program Files\Microsoft Office\Office12\Winword.exe" /f "$(FULL_CURRENT_PATH)"


Since you are meshing two programs (Notepad++ and Word). It may be difficult to do totally in the macros. I haven't had much luck with the macros beyond repetitive text manipulation. But I can recommend the tool AutoHotKey (autohotkey.com) which makes implementing these tasks super simple. Here is a little example that I tried out. Yes it works.

^#R::
WinMenuSelectItem , ahk_class Notepad++,,Plugins, NppExport, Copy RTF to clipboard
SetTitleMatchMode, 2  ;find by partial title
WinActivate Microsoft Word
Send ^v

This will copy the text in RTF switch the active window to word and paste the code. It would be relatively simple to change the command to open a new window instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜