Setup Notepad++ for AutoHotkey
-
- Posts: 21
- Joined: 29 Oct 2019, 12:56
Re: Setup Notepad++ for AutoHotkey
YaY, it worked just like expected this time. I've previously downloaded them from GitHub. It may be that. Someone needs to verify this.
Re: Setup Notepad++ for AutoHotkey
Added v2 Commands and Functions to userDefineLang.xml
[AHK] v2.0.18 | [WIN] 11 Pro (23H2) | [GitHub] Profile
- Joe Glines
- Posts: 772
- Joined: 30 Sep 2013, 20:49
- Location: Dallas
- Contact:
Re: Setup Notepad++ for AutoHotkey
We had a great AutoHotkey webinar yesterday on how to setup Notepad++ for AutoHotkey.
You can get the files we created for Notepad++ here (not to mention our tool for pulling up help by hitting F1)
Here's the first hour where we walk through how to install and configure Notepad++. There is a second hour but we didn't discuss Notepad++ much in that hour.
You can get the files we created for Notepad++ here (not to mention our tool for pulling up help by hitting F1)
Here's the first hour where we walk through how to install and configure Notepad++. There is a second hour but we didn't discuss Notepad++ much in that hour.
Sign-up for the HK Newsletter
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
AHK Tutorials:Web Scraping | | Webservice APIs | AHK and Excel | Chrome | RegEx | Functions
Training: AHK Webinars Courses on AutoHotkey
YouTube
Quick Access Popup, the powerful Windows folders, apps and documents launcher!
Re: Setup Notepad++ for AutoHotkey
I'm having this problem (bad highlights, bad "fold" groupings, etc) and I've already got userDefineLang_AHK.xml in the directory. The above mentioned "trick" of clicking on Languages->AutoHotKey to temporarily fix the problem does not work for me. I have tried on 7.9.5 as well as 8.0. I've made a post on Npp's forums about this, but so far no fix has presented itself.sofista wrote: ↑09 Mar 2021, 08:56@don_dolarson , @jNizM
If problems persist, this worked for me for the current portable version (7.9.3) and Windows 7 (it should be the same for Windows 10):
quit Notepad++, copy the userDefineLang_AHK.xml file and paste into the userDefineLangs directory. Restart Notepad++. AutoHotkey should be listed under the Language menu.
Re: Setup Notepad++ for AutoHotkey
In the quoted post I was referring to the installation process, which had recently changed. Regarding the Folding feature, I hardly use it but I have noticed that it has problems. I use the Function List instead and it works fine.Darxide23 wrote: ↑14 Jun 2021, 09:55I'm having this problem (bad highlights, bad "fold" groupings, etc) and I've already got userDefineLang_AHK.xml in the directory. The above mentioned "trick" of clicking on Languages->AutoHotKey to temporarily fix the problem does not work for me. I have tried on 7.9.5 as well as 8.0. I've made a post on Npp's forums about this, but so far no fix has presented itself.sofista wrote: ↑09 Mar 2021, 08:56@don_dolarson , @jNizM
If problems persist, this worked for me for the current portable version (7.9.3) and Windows 7 (it should be the same for Windows 10):
quit Notepad++, copy the userDefineLang_AHK.xml file and paste into the userDefineLangs directory. Restart Notepad++. AutoHotkey should be listed under the Language menu.
I also noticed that sometimes there are problems with highlighting -nothing surprising, since I use quite a lot of plugins and enhancements-, but anyway they are solved by selecting Normal language and then going back to AutoHotkey -of course, I do it with a script
Finally, I would suggest you to install the portable version of Notepad++ 7.9.5 -version 8 is very new and has issues- and see what happens. If it works fine or at least better, then the problem may be due to an interference from a plugin of the installed version.
Re: Setup Notepad++ for AutoHotkey
I also have no plugins. It's a vanilla install of Npp. I've gone back several versions of Npp and this issue persists. The first mention of this issue I see in this post is from over a year ago and the guy from the NPP forums was surprised the issue has gone on so long without coming to his attention or someone here making a lexer plugin instead of a UDL. I did some searching and someone did attempt a lexer plugin in 2013, but abandoned it before completion.
I made a bug report of this on Npp's github at the request of the guy from their forums since he wasn't aware of this problem and searching open issues couldn't dig up anything quite like this.
Re: Setup Notepad++ for AutoHotkey
I see. The purpose of using the portable version is not only to rule out incompatibilities with a plugin but also to rule out a corrupted configuration file.Darxide23 wrote: ↑14 Jun 2021, 13:15I also have no plugins. It's a vanilla install of Npp. I've gone back several versions of Npp and this issue persists. The first mention of this issue I see in this post is from over a year ago and the guy from the NPP forums was surprised the issue has gone on so long without coming to his attention or someone here making a lexer plugin instead of a UDL. I did some searching and someone did attempt a lexer plugin in 2013, but abandoned it before completion.
I made a bug report of this on Npp's github at the request of the guy from their forums since he wasn't aware of this problem and searching open issues couldn't dig up anything quite like this.
These are standard procedures. At least for now I can't think of any other idea worth suggesting, sorry
Re: Setup Notepad++ for AutoHotkey
Yea, I get it. But I already did because I thought I was on 8.0 because doing the update check said there were no updates, so I downloaded the 7.9.5 portable. Turns out I was on 7.9.5 the whole time, so I updated to 8.0 on the off chance it would change anything. So neither worked. I then tried a couple of other portable versions going back and all were still a no go.
EDIT: And I also get that this isn't the problem of this UDL, either. It's a Npp problem. Was just hoping someone had solved it, but it seems like it's actually a problem deeper within Npp than can't be fixed by the end user.
Re: Setup Notepad++ for AutoHotkey
Updated for N++ v8.1
Please test and report bugs or submit a change request.
Please test and report bugs or submit a change request.
[AHK] v2.0.18 | [WIN] 11 Pro (23H2) | [GitHub] Profile
Re: Setup Notepad++ for AutoHotkey
Sorry guys, i have a problems with Text color with the ahk_Userdefine language (xml file)
On my laptop, it worked perfectly fine with, dark theme (notepad++ Obsidian theme), with Default Text and Number turn into white color, so it's very easy to read with dark background. The problem is in my desktop, i use the same xml file but the Default text and number which supposed to be white, turn into black, that make it very hard to read with dark background. The other syntax hightlights were OK
Both my laptop and desktop use Window 10 64bit.
I already tried both Notepad++ 32 and 64bit version but the problem still there. (v8.1.4)
In this thread, i found a guy posting bout same problem with me but had no answear
Can anybody help me solve this! Thanks in advance
On my laptop, it worked perfectly fine with, dark theme (notepad++ Obsidian theme), with Default Text and Number turn into white color, so it's very easy to read with dark background. The problem is in my desktop, i use the same xml file but the Default text and number which supposed to be white, turn into black, that make it very hard to read with dark background. The other syntax hightlights were OK
Both my laptop and desktop use Window 10 64bit.
I already tried both Notepad++ 32 and 64bit version but the problem still there. (v8.1.4)
In this thread, i found a guy posting bout same problem with me but had no answear
Can anybody help me solve this! Thanks in advance
Re: Setup Notepad++ for AutoHotkey
@D4ng_kun
Hi. If it's a userdefined language it should be in Notepad++ menu: Language -> User Defined Language -> "Define your language...". From there select Autohotkey in the drop-down "User Language". Then you should be able to change the Default style colors. Choose a foreground and background color, or just right-click in the background color preview square thing to make it transparent.
And / or, you could also look at the menu: Settings -> Style Configurator...
In the Language list-box, look at "Global Styles", then see in the right-side Style listbox if there are any Global overrides, or a Default style defined.
Hi. If it's a userdefined language it should be in Notepad++ menu: Language -> User Defined Language -> "Define your language...". From there select Autohotkey in the drop-down "User Language". Then you should be able to change the Default style colors. Choose a foreground and background color, or just right-click in the background color preview square thing to make it transparent.
And / or, you could also look at the menu: Settings -> Style Configurator...
In the Language list-box, look at "Global Styles", then see in the right-side Style listbox if there are any Global overrides, or a Default style defined.
-
- Posts: 1
- Joined: 04 Dec 2021, 20:32
Re: Setup Notepad++ for AutoHotkey
For anyone looking for a Dark Mode Version of the Language Style, it's really easy to do your self.
First, ensure the global Sylte Configurator isn't overridding the font color
Settings>Style Configurator
Select Language:"Global Styles", and Style:"Global Override". Ensure "Enable Global Font Colour" is unchecked, else it will force all text to be that color.
-------
After successfully installing the Syntax-Highlighting file as instructed, in the menu go to Language>User Defined Language>Define your language...
A new window will appear -
In the top left, select AutoHotkey in the User language Drop down menu. Then Click Save-As in the top row of buttons, and give it a logical name like AHK_DarkMode.
The rest of the window is made up of multiple sections, ignore 99% of it, you're only interested in the "Styler" button in each section, also note there are 4 tabs of sections "Folder & Default", "Keywords" and so on.
When you click on Styler, and stlye window will appear allowing you chose the foreground and Background color of each section. I just switched all the black color white, switched white to black and made all the colors more vibrant versions of them selves (With the exception of the section "Keywords>1st Group" - I made it yellow instead of green so it's not the same color as comments) (Also reds are bit more pink so they stand out better).
When you're happy, click Export and save that file somewhere safe so next time you reinstall Notepad++ you don't have to start again.
------
Of course if you're too lazy, here is the file I made - full credit and a thank you to jNizM for the original file
First, ensure the global Sylte Configurator isn't overridding the font color
Settings>Style Configurator
Select Language:"Global Styles", and Style:"Global Override". Ensure "Enable Global Font Colour" is unchecked, else it will force all text to be that color.
-------
After successfully installing the Syntax-Highlighting file as instructed, in the menu go to Language>User Defined Language>Define your language...
A new window will appear -
In the top left, select AutoHotkey in the User language Drop down menu. Then Click Save-As in the top row of buttons, and give it a logical name like AHK_DarkMode.
The rest of the window is made up of multiple sections, ignore 99% of it, you're only interested in the "Styler" button in each section, also note there are 4 tabs of sections "Folder & Default", "Keywords" and so on.
When you click on Styler, and stlye window will appear allowing you chose the foreground and Background color of each section. I just switched all the black color white, switched white to black and made all the colors more vibrant versions of them selves (With the exception of the section "Keywords>1st Group" - I made it yellow instead of green so it's not the same color as comments) (Also reds are bit more pink so they stand out better).
When you're happy, click Export and save that file somewhere safe so next time you reinstall Notepad++ you don't have to start again.
------
Of course if you're too lazy, here is the file I made - full credit and a thank you to jNizM for the original file
Re: Setup Notepad++ for AutoHotkey
Your syntax for the registry to make notepad++ the default editor for autohotkey has an error in it - REG ADD HKCR\AutoHotkeyScript\Shell\Edit\Command /ve /t REG_SZ /d ^%SystemRoot^%"\Program Files\Notepad++\notepad++.exe %1" /f should be REG ADD HKCR\AutoHotkeyScript\Shell\Edit\Command /ve /t REG_SZ /d ^%SystemRoot^%"\Program Files\Notepad++\notepad++.exe" "%1" /f with a double quote after ".exe" and a double quote before "%1" . Then the registry change will work .
Re: Setup Notepad++ for AutoHotkey
Hello;
First let me apologize if this question has been beaten to death. I have searched the forums, and did my due diligence on Google to the best of my ability, sadly the more I look the more confused I get.
I use NPP for doing ticket creation on the Job, (not a programmer) just like the functionality as it lends it self to long drawn out work logs. I'm attempting to learn AHK, still doing basic stuff using hot keys, etc. I can not for the life of me figure out why NPP completely ignores input from AHK. For example ::inie::Initial email and reply, fills this line or ::@bu:: fills a string of email address' everywhere except NPP, its as if it completely misses it. It works in plain old txt editors, etc. I'm at a loss here. I have tried and failed to install user defined lang, auto complete, changed the preferences, etc., pages are ANSI. I just am trying to understand what I'm missing here.
Eventually the goal is to learn enough AHK to have an automated work log with user input that will complete said work log and save it to a text file (for insertion into the TT) But at this point, NPP will not execute (is that the correct term?) anything from AHK. Right now I'm not even sure if I'm asking the correct question, if not my apologies.
Any pointer, help, guidance etc. would be greatly appreciated. Thank you.
NPP v8.3.3 (64)
AHK v1.1.33.11
Win 10x Enterprise v21H2
First let me apologize if this question has been beaten to death. I have searched the forums, and did my due diligence on Google to the best of my ability, sadly the more I look the more confused I get.
I use NPP for doing ticket creation on the Job, (not a programmer) just like the functionality as it lends it self to long drawn out work logs. I'm attempting to learn AHK, still doing basic stuff using hot keys, etc. I can not for the life of me figure out why NPP completely ignores input from AHK. For example ::inie::Initial email and reply, fills this line or ::@bu:: fills a string of email address' everywhere except NPP, its as if it completely misses it. It works in plain old txt editors, etc. I'm at a loss here. I have tried and failed to install user defined lang, auto complete, changed the preferences, etc., pages are ANSI. I just am trying to understand what I'm missing here.
Eventually the goal is to learn enough AHK to have an automated work log with user input that will complete said work log and save it to a text file (for insertion into the TT) But at this point, NPP will not execute (is that the correct term?) anything from AHK. Right now I'm not even sure if I'm asking the correct question, if not my apologies.
Any pointer, help, guidance etc. would be greatly appreciated. Thank you.
NPP v8.3.3 (64)
AHK v1.1.33.11
Win 10x Enterprise v21H2
Re: Setup Notepad++ for AutoHotkey
If your scripts aren’t working with Notepad++ at all, it might be that it is running as an elevated process (running as administrator). Try running your script as administrator by right-clicking on the script file in File Explorer and selecting that option.
Another potential issue is if you have Notepad++ set to auto-complete. That can mess with the text that AHK is trying to send to it. Try disabling that feature if you have it enabled.
Another potential issue is if you have Notepad++ set to auto-complete. That can mess with the text that AHK is trying to send to it. Try disabling that feature if you have it enabled.
Re: Setup Notepad++ for AutoHotkey
That makes perfect sense, thank you going to give it a shot!
Re: Setup Notepad++ for AutoHotkey
@boiler That was it! I ran the script elevated and it works like a champ. Can't believe how overly complicated I made that (personality flaw) Brilliant, Thank you
Re: Setup Notepad++ for AutoHotkey
Does anyone know how to bypass the admin rights needed to add the auto-complete xml?
-
- Posts: 17
- Joined: 14 Feb 2016, 00:45
Re: Setup Notepad++ for AutoHotkey
I've been using AHK heavily for about 20 years. Suddenly Notepad++ stopped responding at all. Your answer here did the trick after I'd spent about 4 fruitless hours researching and testing.
Notepad++ Download
Don't forget to include the link to the Notepad++ website in a seperate forum thread!
https://notepad-plus-plus.org/
Ben
https://notepad-plus-plus.org/
Ben