jeeswg wrote:Try this:
Code: Select all
+#i:: ; Note, this is a failed attempt
clipback := Clipboard
MsgBox, %clipback%
ShellRun("C:\vim\vim80\gvim.exe", clipback, "", 3)
; run "C:\vim\vim80\gvim.exe" %clipback%
return
Running your code yields the same error message, I am pasting a working version that I managed to put together:
- Identical error message arise.
- AHK_Clip_Association.jpg (61.44 KiB) Viewed 651 times
Code: Select all
+#i::
clipback := Clipboard
; ShellRun("C:\vim\vim80\gvim.exe", clipback, "", 3) ; Yields the same "no-file-association" error.
; run, gvim %clipback%, max ; does not run, cannot find gvim (gvim is available through Run box)
; run, "C:\vim\vim80\gvim.exe" %clipback%, Max ; does not get me a Maximized window
; run, "C:\vim\vim80\gvim.exe", %clipback%, Max ; Opens the editor ony
run *RunAs "C:\vim\vim80\gvim.exe" %clipback%
sleep 1000
; WinMaximize ; Well, nothing much goes maximized though.
send ^#{F10} ;Using MaxTo, a Window manipulator
return
Still, I prefer to open windows using some variants of the `ShellRun` command, as it maximizes the window without showing the GUI effects.
PS ==>
Missing piece 1: I would also like to make have `ShellRun` to start the editor as Admin, but did not find a way to do it yet. Surprisingly easy, including the `*RunAs` parameter(?) should get me far enough