SciTE4AutoHotkey v3.0.06.01 [Updated October 12 2014]

The popular SciTE-based AutoHotkey Script Editor
Haswell
Posts: 90
Joined: 21 Feb 2016, 17:11

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

06 May 2016, 09:00

Sometimes when I press F1 in Scite a chm-file hangs:
Image
How to fix it?
Focusing our efforts on non-productive and non-creative endeavours wastes lives as surely as war.
Jacque Fresco / The best that money can't buy
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

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

08 May 2016, 05:16

Scite somehow randomly crashes when I open the AutoHotkey helpfile deleting all unsaved progress (just lost 4 hours).
Recommends AHK Studio
Okram
Posts: 24
Joined: 02 Oct 2013, 16:53

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

08 May 2016, 09:18

Haswell wrote:Sometimes when I press F1 in Scite a chm-file hangs:
This also happens to me, Win10 64bit... stopped using it for this reason.
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

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

08 May 2016, 22:15

Nice SciTE-tation :HeHe:
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
xZomBie
Posts: 256
Joined: 02 Oct 2013, 02:57

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

09 May 2016, 05:55

nnnik wrote:Scite somehow randomly crashes when I open the AutoHotkey helpfile deleting all unsaved progress (just lost 4 hours).
This happened to me for a few times too. I simply use the chm from AHK's installation.
User avatar
rommmcek
Posts: 1480
Joined: 15 Aug 2014, 15:18

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

09 May 2016, 13:20

If help file hangs, don't try to close it!
Just switch back to SciTE4AutoHotkey via Alt-Tab or Taskbar, save your work if needed and close it. After restart you can continue exactly there where you left!

It's still the best editor 4 Ahk out there! Yes, for help use original AutoHotkey file, and hey, this is AutoHotkey, automate it with something like this:

Code: Select all

#IfWinActive, ahk_class SciTEWindow
F1::
Save_Clipboard := ClipboardAll
Send, {Right}{Left}
Clipboard := ""
Send, ^+{Right}{Right}^+{Left}
copyMarked:
  Send, ^c
  ClipWait, 0
  SearchItem = %Clipboard%
    if instr(SearchItem, ",") or instr(SearchItem, "(") or instr(SearchItem, ")") or instr(SearchItem, "`n")
    or instr(SearchItem, ":") or instr(SearchItem, ".") or instr(SearchItem, "{") or instr(SearchItem, "}")  {
    Clipboard := ""
    Send, {left}^+{left}
    goto, copyMarked
  }
  Clipboard := Save_Clipboard, Save_Clipboard := ""  
  send, {Right}
       IfWinNotExist, AutoHotkey Help ahk_class HH Parent
         { run, C:\Program Files\AutoHotkey\AutoHotkey.chm ; make sure the path to help file corresponds
           WinWait, AutoHotkey Help ahk_class HH Parent,, 1
         } WinActivate, AutoHotkey Help ahk_class HH Parent
           WinWaitActive, AutoHotkey Help ahk_class HH Parent,, 1
       SendMessage, 0x1330, 1,, SysTabControl321, AutoHotkey Help ahk_class HH Parent ;TCM_SETCURFOCUS = 0x1330
       SendMessage, 0x0C,, &SearchItem, Edit1, AutoHotkey Help ahk_class HH Parent ;WM_SETTEXT = 0x0C
       SendMessage, 0x100, 13,, Edit1, AutoHotkey Help ahk_class HH Parent ;WM_KEYDOWN = 0x100
       SendMessage, 0xB1, 0, -1, Edit1, AutoHotkey Help ahk_class HH Parent
       ControlFocus, Internet Explorer_Server1, AutoHotkey Help ahk_class HH Parent
       sleep 100
       send, {F6}
return
Edit: Update
Last edited by rommmcek on 24 May 2016, 05:00, edited 2 times in total.
JJohnston2
Posts: 204
Joined: 24 Jun 2015, 23:38

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

22 May 2016, 01:11

@rommmcek: Brilliant :thumbup: I would have never thought of that or had the patience to go code it since I know the workaround is to just break and start help, or restart SciTE and start help, but that little gem is nice. Now, if only I could use the "Find in Files" function the same way (Ctrl+Shift+f) ;) Thanks for posting :thumbup:
User avatar
rommmcek
Posts: 1480
Joined: 15 Aug 2014, 15:18

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

23 May 2016, 19:46

@JJohnston2: Not brilliant, no gem!, but usable and works most of the time, besides see improvement!
Not sure if I get you right. Did you experienced crash while pressing Ctrl+Shift+f?

Code: Select all

#IfWinActive, ahk_class SciTEWindow
$^+f:: ; $ prevents label to run itself
Send, {Right}{Left}
Clipboard := ""
Send, ^+{Right}{Right}^+{Left}
copyMarked_4:
  Send, ^c
  ClipWait, 0
  SearchItem = %Clipboard%
  if instr(SearchItem, ",") or instr(SearchItem, "(") or instr(SearchItem, ")") or instr(SearchItem, "`n")
  or instr(SearchItem, ":") or instr(SearchItem, ".") or instr(SearchItem, "{") or instr(SearchItem, "}")  {
    Clipboard := ""
    Send, {left}^+{left}
    goto, copyMarked_4
  }
  send, {Right}
 
  WinMenuSelectItem, ahk_class SciTEWindow,, 3&, 4&
  WinWaitActive, Find in File
  SendMessage, 0x0C,, &SearchItem, Edit1, Find in File ;WM_SETTEXT = 0x0C
  Send, !f
Edit: Update
Last edited by rommmcek on 24 May 2016, 04:08, edited 2 times in total.
JJohnston2
Posts: 204
Joined: 24 Jun 2015, 23:38

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

23 May 2016, 22:11

I don't think SciTE is running multi-threaded, so when an AutoHotkey script is running it can't simultaneously launch the help file or other external applications--my guess anyway. The help file workaround works by launching the help file from another thread. For multi-file search, the dialog loads ("Find in Files") but trying to run a search says "Job is currently executing. Wait until it finishes.", as long as an AutoHotkey script is also executing.

Since your routine (last post) relies on the internal SciTE function to execute (instead of an external function), it is prone to the same error.

I'm wondering now that you posted this though if it would be possible to perform the search myself via a separate dialog box that triggers on the same shortcut key, and subsequently update the find results window, which I think can be done via COM Object (may even be in previous posts in this thread... Joe Glines had some great example code). Not sure if the search result window can be updated while another program is running or not. All the dialog box is doing though is running the external utility and updating the the search result window from stdout... should be easy to replicate.
User avatar
rommmcek
Posts: 1480
Joined: 15 Aug 2014, 15:18

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

24 May 2016, 04:24

O.k. try this one. It's quick adaptation of similar search. Run only fFind_Laucher.ahk (fFind_4.ahk must be in same folder).
Btw, first make settings at start of fFind_4.ahk file: Where to search, what type of file and goto title & Full path to the editor and name!
Note: Does not search in subfolders!
Attachments
fFind_Launcher.ahk
(884 Bytes) Downloaded 299 times
Ffind_4.ahk
(5.61 KiB) Downloaded 311 times
hotkeyguy
Posts: 170
Joined: 11 Oct 2014, 12:22

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

26 May 2016, 17:18

Hello,

some first questions:
  1. Is there a way to add hotkeys (the [Alt+_] combinations) to main menu items?
  2. Debug - can be startet with shortcut F7, but stopped*? Shouldn't the main menu item then change from Debug to Stop?
  3. Variable list - show with an shortcut? Old position and size should be restored. And an "auto show" option should be available. When enabled and debugging starts, the Variable list is shown automatically.
  4. CallStack - like Variable list.
* I'm aware thanks to Joe Glines Programmatically interact with the SciTE editor via COM objects that there is an corresponding WM_COMMAND for stopping the debugger

Code: Select all

;~ oScite.Message(0x111,304)  ;Stop
which can be used via COM.


Many thanks and greetings
hotkeyguy
armisius

Toolbar problem

04 Jun 2016, 15:59

It seems that I can load the toolbar for autohotkey and no tolbar is showing at startup, im with windows 10 x64
User avatar
rommmcek
Posts: 1480
Joined: 15 Aug 2014, 15:18

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

13 Jun 2016, 14:55

@Drako223344: Just changed background color settings and default selection appeared to fade!
Did you manage to change Selection settings?
kinnex
Posts: 22
Joined: 09 Jun 2016, 07:52

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

01 Jul 2016, 12:52

Love this editor. It really is quite nice to use. I was wondering if it is possible to add folding for sub-routines?
Something like folding from : to return, gosub or goto.
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

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

02 Jul 2016, 19:51

kinnex wrote:I was wondering if it is possible to add folding for sub-routines?
It's surely possible, but the folding is done by the lexer, which is written in C++.

Perfect folding would be impossible, because subroutines do not have clearly-defined boundaries; or in other words, the boundaries are defined by run-time conditions. For example:

Code: Select all

mysub:
    if (cond) {
        action1()
        return
    } else {
        action2()
        exit
    }
    ; any code here is not reachable
myothersub:
    if (true)
        return
; any code here is not reachable
There are different indentation styles, and some users use braces (which have no effect on the flow of the subroutine). A subroutine might end at a clear statement like Return, Exit or ExitApp, or it might have no defined ending (such as if it calls a function which always calls Exit/ExitApp). You can also stack subroutines, optionally with code in between:

Code: Select all

firstsub:
    code for firstsub only
secondsub:
    code for firstsub and secondsub
    return
It would need to make guesses about what the user perceives as a subroutine, or offer options which can be set in SciTE's properties files.
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

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

02 Jul 2016, 21:49

hotkeyguy wrote:Is there a way to add hotkeys (the [Alt+_] combinations) to main menu items?
Yes - you can use the user.shortcuts property. I don't think they will show up in the menus, though.
Debug - can be startet with shortcut F7, but stopped*? Shouldn't the main menu item then change from Debug to Stop?
You can't change the menu item text from Lua, but you can change the command. You just need to "hook" the functions that are called when the debugger connects or disconnects. Add this to your User Lua script (right click one of the AutoHotkey-related toolbar icons and click "Edit User Lua script"):

Code: Select all

local function afterCalling(funcName, callThis)
    local origFunc = _G[funcName]
    _G[funcName] = function()
        origFunc()
        callThis()
    end
end

afterCalling("DBGp_Connect", function()
    props["command.build.$(file.patterns.ahk)"] = "DBGp_Stop"
	props["command.build.subsystem.$(file.patterns.ahk)"] = 3 -- Lua
end)
afterCalling("DBGp_Disconnect", function()
    -- Setting to nil removes our override, allowing the property to
    -- once again be controlled by configuration files (which can be
    -- modified at any time, such as by the platform selector).
    props["command.build.$(file.patterns.ahk)"] = nil
    props["command.build.subsystem.$(file.patterns.ahk)"] = nil
end)
Variable list - show with an shortcut?
Anything you can do via the toolbar buttons can be done directly by some other script, because the toolbar is some other script (separate to the debugger). In this case, you can use PostMessage, 0x111, 1133, 0,, ahk_class SciTEWindow, which activates internal command #33 (defined in ahk.commands.properties). The toolbar itself uses similar code.
Old position and size should be restored. And an "auto show" option should be available.
If you want these features, you'll need to implement them yourself by editing SciTEDebug.ahk, or by using a separate hotkey to launch the debugger and open and reposition the variable list.
I'm aware thanks to Joe Glines Programmatically interact with the SciTE editor via COM objects that there is an corresponding WM_COMMAND for stopping the debugger
There is no need to use the COM object for this. Just send or post the WM_COMMAND message directly to SciTE as shown above.
Last edited by lexikos on 03 Jul 2016, 05:38, edited 1 time in total.
Reason: Fixed a problem with the Lua script
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

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

03 Jul 2016, 05:39

I found a problem with the Lua script in my previous post, and fixed it. (Properties set by props[] always override the configuration files, even after they're reloaded, until you set them to nil.)
hotkeyguy
Posts: 170
Joined: 11 Oct 2014, 12:22

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

04 Jul 2016, 09:17

Hello Lexikos,

many thanks for your efforts and elaborately answering my questions.


Greetings
hotkeyguy
punchin
Posts: 439
Joined: 17 Jan 2014, 17:54

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

01 Aug 2016, 21:03

Feature request: open multiple instances and/or split screen freeze frame.

I often times have to look at multiple parts of my code and scrolling up and down or copy+pasting to notepad gets old.
User avatar
boiler
Posts: 17393
Joined: 21 Dec 2014, 02:44

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

01 Aug 2016, 22:46

I agree. I wrote this tool as a partial solution, but one drawback is that if you edit the script in one pane, the other doesn't update also, so they can get out of sync.

That's one reason I have recently started using Sublime Text (and would have continued to use Notepad++ if it weren't lacking some typical AHK-friendly plug-ins/capabilities). I really like that you can have multiple panes and/or windows, and if you use them as different views of the same file, they are always in sync with whatever changes are made in the other views. If SciTE4AHK had this full capability, it would make a huge improvement in usability for me.

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 11 guests