Can you run a script from within notepad++
(had to change some settings in the registry)
can the same be done with Notepad ++ ?
Then press save and settings will pop up. Type for Name AutoHotkey and select your Hotkey here then press ok.
I did this but nothing happenedGo to menu Run, select Run, then select your AutoHotkey.exe.
Then press save and settings will pop up. Type for Name AutoHotkey and select your Hotkey here then press ok.
maybe i didnt explain well
In Textpad I have a script open I am working on
I save it then press CTRL and 1 and the script runs, or doesnt if there is a fault.
I have done as you suggested, now I have a scipt open and saved but I press Ctrl Shift 1 and nothing happens the script is not run
I found a post by Vixay and it worked:
You can also use nppexec plugin
Plugins>NPPexec>Execute..
Put in this:
C:\Program Files\AutoHotkey\autohotkey.exe "$(FULL_CURRENT_PATH)"
and save as a new script titled AHK.... then you can use F6 to launch...
No editing of .xml files required!
I've been using this and it works well.
Look at the link, scroll down to RunMe. It says
RunMe (ANSI / Unicode)
I found a post by Vixay and it worked:
You can also use nppexec plugin
Plugins>NPPexec>Execute..
Put in this:
C:\Program Files\AutoHotkey\autohotkey.exe "$(FULL_CURRENT_PATH)"
and save as a new script titled AHK.... then you can use F6 to launch...
The following is even simpler (no plugin needed) if you can already run AHK scripts from Explorer. And it's generic, so it'll work with other types of scripts (batch files, webpages, etc.):
- Go to menu Run > Run...
- Put in "$(FULL_CURRENT_PATH)"
- Either click Run to launch it now or Save it and associate it to a hotkey shortcut to reuse later.
If you wanted to add a context menu ( when you right click ) to have a mouse click option, I've created a script that helps out. This should give anyone a good idea on how to work with notepad and ahk. I'm sure this could be improved, but it works fantastic for my use.
this is my script
; var 1 is the argument from the Run command
#NoTrayIcon
blockinput,on
SendInput ^s
Sleep 100
blockinput,off
IfWinActive,Save As
{
Msgbox,16,Notice,You have to save the file first. Then rerun the short cut.
exitapp
}
Sleep 20
ifexist,%1%
{
ifinstring,1,.ahk
run,AutoHotkey.exe /f "%1%"
else
run, %1%
}
exitapp
;Menu -> Run -> Run...
;Enter the run command and chose "Save..."
;Save the command as Run Current
;Save this script at (Inside Notepadd++ Directory)\customs\run_current.ahk
;Edit the context menu to add the right click function
;Restart Notepad++
;Note: If Notepad++ doesn't start, then the Syntax of contextMenu.xml is incorrect
;run command
;AutoHotkey.exe /f "$(NPP_DIRECTORY)\customs\run_current.ahk" "$(FULL_CURRENT_PATH)"
;ahk file path
;(Inside Notepadd++ Directory)\customs\run_current.ahk
;context menu location (Windows XP)
;C:\Documents and Settings\<username>\Application Data\Notepad++\contextMenu.xml
;add line
;<Item MenuEntryName="Run" MenuItemName="Run Current"/>