SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

The popular SciTE-based AutoHotkey Script Editor
dsewq1LYJ
Posts: 116
Joined: 26 Aug 2014, 23:21

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

10 May 2015, 21:31

lexikos wrote:"C:\Program Files\AutoHotkey\.." is not the AutoHotkey directory. It is the parent directory; i.e. Program Files.
But how to tell the SciTE where my AHK is?

I keep editing the AutoHotkeyDir of ahk.properties but it didnt work.

Is me misunderstood somethin' !?
My autohotkey is exactly in C:\Program Files\AutoHotkey\AutoHotkey.exe.

Pardon me.I am so bad on this : [
lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

10 May 2015, 21:58

For a start, you can try giving it the right path, by removing the part I highlighted in red. :roll:

Personally, I would just install the non-portable version.
dsewq1LYJ
Posts: 116
Joined: 26 Aug 2014, 23:21

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

10 May 2015, 22:16

lexikos wrote:For a start, you can try giving it the right path, by removing the part I highlighted in red. :roll:

Personally, I would just install the non-portable version.
Holy jesus.lexikos god :trollface:
:thumbup:

It work like a charm !
:crazy:

Thank you so much the GOD :D
sntr

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

24 May 2015, 05:52

Can't find anything useful in the web:

When i start there is the message:

Toolbar.ahk

Error: "2" is not a valid key name.
...
---> 273: Hotkey,Tools[A_Index].Hotkey,ToolHotkeyHandler
...

After closing scite4ahk the InternalAHK.exe remains in the process list and i have to stop it manually because the ahk toolbar doesn't show up on the next start.

Toolbar functions do not work: Start/Debug; the GuiCreator shows the message: "Cannot find Scite".

I tried to reinstall, install scite (no toolbar at all), searched a bit in the properties but no result yet.

Would be nice to have some help.
User avatar
BGM
Posts: 507
Joined: 20 Nov 2013, 20:56
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

24 May 2015, 10:31

The new installer 3.0.06.01 won't let me uncheck the "Create shortcuts in the Start menu" and "Create a shortcut in the Desktop". The items are grayed out.
User avatar
dangerdogL2121
Posts: 173
Joined: 01 Oct 2013, 23:11

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

04 Jun 2015, 13:27

Hi,
I just tried SciTE for the first time and it looks great. :P

One thing that I think would make it even better is when clicking on a Gosub, Goto, or a function and a key is pressed (such as control or shift), the edit box jumps to the target label or function. It would make for easier script navigation.

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

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

04 Jun 2015, 13:33

Have you checked out the TillaGoto feature? It's what you're describing and more.
User avatar
dangerdogL2121
Posts: 173
Joined: 01 Oct 2013, 23:11

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

04 Jun 2015, 16:32

Thanks so much, that's just what I was looking for! :D
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

16 Jun 2015, 07:38

esto?
--> %AHKPATH%\Template.ahk
--> HKCR\.ahk\ShellNew\FileName
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

16 Jun 2015, 09:51

sort of... ;)

Just modify this file:
C:\Windows\SHELLNEW\Template.ahk
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
fincs
Posts: 527
Joined: 30 Sep 2013, 14:17
Location: Seville, Spain
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

05 Aug 2015, 13:43

Using vanilla versions of the SciTE/Scintilla binaries with SciTE4AutoHotkey is not supported and will result in several functionality breaking, amongst them AutoHotkey syntax highlighting. Please stay patient - yesterday I integrated the SciTE4AutoHotkey modifications into the latest version of SciTE/Scintilla (3.6.0).
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 - [My project list]
StefOnSteroids
Posts: 77
Joined: 08 Aug 2015, 10:22

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

09 Aug 2015, 04:30

Setting the BG-Color for TillaGoto doesn't seem to work, or I don't know what color code is expected here?

Where do I find a list of commands like IDM_PASTEANDDOWN that allow assigning a key shortcut to them?

Have spent an hour here in the forum but I am still confused about the many path-variables that I come across.
%SCITEDIR% vs $(SciteDefaultHome) vs $(SciteUserHome) etc

When to use what in which config-file, but most importantly how to set them up properly. Some functions are not working (such as Ctrl 7 Compile) and I assume it's because of wrong paths. I run the program from \Toolbox\ahk\SciTE from where it seems to correctly find my portable ahk (\Toolbox\ahk) but not the help file and not \Toolbox\ahk\Compile\Ahk2Exe.exe ...
User avatar
evilC
Posts: 4822
Joined: 27 Feb 2014, 12:30

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

09 Aug 2015, 11:04

Is it possible to allow debug breakpoints to work when they are in other files?
At the moment, I can step into other files (even if they aren't currently open), but if the breakpoint itself is in a file other than the one you hit "Play" on, then it does not break at the breakpoint.
User avatar
fincs
Posts: 527
Joined: 30 Sep 2013, 14:17
Location: Seville, Spain
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

09 Aug 2015, 18:11

StefOnSteroids wrote:Setting the BG-Color for TillaGoto doesn't seem to work, or I don't know what color code is expected here?
Haven't tried it myself, but I believe it is a normal RRGGBB code as usually interpreted by AutoHotkey.
StefOnSteroids wrote:Where do I find a list of commands like IDM_PASTEANDDOWN that allow assigning a key shortcut to them?
You may want to take a look at CommandValues.html.
StefOnSteroids wrote:Have spent an hour here in the forum but I am still confused about the many path-variables that I come across.
%Variables% only work in toolbar property files. $(Variables) only work in SciTE property files. SciteDefaultHome is the path to the SciTE.exe binary. SciteUserHome is the path to the user settings folder (My Documents\AutoHotkey\SciTE in the normal/installable version, SciteDefaultHome\user in the portable version).
StefOnSteroids wrote:When to use what in which config-file, but most importantly how to set them up properly. Some functions are not working (such as Ctrl 7 Compile) and I assume it's because of wrong paths. I run the program from \Toolbox\ahk\SciTE from where it seems to correctly find my portable ahk (\Toolbox\ahk) but not the help file and not \Toolbox\ahk\Compile\Ahk2Exe.exe
The portable version expects this setup:

Code: Select all

- AutoHotkey.exe
- AutoHotkey.chm
- Compiler
  - Ahk2Exe.exe
- SciTE (or any other name)
  - SciTE.exe
Note how you missed the r in Compiler.
evilC wrote:Is it possible to allow debug breakpoints to work when they are in other files?
At the moment, I can step into other files (even if they aren't currently open), but if the breakpoint itself is in a file other than the one you hit "Play" on, then it does not break at the breakpoint.
Yes, but due to limitations you have to set the breakpoint after you have launched the debugger. After debugging is finished, close all files other than the main script in order to clear their breakpoints.
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 - [My project list]
StefOnSteroids
Posts: 77
Joined: 08 Aug 2015, 10:22

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

10 Aug 2015, 00:56

Many thanks,
the puzzle pieces have fallen into place. I am especially grateful for the hint with the missing r of "CompileR" - I probably would have never spotted that.

Color codes work as well. Beats me why it didn't work before, I thought I had tried everything.

ATM I am fiddling with toolbar properties. On my hi-resolution monitor those tiny icons are tough on the eyes, almost impossible to operate. I managed to get all font sizes increased, but not the icons. Any chance to replace them with a larger set? 24 or 32px?

Figured out the tools-part. But how do I configure the built-in features? Seems like the CommandValues.html you provided (thanks for that, too) would be the key to it. But I am still struggling to pull it off.
User avatar
WAZAAAAA
Posts: 88
Joined: 13 Jan 2015, 19:48

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

14 Aug 2015, 15:04

Since there's no tool or function available to instantly clean an entire messy AutoHotkey script (at least not anymore, Auto-Syntax-Tidy is outdated), I've decided to make one... more or less.
Basically, this script takes your ugly looking script and manually rewrites it all into SciTE (which will apply a proper syntax/indentation) with SendRaw. Yes, it's THAT cheap... and actually works great, it doesn't even need to be updated haha. In my defense, I've spent a while figuring out that reading a direct file is a better option than dealing with escape characters lol.

INSTRUCTIONS:
1. Disable the auto-complete. This is important, otherwise the script may get corrupted. To disable it, I renamed ahk.api to bla.api and restarted SciTE;
2. Make sure that ugly.ahk (your own script that needs to be cleaned) and the following script (AHK-Cheap-Syntax-Tidy.ahk) are in the same folder;
3. Finally hit F11 while inside SciTE4AutoHotkey to start the rewrite.

Code: Select all

;IMPORTANT: before use, disable SciTE4AutoHotkey's autocomplete
F11::
FileRead, CONTENT, *t ugly.ahk
SendInput {Raw}%CONTENT%
EXAMPLE USAGE:
Image

Shout-outs to joedf for his great "PlasticCodeWrap" theme I used in the GIF (except with black background). Also to Klaus2 for the example script (though I don't actually use it). And obviously fincs.
YOU'RE NOT ALEXANDER
geek
Posts: 1052
Joined: 02 Oct 2013, 22:13
Location: GeekDude
Contact:

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

14 Aug 2015, 18:55

@WAZAAAAA

I use the AutoIndent code from AHK Studio. Since AHK Studio is actually written in AHK, it makes it a simple matter to pluck out the indenter.

Here's his original code though it's been updated a bit since I did this, and here's my version of it I use for my code tester:

Code: Select all

AutoIndent(Code, Indent = "`t", Newline = "`r`n")
{
	IndentRegEx =
	( LTrim Join
	Catch|else|for|Finally|if|IfEqual|IfExist|
	IfGreater|IfGreaterOrEqual|IfInString|
	IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|
	IfNotExist|IfNotInString|IfWinActive|IfWinExist|
	IfWinNotActive|IfWinNotExist|Loop|Try|while
	)
	
	; Lock and Block are modified ByRef by Current
	Lock := [], Block := []
	ParentIndent := Braces := 0
	ParentIndentObj := []
	
	for each, Line in StrSplit(Code, "`n", "`r")
	{
		Text := Trim(RegExReplace(Line, "\s;.*")) ; Comment removal
		First := SubStr(Text, 1, 1), Last := SubStr(Text, 0, 1)
		FirstTwo := SubStr(Text, 1, 2)
		
		IsExpCont := (Text ~= "i)^\s*(&&|OR|AND|\.|\,|\|\||:|\?)")
		IndentCheck := (Text ~= "iA)}?\s*\b(" IndentRegEx ")\b")
		
		if (First == "(" && Last != ")")
			Skip := True
		if (Skip)
		{
			if (First == ")")
				Skip := False
			Out .= Newline . RTrim(Line)
			continue
		}
		
		if (FirstTwo == "*/")
			Block := [], ParentIndent := 0
		
		if Block.MinIndex()
			Current := Block, Cur := 1
		else
			Current := Lock, Cur := 0
		
		; Round converts "" to 0
		Braces := Round(Current[Current.MaxIndex()].Braces)
		ParentIndent := Round(ParentIndentObj[Cur])
		
		if (First == "}")
		{
			while ((Found := SubStr(Text, A_Index, 1)) ~= "}|\s")
			{
				if (Found ~= "\s")
					continue
				if (Cur && Current.MaxIndex() <= 1)
					break
				Special := Current.Pop().Ind, Braces--
			}
		}
		
		if (First == "{" && ParentIndent)
			ParentIndent--
		
		Out .= Newline
		Loop, % Special ? Special-1 : Round(Current[Current.MaxIndex()].Ind) + Round(ParentIndent)
			Out .= Indent
		Out .= Trim(Line)
		
		if (FirstTwo == "/*")
		{
			if (!Block.MinIndex())
			{
				Block.Push({ParentIndent: ParentIndent
				, Ind: Round(Lock[Lock.MaxIndex()].Ind) + 1
				, Braces: Round(Lock[Lock.MaxIndex()].Braces) + 1})
			}
			Current := Block, ParentIndent := 0
		}
		
		if (Last == "{")
		{
			Braces++, ParentIndent := (IsExpCont && Last == "{") ? ParentIndent-1 : ParentIndent
			Current.Push({Braces: Braces
			, Ind: ParentIndent + Round(Current[Current.MaxIndex()].ParentIndent) + Braces
			, ParentIndent: ParentIndent + Round(Current[Current.MaxIndex()].ParentIndent)})
			ParentIndent := 0
		}
		
		if ((ParentIndent || IsExpCont || IndentCheck) && (IndentCheck && Last != "{"))
			ParentIndent++
		if (ParentIndent > 0 && !(IsExpCont || IndentCheck))
			ParentIndent := 0
		
		ParentIndentObj[Cur] := ParentIndent
		Special := 0
	}
	
	if Braces
		throw Exception("Segment Open!")
	
	return SubStr(Out, StrLen(Newline)+1)
}
Heezea
Posts: 59
Joined: 30 Sep 2013, 21:33

Re: SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

18 Aug 2015, 17:37

Hey all, is there a way to make it so pressing one button will comment each line and pressing a different button will un-comment each line?

Currently, the same button performs both commenting and un-commenting, which I find annoying since sometimes I comment things out (says lines 2-3) when I'm testing, then want to comment out a larger block (say lines 1-7). Now Lines 1, 4, 5, 6, 7 become commented while lines 2, 3 are uncommented. I'd prefer to have lines 2, 3 be double commented and the other lines be single commented.

I checked http://www.scintilla.org/SciTEDoc.html and http://www.scintilla.org/CommandValues.html but no luck.

Also tried adjusting the items below, but no luck either.

Code: Select all

KeypadMinus|IDM_BLOCK_COMMENT|\
#~ KeypadMinus|IDM_BOX_COMMENT|\
#~ KeypadMinus|IDM_STREAM_COMMENT|\

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 34 guests