@Louis-Windsor said in Facilities to create PostScript hotkeys:
@PeterJones
Sorry - POSTscript was a typo. I meant PythonScript…
Response to your response from the AI
Your AI is wrong. Please do not rely on it anymore. I cannot argue the points with the AI, as it is not capable of thought, but I will respond to one point:
❌ There is NO WAY to assign a hotkey to a PythonScript 3.x script.
I literally used hotkeys in PythonScript 3.0.24 on near daily basis. It is obviously possible, as I do it.
Based on its response, I am assuming you were giving it an argumentative prompt, and/or it was prompted by my use of “nonsense” to get defensive. That is unfortunate, as it is not helping you get the information you need.
I hope I can explain to you how to do it, without using the FAQ – though I will personally be followinng the steps from the FAQ.
At this point, please stop feeding my responses to the AI, and getting it to argue with me. Try the steps I outline, and show all of the same screenshots I do to confirm that you are getting different results when you follow the same instructions. Without your actual results, neither I nor anyone else can help you. (And obviously, the AI just wants to encourage you to fight with me, which is not helpful for anybody.)
I will reword the instructions that I already wrote in the FAQ just to help you. This is how important it is to me to help you understand how to do this.
I am testing these steps PythonScript 3.0.25, and will be following my own instructions that I am typing to you while I take the screenshots. These replicate the steps in the FAQ.
My assumptions are:
you already have PythonScript 3.0.x installed – hopefully 3.0.25, but the interface hasn’t changed since before PythonScript 2.0, so the screenshots should still match what you have.
you already have created the script, and it shows up in
Plugins > Python Script > Scripts
These are the instructions I am following from the FAQ:
810bd3a1-767c-4853-8478-30ecef125868-image.png
The instructions, with screenshots:
First, here is confirmation that I’m running PythonScript 3.0.25, based on a screenshot of PythonScript ABOUT box:
15d647cb-89f8-4e83-b4dd-2c509abe64a2-image.png
please show your ABOUT box if following these instructions do not work for you
This shows I have already created the ProvidedScript.py, and it is in my scripts menu, but not in the main PythonScript menu.
07dbf7c3-354c-4b8b-b93e-b7688e02174d-image.png
please show a screenshot of your Scripts submenu if these instructions do not work for you
The FAQ instructions tell me to go Plugins >Python Script > Configuration…: I follow those instructions, and confirm the menu entry exists:
a8e1b405-8a69-4cef-bdbd-51b624feca6d-image.png
When I click that menu entry, I see the following dialog:
55116936-786f-4600-a6d7-ac2fdd2695cc-image.png
please show a screenshot of your Python Script Configuration dialog if these instructions do not work for you
The FAQ instructions tell me to pick User Scripts next. That is already selected, as shown in screenshot for step 4
The instructions tell me to select ProvidedScript.py. I click that, so it’s now got a highlight/selection bubble around it:
5557ddbd-3de3-48e8-9431-b9f767e01bdc-image.png
The instructions tell me to “Click the left Add to add the script to the Menu items table”. In this dialog, I see two Add buttons, so in the next step, I will click the left one: here is a screenshot with that button pointed to with a big green arrow. Do not click the one with the red arrow:
2694be83-2f6f-4e6c-b3eb-e9113cfbc38f-image.png
I follow the instructions to click the left Add button. Now the dialog has changed, to include my script in the Menu items list:
29a0a588-c9c5-41e7-8e54-31c7ed0609f8-image.png
The instructions next say to click OK. I won’t supply another screenshot, as that button is easily findable.
The FAQ instructions tell me to “Exit Notepad++ completely and restart the application”. You have to do this in order for Notepad++ to be able to assign the keyboard shortcut. If you skip this step, the remainder of my instructions will not work. So I exit and restart Notepad++ (no screenshots)
The FAQ next says, “Plugins > Python Script will now list ProvidedScript”: here is a screenshot showing that is true for me:
5cfb3078-27cc-44c4-90b3-f1dc1c8e1024-image.png
The FAQ says to use Notepad++'s shorcut mapper using Settings > Shortcut Mapper. First, here is a screenshot of the menu, which includes that entry:
410d5795-3467-481b-b6a4-6d08e833aebf-image.png
When I click that entry, I get the following dialog:
10554875-a304-4b81-abc1-9e9a7002447c-image.png
As the FAQ says, I next “select the Plugin commands tab”. In that dialog, I see “Plugin commands” at the top, so I click it, and see:
888bff07-7469-4297-9f46-5d9deca66fc9-image.png
As the FAQ says, I next “Filter = ProvidedScript”. I see the Filter box in the dialog, so I type ProvidedScript there, and now see
6bce1beb-3275-486a-8b57-0d00ecfa3d58-image.png
Cool, I can see that ProvidedScript is available to the Shortcut Mapper with PythonScript 3.0.25 at this point. Making good progress.
If following these instructions is not working for you, please change the Filter to PythonScript, and then show a screenshot of your Shortcut Mapper dialog
The FAQ says, “Click on ProvidedScript in the list”, so I click on it. and can see that it’s been highlighted as active:
63578c9d-38ae-40e2-927e-68aff5198ae4-image.png
The FAQ instructs me to Modify, so I click that button, and a new dialog pops up:
6080b175-299c-4230-97e7-fe9c855b3477-image.png
The FAQ next says, “and set the shortcut as desired”, so I pick Ctrl+Alt+Shift+P:
86f26c35-2605-44b4-b3d2-2480faceb334-image.png
if following these instructions is not working for you, please share the screenshot here, if you made it this far
The FAQ tells me that OK is next, so I click that, and it goes back to the full Shortcut Mapper dialog, which now shows that Ctrl+Alt+Shift+P is the shorcut:
2d0f869e-5cd5-4dd7-a622-8c98429d17e1-image.png
At this point, the FAQ tells me that I can Close the dialog, so I do.
To check, I look at the Plugins > PythonScript menu again, and see that it now lists the shortcut next to ProvidedScript. Cool:
fec726a2-1e55-49a7-93ad-bef9224411a8-image.png
Finally, I do Ctrl+Alt+Shift+P, and it runs my script.
This was all with PythonScript 3.0.25. But it will work with any of the recent 3.0.x versions. And, in fact, it would even work with PythonScript 2.1, because those dialogs are essentially unchanged between the versions.
At this point, I have confirmed that PythonScript 3.0.25 allows me to use Notepad++'s Shortcut Mapper to set a keyboard shortcut (“hotkey”) for a script in PythonScript.
Follow these instructions, and it should work for you. If you have difficulty, provide the screenshots requested.
Don’t bother feeding these into the AI. It won’t help you. Just try the instructions, and if they don’t work, provide the data so we can help you figure out why it’s not working.
update: Since I know the instructions work, I am guessing that you probably missed step 10 – exiting Notepad++ completely and restarting the application. Without that step, Shortcut Mapper will not see the script. Given the implications of your original post, this seems like the most likely thing to have gone wrong
update 2: aside from the screenshots requested, if you have problems, make sure you also go to the Notepad++ ? menu, and share the Debug Info results, in their entirety