Jump to content

Run AutoIt Debugger from Scite


Docfxit
 Share

Recommended Posts

I would like to run the Autoit Debugger with a script I have running in SciTE.

I have two problems.  One is when I hold down the <ALT> key and press "G" the debugger opens the current script but the debugger shows an error window.

I have put this code:

# 35 Stumpii's Graphical Debugger
command.35.$(au3)=$(autoit3dir)\AutoIt Debugger\AutoIt Debugger.exe "$(FilePath)"
command.name.35.$(au3)=Graphical Debugger
command.subsystem.35.$(au3)=1
command.save.before.35.$(au3)=1
command.shortcut.35.$(au3)=Alt+G
command.quiet.35.$(au3)=1

at the bottom of the file au3.properties.  I opened au3.properties while in SciTE, Options, Open au3.properties.

The second problem I would like to resolve is: I'd like to find out how to add a button on the same line as the pull down menu bar to run Alt+G.

Thanks,

Docfxit

Link to comment
Share on other sites

4 minutes ago, Docfxit said:

debugger shows an error window.

What's the error? Why is it erroring? 

34 minutes ago, Docfxit said:

I'd like to find out how to add a button on the same line as the pull down menu bar to run Alt+G.

Change the command number to 36 instead of 35 and see if that fixes it. I think the first 35 are reserved for the standard tools.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

29 minutes ago, BrewManNH said:

Change the command number to 36 instead of 35 and see if that fixes it. I think the first 35 are reserved for the standard tools.

Changing the command number to 36 solved the error problem.

Thank you very much. That's great,

Docfxit

Does anyone have any idea how to add a button to SciTE ?

Link to comment
Share on other sites

Are you talking about the toolbar buttons? If you are, you'd need to add it to the program code of SciTE, then compile it. Otherwise, you can use one of the toolbar scripts that are around, including mine <see link in spoiler in my signature>.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

1 hour ago, BrewManNH said:

Are you talking about the toolbar buttons? If you are, you'd need to add it to the program code of SciTE, then compile it. Otherwise, you can use one of the toolbar scripts that are around, including mine <see link in spoiler in my signature>.

Thank you for sharing the toolbar.

I tried running it.  The buttons don't seem to work.  And it would be nice if it was higher on the page.

SciteToolBar.jpg.e4e35a368d079c3f2da7f507b1c03dcc.jpg

Could you please let me know what do I need to do to get it working?

Thank you,

Docfxit

Running: Win7 32bit

SciTE Version 4.1.2

AutoIt v3.3.14.5

Link to comment
Share on other sites

Play around with the numbers in this line (line 366 in my script) to adjust the position of the toolbar.

WinMove($hMy_GUI, '', $aScite_pos[0] + 360, $aScite_pos[1] + ($aScite_pos[3] - $SciTE_ClientSize[1] _
                         - 4), $iMy_Gui_Width, $iMy_Gui_Height)

The $aScite_pos[0] is the X position, the $aScite_pos[1] is the Y position of the SciTE window. I have it set to put it on the same plane as the usual toolbar in SciTE, at 100% zoom setting in Windows, so if you're using a different DPI setting, you'll have to adjust it.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Re positioning it worked perfectly.    Thank you.

In the console I'm getting this error:

"C:\Dnload\9xAddons\Scitetoolbar_v2_0_1.au3" (216) : ==> Subscript used on non-accessible variable.:
$aCheckBox[$Loop] = GUICtrlCreateCheckbox($aItems[$Loop][1], 15, $Loop * 20, 96, 14)
$aCheckBox[$Loop] = GUICtrlCreateCheckbox($aItems^ ERROR

Do you have any ideas what might fix that?

Thanks,

Docfxit

Link to comment
Share on other sites

The only thing I can think of is that the INI file isn't being written correctly or being read correctly. Try deleting the INI file associated with this script and let it get rebuilt.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Deleting the ini file has solved the problem.  The icon bar runs now.  It's really excellent.  Very nicely done.  I love it. :-)

1. I'd like to know how to make it run every time I edit a script.  Everytime SciTE opens.

2. What do I need to do to add an icon the executes Alt+g with a title of Debugger?

Thank you,

Docfxit

Link to comment
Share on other sites

Sorry if I jump in here,

I have been working with Autoit Years ago, then paused, and recently started scripting with it again. As far as I remember, there used to be a debugger, but I could not find it in the current version. I tried one or two external programs, but was not very happy with them

Do you have a working debugger for AutoIt, and, if yes, where can I learn more about it?

Thx, Armin

Link to comment
Share on other sites

  • Developers
10 hours ago, ArminLinder said:

As far as I remember, there used to be a debugger, but I could not find it in the current version.

Could it be you used AutoIt2 many moons ago, which had some internal debugging options?
AutoIt3 never had any internal debugging functions other then the Tray debug option.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

16 hours ago, Docfxit said:

1. I'd like to know how to make it run every time I edit a script.  Everytime SciTE opens.

I created a startup script that starts SciTE and then starts the toolbar executable, basically 2 Run() commands in a script should do it.

16 hours ago, Docfxit said:

2. What do I need to do to add an icon the executes Alt+g with a title of Debugger?

Look in the INI file that this script creates, and modify it as needed. I made it so that you don't need to modify the script to add/delete commands and icons to the toolbar.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I'm trying to figure out the SciteToolbar.ini.

It looks like there are 3 sections that need to be created for a new button.

The first one under the title:

[Buttons]

Compile.ico=Compile

Looks like the icon name relating to the icons in \bin folder

and the text name of the button

The second section under the title:

[Tools]

Compile=301

Looks like the button text name

and a number (I don't know where it is assigned)

The third section under the title:

[ToolBar]

301=Compile.ico|Compile

Has the number (I don't know where it is assigned)

The icon file name

The icon text name

 

The only mystery I need to figure out is the number and how it's assigned (created for a new function).

 

Link to comment
Share on other sites

Ok, took me a while to go back through the code and figure out what I did. It's been about 5 years since I've looked at this script at all. ;)

The first section of the INI file, [button] are the icons used for the buttons, and their names.

The second section, [tools], are the SciTE command numbering system, see the SciTEConstants.au3 file for the list of ID numbers and the name that SciTE has for those IDs. Any ID number above 1100 are user created menu items, such as the 1103 item, which will start the syntax checker for AutoIt, AU3Check for example.

The third section is the actual buttons used on the toolbar itself. This section won't get created until you run the options selection for the first time and select "Apply and Restart". This section contains the command message ID and the Icon file used for it,grabbed from the tools section, and the name/tooltip info for the button, grabbed from the buttons section.

 

If you want to change any of the buttons, and what they do, you'll need to first pick an Icon for it, assign that .ico file and name for it and put that in the buttons section of the INI file, then you want to take the name you gave it as the key in the tools section and assign the menu ID you want to use to it as the value of that key. Third, you'd need to change the toolbar section using the 2 items combined above.

Sounds a lot more complicated than it is. Here's your example using Stummpi's debugger above.

Quote

This gets added to the SciteUser.properties file:

# 36 Stumpii's Graphical Debugger
command.36.$(au3)=$(autoit3dir)\AutoIt Debugger\AutoIt Debugger.exe "$(FilePath)"
command.name.36.$(au3)=Graphical Debugger
command.subsystem.36.$(au3)=1
command.save.before.36.$(au3)=1
command.shortcut.36.$(au3)=Alt+G
command.quiet.36.$(au3)=1

In the scitetoolbar.ini file you can do this (I'm changing the default "Run with Beta" button and making it run the debugger instead):

[Buttons]
Run.ico=Run
Compile.ico=Compile
Help.ico=AutoIt Helpfile
SyntaxCheck.ico=SyntaxCheck
RunWithBeta.ico=Run Debugger
CompileWithBeta.ico=Compile with Beta
BetaHelp.ico=Beta AutoIt Helpfile
 

[Tools]
Run=303
Compile=301
AutoIt Helpfile=901
SyntaxCheck=1103
Run Debugger=1136

 

[ToolBar]
bar=
303=Run.ico|Run
301=Compile.ico|Compile
901=Help.ico|AutoIt Helpfile
bar=
1103=SyntaxCheck.ico|SyntaxCheck
1136=RunWithBeta.ico|Run Debugger
 

Those 3 changes should be all that's needed to run it from the toolbar.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

You'll have to ask someone else how Scite does the decoding of your user function declarations to make them work. All I know is that if the number is above 1100 then Scite looks for a command.## that corresponds to that.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Developers

That is describe somewhere in the documentation which is about usershortcuts. Believe it is 1100 + the number in command.xx

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...