Run script or selection from Notepad++

Scripting and setups with Notepad++ and AutoHotkey.
chrisbtbi
Posts: 8
Joined: 25 Oct 2019, 15:14

Re: Run script or selection from Notepad++

Post by chrisbtbi » 25 Oct 2019, 15:18

Does this work in 2019? I followed all the steps but it doesn't appear to do anything...

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 25 Oct 2019, 15:38

Do you perhaps have Notepad++ set up for a language other than English? If so, see toralf's post.

chrisbtbi
Posts: 8
Joined: 25 Oct 2019, 15:14

Re: Run script or selection from Notepad++

Post by chrisbtbi » 25 Oct 2019, 15:48

No, I have it set up in English.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 25 Oct 2019, 15:54

I don't have it set up on my new computer because I use Visual Studio Code now.

So you have a script in your Notepad++ window, and when you select "Run Script" from the menu, it does not run your script?

chrisbtbi
Posts: 8
Joined: 25 Oct 2019, 15:14

Re: Run script or selection from Notepad++

Post by chrisbtbi » 25 Oct 2019, 15:58

Yes, for testing purposes. I just created a new file and typed msgbox, "Test". If I save and run it as an .ahk file it works. If I try and click the play button or use the run command from the drop down menu's it appears as though it is trying to do something but then nothing happens. I'm running the most up to date AutoHotKey and Notepad++. Do I have to have the script you made in a specific folder?

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 25 Oct 2019, 16:02

It shouldn't matter what the location of the script is as long as when you were creating the menu item, you browsed to where you have it located and selected the script. I'll try installing it on my new machine and see if it works for me.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 25 Oct 2019, 16:10

I just installed it, and it works.

When you say "If I try and click the play button or use the run command from the drop down menu's", what run command are you choosing from the menus? Did you create a Run Script menu item as described in the instructions? Do you have a new menu item at the bottom of the Run menu (just above "Modify Shortcut/Delete Command...")?

chrisbtbi
Posts: 8
Joined: 25 Oct 2019, 15:14

Re: Run script or selection from Notepad++

Post by chrisbtbi » 25 Oct 2019, 16:20

Weird... Yes I created the "Run Script" command as in the instructions and it does show up in the Run drop down menu just above the "Modify Shortcut/Delete Command..."

Like I said, it looks like it tries to do something. My cursor blinks for a second. I was watching task manager to see if I could spot any tasks starting/changing memory usage to see what it's doing.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 25 Oct 2019, 16:28

I don't see a way of checking what a menu item is pointing to, so I suggest creating it again. Choose "Modify Shortcut/Delete Command..." and delete the Run Script item you created, then create it again per the instructions, making sure that you select the RunScript_Notepad++.ahk file and not the zip file or something.

chrisbtbi
Posts: 8
Joined: 25 Oct 2019, 15:14

Re: Run script or selection from Notepad++

Post by chrisbtbi » 25 Oct 2019, 16:47

Yeah I though the same thing. I tried it, but to no avail...

Just to ensure I'm not missing something I'm attaching some screenshots of the 4 steps to map the run command. Also, I've ensured it wasn't being blocked by antivirus/antimalware protections.

Step 1 - https://imgur.com/vN6Spua
Step 2 - https://imgur.com/COGnQze
Step 3 - https://imgur.com/cmnNjGU
Step 4 - https://imgur.com/IwdKe36
Last edited by chrisbtbi on 28 Oct 2019, 13:39, edited 3 times in total.

chrisbtbi
Posts: 8
Joined: 25 Oct 2019, 15:14

Re: Run script or selection from Notepad++

Post by chrisbtbi » 25 Oct 2019, 16:48

.
Last edited by chrisbtbi on 28 Oct 2019, 13:08, edited 1 time in total.

chrisbtbi
Posts: 8
Joined: 25 Oct 2019, 15:14

Re: Run script or selection from Notepad++

Post by chrisbtbi » 25 Oct 2019, 16:55

OMG I just figured it out. For some reason I had to go into Notepad++ and configure it to run as an administrator under the "Compatibility" tab.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 25 Oct 2019, 17:38

Ah, OK. I was going to suggest trying to run my script as admin, but that wouldn't be easy given the setup. Glad you got it working.

At least you provided some good visuals for people who are setting it up in the future. :thumbup:

chrisbtbi
Posts: 8
Joined: 25 Oct 2019, 15:14

Re: Run script or selection from Notepad++

Post by chrisbtbi » 28 Oct 2019, 12:53

I do hope someone can use the visuals for setting it up in the future. I'm going to try and find some image hosting service and re-post the images because the board appears to have compressed them beyond legibility.

Thanks for your help and for such an awesome script! I look forward to using it! =)

User avatar
rediffusion
Posts: 58
Joined: 15 Mar 2019, 05:16

Re: Run script or selection from Notepad++

Post by rediffusion » 09 Dec 2019, 15:04

@chrisbtbi
Damn! 1-hour dude 1 hour I try to figure out why it's not working! 10x you. :dance:

@boiler , I agree with @haichen works like charm. :clap:
Last edited by rediffusion on 09 Dec 2019, 17:37, edited 1 time in total.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 09 Dec 2019, 16:22

I'm glad you find it useful (even though I'm not jNizM :) ).

User avatar
rediffusion
Posts: 58
Joined: 15 Mar 2019, 05:16

Re: Run script or selection from Notepad++

Post by rediffusion » 09 Dec 2019, 17:41

@boiler

Right now I have some problem with the icon "arrow". It's displayed but not clickable!

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 09 Dec 2019, 19:09

rediffusion wrote: Right now I have some problem with the icon "arrow". It's displayed but not clickable!
What's in your CustomizeToolbar.btn file? Does it contain the following?
Run,Run Script,,,Run btn.bmp

Is it located in your AppData\Roaming\Notepad++\plugins\config directory?

User avatar
rediffusion
Posts: 58
Joined: 15 Mar 2019, 05:16

Re: Run script or selection from Notepad++

Post by rediffusion » 10 Dec 2019, 00:36

@boiler

Yes, yes and yes.

I've:
Spoiler

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Run script or selection from Notepad++

Post by boiler » 10 Dec 2019, 02:51

It was noted by Johana earlier in this thread that the customizer plugin only works with the 32-bit version of Notepad++, so that’s probably it.

Post Reply

Return to “Notepad++”