my exe is not working inside gvim
When I run AutoHotKey.exe copyHtml.ahk .. it works (I am in the same directory where the WinClip files are) Here is copyHtml.ahk code
htmlTxt := WinClip.GetText()
WinClip.SetHTML( htmlTxt )
Then I use ahk2exe and convert this script into an executable copyHtmlToClipboard.exe
I invoke that from my powershell window .. and it works fine ..
But from inside gvim .. no luck. Here is my code .. must be something with how I am calling the command. (exe is in $Path variable)
" convert the selected range into html and put it on current buffer
call tohtml#Convert2HTML(a:line1, a:line2)
" copy current buffer to clipboard
" use WinClip to convert the clipboard into html formatted text
silent exe "!copyHtmlToClipboard.exe"
" delete the buffer
echomsg "html copied to clipboard"
hmm looks like vim calls cmd.exe /c copyHtmlToClipboard.exe and that does not work
However on cmd prompt copyHtmlToClipboard.exe runs just fine
edit: reboot of the computer fixed the problem. It seems that even though I modified env variable $Path (and was restarting gvim countless times) vim did not pick it up when it was starting a shell.
I will leave all my ramblings/codes here since I resolved both my questions using WinClip .. so they are related to WinClip and someone else may find it useful. Thanks Deo and Guest for your help