Code: Select all
ControlSend, Scintilla1, ^v, ahk_exe Notepad++.exe
Code: Select all
ControlSend, Scintilla1, ^v, ahk_exe Notepad++.exe
Code: Select all
#If WinActive("ahk_exe Notepad++.exe")
F1::
ControlSend, Scintilla1, ^v, ahk_exe Notepad++.exe
#If
Code: Select all
#Persistent
OnClipboardChange("AutoPaste")
Return
AutoPaste()
{
ControlSend, Scintilla1, ^v, ahk_exe Notepad++.exe
}
In case the above version is used, I just wanted to note that it can lead to bad results depending on what may follow it in the script. Always use return at the end of a hotkey subroutine:jmeneses wrote: ↑ This sends Ctrl + V only to Notepad ++. Exe by function key <F1>
Code: Select all
#If WinActive("ahk_exe Notepad++.exe") F1:: ControlSend, Scintilla1, ^v, ahk_exe Notepad++.exe #If
Code: Select all
#If WinActive("ahk_exe Notepad++.exe")
F1::
ControlSend, Scintilla1, ^v, ahk_exe Notepad++.exe
return
#If
Code: Select all
#If WinActive("ahk_exe Notepad++.exe")
F1::ControlSend, Scintilla1, ^v, ahk_exe Notepad++.exe
#If
Code: Select all
#IfWinActive, ahk_exe Notepad++.exe
F1::
MsgBox, Only this message is meant to be displayed when F1 is pressed.
#If
F2::
MsgBox, This is the subroutine where all the data files are deleted.
return
You're right Boiler, thanks for keeping an eye on meIn case the above version is used, I just wanted to note that it can lead to bad results depending on what may follow it in the script. Always use return at the end of a hotkey subroutine:
Code: Select all
#SingleInstance, Force
#Persistent
OnClipboardChange("ClipChanged")
return
ClipChanged() {
ControlSend, Scintilla1, ^v`n, ahk_exe Notepad++.exe
}
return
Esc::MsgBox BYE
ExitApp
Code: Select all
Esc::
MsgBox BYE
ExitApp
Code: Select all
#SingleInstance, Force
#Persistent
OnClipboardChange("ClipChanged")
return
ClipChanged() {
ControlSend, Scintilla1, ^v`n, ahk_exe Notepad++.exe
}
return
Esc::
MsgBox BYE
ExitApp
Code: Select all
#SingleInstance, Force
#Persistent
OnClipboardChange("ClipChanged")
return
If !Winexist("ahk_exe notepad++.exe")
{
Run, C:\Program Files (x86)\Notepad++\notepad++.exe
}
else
ClipChanged() {
ControlSend, Scintilla1, ^v`n, ahk_exe Notepad++.exe
}
return
Code: Select all
If !Winexist("ahk_exe notepad++.exe")
Run, C:\Program Files (x86)\Notepad++\notepad++.exe
else
ClipChanged() ; this a function call
return
; this is the function:
ClipChanged() {
ControlSend, Scintilla1, ^v`n, ahk_exe Notepad++.exe
}
Code: Select all
#SingleInstance, Force
#Persistent
OnClipboardChange("ClipChanged")
return
ClipChanged() {
if !Winexist("ahk_exe notepad++.exe")
Run, C:\Program Files (x86)\Notepad++\notepad++.exe
else
ControlSend, Scintilla1, ^v`n, ahk_exe Notepad++.exe
}
Code: Select all
#SingleInstance, Force
#Persistent
if !Winexist("ahk_exe notepad++.exe")
Run, C:\Program Files (x86)\Notepad++\notepad++.exe
OnClipboardChange("ClipChanged")
return
Esc::
MsgBox BYE
ExitApp
ClipChanged() {
ControlSend, Scintilla1, ^v`n, ahk_exe Notepad++.exe
}
Users browsing this forum: ntepa and 122 guests