Page 1 of 1

Adding toolbar button to Run an AutoIT script

Posted: 14.11.2024 10:28
by sl23
I'm trying out adding a button that will basically run a script using AutoIt3_x64.exe. I've created a button, and added all the necessary arguments. The only thing I am having trouble with, is that when I click the toolbar button, it tries to open the AutoIt3_x64.exe file instead of running it. I haven't specified the full command, as I am unsure how it works.

Am I doing it the right way, or should I be using the External Tools plugin as stated on the wiki?

What I would like to do is replace SCiTe with CudaText, as it is far easier and much better to use imo.

The functions I would like replaced, though I am not really sure these are all possible, are:
1. SCiTe/Tools/Go command. Used to run a script.
2. Replace SCiTe console (bottom panel) output with CudaText. This shows any errors in the script.
3. Replace SCite/Tools/Compile command. This uses Aut2Exe.exe to compile a script.

So I need two buttons and confirmation all this is possible please.

Thanks. :)

Re: Adding toolbar button to Run an AutoIT script

Posted: 14.11.2024 10:35
by main Alexey
you need one of two plugins: External Tools (easier for you) or Runner (harder, it needs config in JSON file).
the wiki shows examples of ExtTools plugin - how to run .exe apps.
https://wiki.freepascal.org/CudaText_plugins


So I need two buttons and confirmation all this is possible please.
yes, all this is possible.
item 1. ExtTools plugin or Runner plugin (harder than ExtTools).
item 2. plugin Terminal Plus or ExTerminal (2nd is easier)
item 3. like item 1.

Re: Adding toolbar button to Run an AutoIT script

Posted: 14.11.2024 10:47
by sl23
Ah, that's great, thanks!
I will likely get stuck, so will be back soon no doubt! lol
Thank you for your help ;)

Re: Adding toolbar button to Run an AutoIT script

Posted: 14.11.2024 13:38
by sl23
After a hiccup, I have managed to get things back on track. I have the two buttons on the toolbar. Installed both plugins that you suggested:
ExtTools and ExTerminal, though I am unable to get the output panel to show anything when I run a script.

However, if I click Plugins/ExTerminal/CD to current file's directory, then it shows some output. This disappears when I then click the button again.

Is there a way to set it to automatically use the current file's directory?

While writing this, I updated from Cudatext v 1.218.0 to v1.219.0.2.
Now my Toolbar buttons have become enlarged:
sshot-003.jpeg
These were showing the icons at a size of 16x16. But now are around 30x30. I am using Fugue_16x16 icon set for non standard icons. The AutoIT icons are png's of 48x48.

It would be useful to be able to specify a size for toolbar icons to be shown at. Regardless of the size of the icon. It currently seems to be automatic?

As for the two AutoIT buttons, I have no idea how I get the Output Panel to work as desired. Here is a pic of the settings for the ExternalTools AutoIT3_x64.exe:
Tools.JPG
Could you point out what I need to change please.
Thank you.

Also, is it possible to highlight errors in the Output Panel, similar to SCiTe? Currently, errors aren't shown/detected. Would be great to see where the problems lie.

Re: Adding toolbar button to Run an AutoIT script

Posted: 15.11.2024 11:40
by main Alexey
>ExtTools and ExTerminal, though I am unable to get the output panel to show anything when I run a script.
ExtTools tool properties must have option which tells to put output to Output panel.
maybe it's called 'Capture output' or like this.
did you set it?
>ExTermilal.....Is there a way to set it to automatically use the current file's directory?
no, ExTerminal has its own current folder so e.g. when you switch ui-tabs, its current dir is not affected.
you should call 'Plugins/ExTerminal/CD to current file's directory'.
>I updated from Cudatext v 1.218.0 to v1.219.0.2. Now my Toolbar buttons have become enlarged:
do you see this in clean Cud with only custom toolbar theme?
do you see this only if you add toolbar btns with 48x48 icons?
maybe smthing is changed in Lazarus.
ie imagelist sizes change when you add 48x48 icon.

its regression in 1.129 or other versions have it?
>would be useful to be able to specify a size for toolbar icons to be shown at. Regardless of the size of the icon. It currently seems to be automatic?
yes.
>Could you point out what I need to change please.
try to toggle 'Shell command' checkbox.
>is it possible to highlight errors in the Output Panel, similar to SCiTe? Currently, errors aren't shown/detected.
tool properties dlg has 'Pattern' option. press 'Set' near it, set regex there.
some presets exists there AFAIR.

Re: Adding toolbar button to Run an AutoIT script

Posted: 21.11.2024 13:26
by sl23
main Alexey wrote: 15.11.2024 11:40
>ExtTools and ExTerminal, though I am unable to get the output panel to show anything when I run a script.
ExtTools tool properties must have option which tells to put output to Output panel.
maybe it's called 'Capture output' or like this.
did you set it?
Sorry, no idea how. I can find nothing like that. I've also installed Terminal+ and that shows a terminal but no output is shown. I think I'll drop the idea as it's just way out of my league trying to set this up, and I don't want to take up too much of your time.
>ExTermilal.....Is there a way to set it to automatically use the current file's directory?
no, ExTerminal has its own current folder so e.g. when you switch ui-tabs, its current dir is not affected.
you should call 'Plugins/ExTerminal/CD to current file's directory'.
It's a pita having to do this every time you switch tabs! Hence why I asked if it could be done automatically for the tab you are working on. Perhaps this should be an option? That way, you can select the one you prefer.
>I updated from Cudatext v 1.218.0 to v1.219.0.2. Now my Toolbar buttons have become enlarged:
do you see this in clean Cud with only custom toolbar theme?
do you see this only if you add toolbar btns with 48x48 icons?
maybe smthing is changed in Lazarus.
ie imagelist sizes change when you add 48x48 icon.

its regression in 1.129 or other versions have it?
>would be useful to be able to specify a size for toolbar icons to be shown at. Regardless of the size of the icon. It currently seems to be automatic?
yes.
I think a better option would be to make this a user setting, as suggested. Allow users to specify a toolbar icon size.
I didn't try a new set up and trying to figure out how to get only the files needed so have left the icons at the size they are. It just takes too much time and hassle for me to check. Sorry, I just don't have the energy at present to check all that.
>Could you point out what I need to change please.
try to toggle 'Shell command' checkbox.
I can't even figure out how I got that window open, it's a bit of a mess how things are organised if I'm honest. Sorry, I just think it's really awkward finding anything. We have Plugins menu for some settings, Options menu for others, then many dotted about that open json files. I know CT is still a work in progress, and appreciate all your efforts. but one suggestion if I may, try to organise settings in a unified place.
>is it possible to highlight errors in the Output Panel, similar to SCiTe? Currently, errors aren't shown/detected.
tool properties dlg has 'Pattern' option. press 'Set' near it, set regex there.
some presets exists there AFAIR.
Um, yeah, I don't know regex so not happening. Think I'll have to stick with SCiTe, least for now. Thanks and sorry for taking up your time.

Another small suggestion... It would be very useful having a close button on the Bottom Panel. This saves having a specific toolbar button or having to go to the Menu/View/Toggle Bottom Panel each time you want to close it. :)