AHK Studio

Editor for AutoHotkey written completely in AutoHotkey.

Moderator: maestrith

User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

11 Mar 2020, 05:59

81793 wrote:
04 Feb 2020, 07:50
@maestrith thank you!
You are very welcome.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
DaveT1
Posts: 218
Joined: 07 Oct 2014, 11:23

Re: AHK Studio

02 Apr 2020, 11:52

Hi,

Is it possible for AHK Studio to export a list of all function and lable names of the currently loaded code?

Many thanks.
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

02 Apr 2020, 20:46

DaveT1 wrote:
02 Apr 2020, 11:52
Hi,

Is it possible for AHK Studio to export a list of all function and lable names of the currently loaded code?

Many thanks.
Currently no.
I'm sure a plugin can be made for that purpose but it's not built in.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

02 Apr 2020, 20:58

Something like:

Code: Select all

;menu Show Functions And Labels
x:=Studio()
CEXML:=x.Get("CEXML")
Current:=x.Current(2).ID
All:=CEXML.SN("//main[@id='" Current "']/descendant::*[@type='Function' or @type='Label']")
while(aa:=All.Item[A_Index-1],ea:=CEXML.EA(aa)){
	List.=ea.Type " - " ea.Text " - " ea.Att "`n"
}
MsgBox,%List%
ExitApp
that will display the current files Functions and Labels
Save that as an ahk file in the Studio\Plugins directory
then do Alt+M Refresh Plugins{Enter}
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
DaveT1
Posts: 218
Joined: 07 Oct 2014, 11:23

Re: AHK Studio

03 Apr 2020, 13:28

Many thanks Maestrith,
I'll give that a go and report back.

Edit: Err, flippin' eck! This does it straight out of the tin. Very many thanks Maestrith :D

I did change the MsgBox to a FileAppend as the msgbox seemed to hang.

I'd manually got 454 function and label names out of the code I'm interrogating (get this, I used OCR with AHK Studio's Code Explorer, repeatedly copying and pasting and mopping up), and your code gave me, err, 454 function and label names all easy peasy. Great stuff, this will be really useful for all sorts of things. Many thanks again.

:bravo:
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

06 Apr 2020, 06:56

DaveT1 wrote:
03 Apr 2020, 13:28
Many thanks Maestrith,
I'll give that a go and report back.

Edit: Err, flippin' eck! This does it straight out of the tin. Very many thanks Maestrith :D

I did change the MsgBox to a FileAppend as the msgbox seemed to hang.

I'd manually got 454 function and label names out of the code I'm interrogating (get this, I used OCR with AHK Studio's Code Explorer, repeatedly copying and pasting and mopping up), and your code gave me, err, 454 function and label names all easy peasy. Great stuff, this will be really useful for all sorts of things. Many thanks again.

:bravo:
No problem. Glad it works. OH! I edited the code, all Studio plugins need an ExitApp.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
DaveT1
Posts: 218
Joined: 07 Oct 2014, 11:23

Re: AHK Studio

06 Apr 2020, 08:15

Thanks Maestrith, added ExitApp to the plugin. Much apreaciated as always.
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

06 Apr 2020, 10:58

DaveT1 wrote:
06 Apr 2020, 08:15
Thanks Maestrith, added ExitApp to the plugin. Much apreaciated as always.
Yep
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: AHK Studio

11 May 2020, 04:14

The code assistant will not work when you close a long bracket.

Code: Select all

hi [mention]maestrith[/mention] .

{ ;Menus ;
	Gui +hWndhMainWnd +Resize
	Menu FileMenu, Add, &Save Commands`tCtrl+S, MenuHandler
	Menu FileMenu, Icon, &Save Commands`tCtrl+S, shell32.dll, 259
	Menu FileMenu, Add, &Save As Commands, MenuHandler
	Menu FileMenu, Icon, &Save As Commands, shell32.dll, 279
	Menu FileMenu, Add, Exit, MenuHandler
	Menu FileMenu, Icon, Exit, shell32.dll, 28
	Menu MenuBar, Add, &File, :FileMenu
	Menu EditMenu, Add, Edit Command, MenuHandler
	Menu EditMenu, Icon, Edit Command, shell32.dll, 134
	Menu EditMenu, Add, Add Command, MenuHandler
	Menu EditMenu, Icon, Add Command, shell32.dll, 280
	Menu EditMenu, Add, Delete Command, MenuHandler
	Menu EditMenu, Icon, Delete Command, shell32.dll, 272
	Menu MenuBar, Add, &Edit, :EditMenu
	Menu OptionsMenu, Add, Show CMD, MenuHandler
	Menu OptionsMenu, Check, Show CMD
	Menu OptionsMenu, Add, ADB Folder, MenuHandler
	Menu OptionsMenu, Add, Language, MenuHandler
	Menu MenuBar, Add, &Options, :OptionsMenu
	Menu LanguageMenu, Add, English, MenuHandler
	Menu LanguageMenu, Add, Turkish, MenuHandler
	Menu MenuBar, Add, &Language, :LanguageMenu
	Menu HelpMenu, Add, Info, MenuHandler
	Menu HelpMenu, Icon, Info, shell32.dll, 278
	Menu HelpMenu, Add, Help, MenuHandler
	Menu HelpMenu, Icon, Help, shell32.dll, 155
	Menu MenuBar, Add, &Help, :HelpMenu
	Menu ToolsMenu, Add, Start Shell, MenuHandler
	Menu ToolsMenu, Icon, Start Shell, cmd.exe
	Menu MenuBar, Add, &Tools, :ToolsMenu
	Gui Menu, MenuBar
	Menu ContextMenu, Add, Select Command, MenuHandler
	Menu ContextMenu, Icon, Select Command, shell32.dll, 25
	Menu ContextMenu, Add, Add Command, MenuHandler
	Menu ContextMenu, Icon, Add Command, shell32.dll, 280
	Menu ContextMenu, Add, Edit Command, MenuHandler
	Menu ContextMenu, Icon, Edit Command, shell32.dll, 134
	Menu ContextMenu, Add, Delete Command, MenuHandler
	Menu ContextMenu, Icon, Delete Command, shell32.dll, 146
	Menu ContextMenu, Add, Copy Command, MenuHandler
	Menu ContextMenu, Icon, Copy Command, shell32.dll, 251
	Menu Tray, Add, Show, MenuHandler
	Menu Tray, Icon, Show, shell32.dll, 160
	Menu Tray, Add, Exit, MenuHandler
	Menu Tray, Icon, Exit, shell32.dll, 132
}

LV_Add()
Bracket is open. The code helper works.
https://i.imgur.com/tYlS77i.png

Bracket is close. The code helper not works.
https://i.imgur.com/IZbkDcH.png
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

11 May 2020, 07:41

hasantr wrote:
11 May 2020, 04:14
The code assistant will not work when you close a long bracket.

Code: Select all

hi @maestrith .

Bracket is open. The code helper works.
https://i.imgur.com/tYlS77i.png

Bracket is close. The code helper not works.
https://i.imgur.com/IZbkDcH.png
I coppied your code into Studio and collapsed your code. While the code assistant did hide itself when I clicked the collapse button all you "should" have to do to get it to come back is to either move the caret or hit the escape key. Please let me know if this doesn't resolve the issue so we can schedule a zoom meeting so that I can help troubleshoot this matter.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: AHK Studio

11 May 2020, 10:52

maestrith wrote:
11 May 2020, 07:41
hasantr wrote:
11 May 2020, 04:14
The code assistant will not work when you close a long bracket.

Code: Select all

hi @maestrith .

Bracket is open. The code helper works.
https://i.imgur.com/tYlS77i.png

Bracket is close. The code helper not works.
https://i.imgur.com/IZbkDcH.png
I coppied your code into Studio and collapsed your code. While the code assistant did hide itself when I clicked the collapse button all you "should" have to do to get it to come back is to either move the caret or hit the escape key. Please let me know if this doesn't resolve the issue so we can schedule a zoom meeting so that I can help troubleshoot this matter.
I managed to run this code when I moved it alone. But when the brackets open and close, sometimes one movement is not enough to run.
It will never work in multi-line work. It works only when parentheses are open. Very frustrating. I can't find where the error originated from.
evilmanimani
Posts: 29
Joined: 24 Jun 2020, 16:42

Re: AHK Studio

24 Jun 2020, 16:53

I'm trying to use this on a PC that I don't have admin rights for, so I'm not able to properly install AHK, just using a portable version. So when going to Tools > Run nothing happens, and Run As returns the following:
Error: Failed attempt to launch program or document:
Action: <\AutoHotkeyU64 "C:\Users\username\ahk\project.ahk">
Params: <>

Specifically: The system cannot find the file specified.



Line#
---> 11503: Run,%dir%\%exe% "%file%",%fdir%,,pid

The current thread will exit.
Is there some way I can manually set the path for the ahk executable?
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

24 Jun 2020, 16:57

evilmanimani wrote:
24 Jun 2020, 16:53
I'm trying to use this on a PC that I don't have admin rights for, so I'm not able to properly install AHK, just using a portable version. So when going to Tools > Run nothing happens, and Run As returns the following:
Error: Failed attempt to launch program or document:
Action: <\AutoHotkeyU64 "C:\Users\username\ahk\project.ahk">
Params: <>

Specifically: The system cannot find the file specified.



Line#
---> 11503: Run,%dir%\%exe% "%file%",%fdir%,,pid

The current thread will exit.
Is there some way I can manually set the path for the ahk executable?
I "think" that if you put Autohotkey.exe in the same folder as AHK-Studio, it'll run it.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
evilmanimani
Posts: 29
Joined: 24 Jun 2020, 16:42

Re: AHK Studio

24 Jun 2020, 17:10

Wow, quick reply! :) Thanks, yeah I had tried that before, but that was with ahk-studio complied; curiously it works when I run it using ahk in the same folder, but not while compiled. I suppose I can just open it with a batch file if there's no workaround for the complied exe.
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

24 Jun 2020, 17:14

Let me know exactly how you're running it, is it compiled or not, and I will look and see what the actual run function entails and see what I can do.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
User avatar
drosenhe
Posts: 2
Joined: 02 Aug 2016, 21:47

Re: AHK Studio

25 Jun 2020, 17:42

Hi Maestrith!! I just love your AHK-Studio Editor and have been using for a while.

Lately, I've notice that when AHK-Studio first loads, I'm getting an error from the Middle Scroll.ahk plugin: "Error: 0x800401F3 - Invalid class string".
The rest of the error dialog shows code lines from the plugin and points to -----> line 27: x:=ComObjActive("AHK-Studio")

I click on the Yes button to continue the script and scrolling with my mouse wheel seems to work fine in Studio, but I'd very much like to understand and fix the error, if possible.

Here's a screenshot of the error I'm getting... Any ideas?
2020-06-25 15_21_02-Middle Scroll.ahk.png
2020-06-25 15_21_02-Middle Scroll.ahk.png (40.68 KiB) Viewed 8728 times
Oh, and the path to AutoHotKey is "C:\Program Files\AutoHotkey", while the path to AHK Studio is "G:\AHK-Studio", if that makes any difference.
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

25 Jun 2020, 17:56

drosenhe wrote:
25 Jun 2020, 17:42
Hi Maestrith!! I just love your AHK-Studio Editor and have been using for a while.

Lately, I've notice that when AHK-Studio first loads, I'm getting an error from the Middle Scroll.ahk plugin: "Error: 0x800401F3 - Invalid class string".
The rest of the error dialog shows code lines from the plugin and points to -----> line 27: x:=ComObjActive("AHK-Studio")

I click on the Yes button to continue the script and scrolling with my mouse wheel seems to work fine in Studio, but I'd very much like to understand and fix the error, if possible.

Here's a screenshot of the error I'm getting... Any ideas?
2020-06-25 15_21_02-Middle Scroll.ahk.png

Oh, and the path to AutoHotKey is "C:\Program Files\AutoHotkey", while the path to AHK Studio is "G:\AHK-Studio", if that makes any difference.
What version of AHK are you using? I believe there are problems with the 64 bit version of AHK and plugins. I always run x32 so I never really had any issues.
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: AHK Studio

25 Jun 2020, 18:13

Interesting. Didn’t know you could register an AHK script for COM.
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: AHK Studio

25 Jun 2020, 19:09

kczx3 wrote:
25 Jun 2020, 18:13
Interesting. Didn’t know you could register an AHK script for COM.
Yep. It's pretty cool :) You can setup a Class that works with the Com and it basically works just like it was integrated like IE
John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: AHK Studio

25 Jun 2020, 19:41

maestrith wrote:
25 Jun 2020, 19:09
kczx3 wrote:
25 Jun 2020, 18:13
Interesting. Didn’t know you could register an AHK script for COM.
Yep. It's pretty cool :) You can setup a Class that works with the Com and it basically works just like it was integrated like IE
Is there any documentation out there on doing this or any tutorials you know of? Or even files/lines in your code I could look at?

Return to “AHK Studio”

Who is online

Users browsing this forum: No registered users and 28 guests