[Editor] CodeQuickTester - Write and run code without saving to a temporary file
Re: CodeQuickTester - Write and run code without touching the file system
For me, the syntax tips only work until I make changes to the code--so starting a new CQT, I can select the words in the default text, but when I start typing anything, I cannot get syntax tips for anything.
try it and see
...
...
Re: CodeQuickTester - Write and run code without touching the file system
What OS and AHK versions are you using?
Re: CodeQuickTester - Write and run code without touching the file system
Sorry that was not my main PC and AHK was still at 1.22. After updating, it looks like it works again, but ran out of time to test thoroughly :)
try it and see
...
...
-
- Posts: 77
- Joined: 08 Aug 2015, 10:22
Re: CodeQuickTester - Write and run code without touching the file system
Great tool, thank you so much!
How do I make it remember the location of my AutoHotkeyU64.exe?
Or asked another way, where does the script expect to find AutoHotkeyU64.exe? Where would I have to put it -relative to AutoHotkeyU64.exe, so it can find the exe by itself?
It won't remember my setting in Edit > Script Options, so I guess I have to hard-code the path somewhere in the script itself?
Maybe I should mention that I run the script compiled, because running the ahk-file brings up this error:
---------------------------
QuickCodeTester.ahk
---------------------------
Error: 0x80020006 - Unbekannter Name.
Specifically: querySelectorAll
Line#
2232: Return,this.Lookup
2235: this.Commands := {}
2236: Try
2237: Page := this.GetPage("commands/index.htm")
2238: Try
2239: rows := Page.querySelectorAll(".info td:first-child a")
2240: Catch
---> 2241: rows := Page.body.querySelectorAll(".info td:first-child a")
2242: Loop,rows.length
2243: For i,text in StrSplit((row := rows.Item(A_Index-1)).innerText, "/")
2244: if RegExMatch(text, "^[\w#]+", Match) && !this.Commands.HasKey(Match)
2245: this.Commands[Match] := "commands/" RegExReplace(row.getAttribute("href"), "^about:")
2248: this.Variables := {}
2249: Try
2250: Page := this.GetPage("Variables.htm")
Continue running the script?
---------------------------
Ja Nein
---------------------------
How do I make it remember the location of my AutoHotkeyU64.exe?
Or asked another way, where does the script expect to find AutoHotkeyU64.exe? Where would I have to put it -relative to AutoHotkeyU64.exe, so it can find the exe by itself?
It won't remember my setting in Edit > Script Options, so I guess I have to hard-code the path somewhere in the script itself?
Maybe I should mention that I run the script compiled, because running the ahk-file brings up this error:
---------------------------
QuickCodeTester.ahk
---------------------------
Error: 0x80020006 - Unbekannter Name.
Specifically: querySelectorAll
Line#
2232: Return,this.Lookup
2235: this.Commands := {}
2236: Try
2237: Page := this.GetPage("commands/index.htm")
2238: Try
2239: rows := Page.querySelectorAll(".info td:first-child a")
2240: Catch
---> 2241: rows := Page.body.querySelectorAll(".info td:first-child a")
2242: Loop,rows.length
2243: For i,text in StrSplit((row := rows.Item(A_Index-1)).innerText, "/")
2244: if RegExMatch(text, "^[\w#]+", Match) && !this.Commands.HasKey(Match)
2245: this.Commands[Match] := "commands/" RegExReplace(row.getAttribute("href"), "^about:")
2248: this.Variables := {}
2249: Try
2250: Page := this.GetPage("Variables.htm")
Continue running the script?
---------------------------
Ja Nein
---------------------------
Re: CodeQuickTester - Write and run code without touching the file system
The default location to find AHK is specified in the Settings array at the top of the script. You could change it there, or if you have AHK installed to your system you could re-run the installer and change the system-wide default AHK version to be the 64 bit one.StefOnSteroids wrote:Great tool, thank you so much!
How do I make it remember the location of my AutoHotkeyU64.exe?
Or asked another way, where does the script expect to find AutoHotkeyU64.exe? Where would I have to put it -relative to AutoHotkeyU64.exe, so it can find the exe by itself?
It won't remember my setting in Edit > Script Options, so I guess I have to hard-code the path somewhere in the script itself?
Code: Select all
Settings :=
( LTrim Join Comments
{
; When True, this setting may conflict with other instances of CQT
"GlobalRun": False,
; Script options
"AhkPath": A_AhkPath, ; <-------------------- DEFINED HERE --------------------
"Params": "",
That error is very strange. Compiling the script makes the error go away? That is not what I would have expected. Could you please run this and copy the output into a forum post?StefOnSteroids wrote:Maybe I should mention that I run the script compiled, because running the ahk-file brings up this error:
Code: Select all
MsgBox,
(
AHK Version: %A_AhkVersion%
OS Version: %A_OSVersion%
Pointer Size: %A_PtrSize%
Unicode: %A_IsUnicode%
Language: %A_Language%
Admin: %A_IsAdmin%
WinDir: %A_WinDir%
)
-
- Posts: 77
- Joined: 08 Aug 2015, 10:22
Re: CodeQuickTester - Write and run code without touching the file system
Thanks for checking into this.
In earlier attempts I had already tried to fiddle with the entries in the script section
"AhkPath": A_AhkPath,
but only managed to trigger an error in line 10 when I tried to compile the script.
Thanks to your confirmation that this is indeed the place to set the path to ahk.exe, I now managed to make it work by providing a fully specified path with drive letter.
Before that, I had probably made syntax errors in my trials to keep things portable.
---------------------------
AHK_CQT_226706799
---------------------------
AHK Version: 1.1.28.01
OS Version: WIN_7
Pointer Size: 8
Unicode: 1
Language: 0407
Admin: 0
WinDir: C:\windows
---------------------------
OK
---------------------------
Anyway, I don't mind compiling the script. Really glad I no longer have to specify the ahk-exe-path each and every time. Hoever, if I could make it portable (independent from drive letter) - that would be totally awesome. But I don't want to over-extend your helpfulness. Thanks for a fantastic tool.
In earlier attempts I had already tried to fiddle with the entries in the script section
"AhkPath": A_AhkPath,
but only managed to trigger an error in line 10 when I tried to compile the script.
Thanks to your confirmation that this is indeed the place to set the path to ahk.exe, I now managed to make it work by providing a fully specified path with drive letter.
Before that, I had probably made syntax errors in my trials to keep things portable.
Yes, compiling the script makes the error go away. Here's the output from your code snippet.GeekDude wrote: That error is very strange. Compiling the script makes the error go away? That is not what I would have expected. Could you please run this and copy the output into a forum post?
---------------------------
AHK_CQT_226706799
---------------------------
AHK Version: 1.1.28.01
OS Version: WIN_7
Pointer Size: 8
Unicode: 1
Language: 0407
Admin: 0
WinDir: C:\windows
---------------------------
OK
---------------------------
Nothing of the sort. Standard Win7 Home Edition, no registry changes or other system changes I am aware of, No WINE or ReactOS etc, these terms I only know from hearsay.GeekDude wrote: Also, have you made any nonstandard changes to your OS's configuration such as disabling Internet Explorer or making extensive modifications to the registry? Are you running your script with some software such as WINE, CrossOver, PlayOnLinux, or ReactOS?
Anyway, I don't mind compiling the script. Really glad I no longer have to specify the ahk-exe-path each and every time. Hoever, if I could make it portable (independent from drive letter) - that would be totally awesome. But I don't want to over-extend your helpfulness. Thanks for a fantastic tool.
Re: CodeQuickTester - Write and run code without touching the file system
Thanks for being patient with my checking .StefOnSteroids wrote:Thanks for checking into this.
I set up a Windows 7 Home Premium machine and downloaded AHK Portable and CodeQuickTester v2.6 to test your issue. I was able to reproduce it by downgrading from Internet Explorer 11 to 8. The functionality that triggers the error is the integration with the help file (basically an offline website), which relies on certain features that appear to be unavailable in IE8.StefOnSteroids wrote:Yes, compiling the script makes the error go away. Here's the output from your code snippet.GeekDude wrote: That error is very strange. Compiling the script makes the error go away? That is not what I would have expected. Could you please run this and copy the output into a forum post?
---------------------------
AHK_CQT_226706799
---------------------------
AHK Version: 1.1.28.01
OS Version: WIN_7
Pointer Size: 8
Unicode: 1
Language: 0407
Admin: 0
WinDir: C:\windows
---------------------------
OK
---------------------------
Nothing of the sort. Standard Win7 Home Edition, no registry changes or other system changes I am aware of, No WINE or ReactOS etc, these terms I only know from hearsay.GeekDude wrote: Also, have you made any nonstandard changes to your OS's configuration such as disabling Internet Explorer or making extensive modifications to the registry? Are you running your script with some software such as WINE, CrossOver, PlayOnLinux, or ReactOS?
When CodeQuickTester is launched it uses Internet Explorer's API to load the help file in the background and pull out information about commands to be displayed in the status bar. By default it looks for the help file at %A_AhkPath%\..\AutoHotkey.chm. When you compile a script and AutoHotkey is not installed (running in a portable environment), A_AhkPath will be blank. This makes CodeQuickTester unable to find and load the help file, which is why it doesn't trigger the error.
I'll release a fix in the next update that either suppresses the error and disables the functionality, or uses some other method of reading the help file that works with IE8. Until then, I have a few solutions that you could use to get rid of the error:
- Update Internet Explorer to version 11 (best solution, as then the integration will work)
- Put HelpFile:="" at the top of the script to disable the help file integration
- Move or rename the help file so that CodeQuickTester can not find it (effectively disables the integration)
I believe in being as helpful as the situation permits . The AHK Path is a relative path from the specified working directory, so assuming that AHK is in the same working directory (generally the same folder) as CodeQuickTester you should be able to specify "AhkPath": "AutoHotkeyU64.exe", and it will just work. If you aren't using the same working directory but still want to pull from the script's directory, you can use "AhkPath": A_ScriptDir "\AutoHotkeyU64.exe",StefOnSteroids wrote:Anyway, I don't mind compiling the script. Really glad I no longer have to specify the ahk-exe-path each and every time. Hoever, if I could make it portable (independent from drive letter) - that would be totally awesome. But I don't want to over-extend your helpfulness.
You're welcome!StefOnSteroids wrote:Thanks for a fantastic tool.
-
- Posts: 77
- Joined: 08 Aug 2015, 10:22
Re: [Script] CodeQuickTester - Write and run code without touching the file system
I am very impressed by the thorough analysis you applied to tackle this issue.
Didn't mean to cause so much aggravation, this seems quite an ordeal you had to go through to track it down.
Thanks a ton!
Despite being the best option, updating Internet Explorer is only feasible for my own machine. I rather remain portable (flexible) to work on other hosts without touching their system.
Moving or renaming the help file is also out of the question, this would open a can of worms with other tools I have set up with portable paths in editors and in my file manager, to open specific help pages from various places and menus. This structure has grown over the years, I wouldn't want to mess it up.
So I'll go with solution 2 - HelpFile:=""
I don't really need the help functionality, anyway, I already have enough links to help file pages as mentioned above.
I am still struggling with the relative path thingie, though.
- My script-dir = \Toolbox\ahk\Tools\QuickCodeTester
- My ahk.exe resides here: \Toolbox\ahk\AutoHotkeyU64.exe
Would you do me a favor and figure out the portable syntax I need? I have tried all kinds of variations along the lines of
"AhkPath": A_ScriptDir "\..\..\..\AutoHotkeyU64.exe",
but nothing really works out so far.
Many thanks.
Didn't mean to cause so much aggravation, this seems quite an ordeal you had to go through to track it down.
Thanks a ton!
Despite being the best option, updating Internet Explorer is only feasible for my own machine. I rather remain portable (flexible) to work on other hosts without touching their system.
Moving or renaming the help file is also out of the question, this would open a can of worms with other tools I have set up with portable paths in editors and in my file manager, to open specific help pages from various places and menus. This structure has grown over the years, I wouldn't want to mess it up.
So I'll go with solution 2 - HelpFile:=""
I don't really need the help functionality, anyway, I already have enough links to help file pages as mentioned above.
I am still struggling with the relative path thingie, though.
- My script-dir = \Toolbox\ahk\Tools\QuickCodeTester
- My ahk.exe resides here: \Toolbox\ahk\AutoHotkeyU64.exe
Would you do me a favor and figure out the portable syntax I need? I have tried all kinds of variations along the lines of
"AhkPath": A_ScriptDir "\..\..\..\AutoHotkeyU64.exe",
but nothing really works out so far.
Many thanks.
Re: [Script] CodeQuickTester - Write and run code without touching the file system
This code will get the relative path between any two given directories. My example assumes that the path is \Toolbox\ahk\Tools\QuickCodeTester\Tester.exe, rather than \Toolbox\ahk\Tools\QuickCodeTester.exe (your post was a little ambiguous)
When I ran it the output I received was "AhkPath": A_ScriptDir "\..\..\AutoHotkeyU64.exe",
Code: Select all
; The folder contianing CodeQuickTester.exe/.ahk
Path1 = D:\Toolbox\ahk\Tools\QuickCodeTester\
; The path to the AHK executable
Path2 = D:\Toolbox\ahk\AutoHotkeyU64.exe
PathRel := GetRelativePath(Path1, Path2)
MsgBox, "AhkPath": A_ScriptDir "\%PathRel%"`,
GetRelativePath(PathFrom, PathTo)
{
VarSetCapacity(PathRel, A_IsUnicode?520:260) ; MAX_PATH
if !DllCall("Shlwapi.dll\PathRelativePathTo"
, "Str", PathRel ; Out Directory
, "Str", PathFrom, "UInt", 0x10 ; From Directory
, "Str", PathTo, "UInt", 0x10) ; To Directory
throw Exception("Relative path could not be found")
return PathRel
}
-
- Posts: 77
- Joined: 08 Aug 2015, 10:22
Re: [Script] CodeQuickTester - Write and run code without touching the file system
Sorry for the ambiguity. Based on your hint with
"AhkPath": A_ScriptDir "\AutoHotkeyU64.exe"
I expected something involving A_ScriptDir and a bunch of \..\.. the way I am used to from other programs. So I went ahead and read out A_ScriptDir and the MsgBox specified it without the exe, only the path component alone.
Meanwhile I had been tinkering with
SplitPath, A_ScriptDir,,,,,DriveLetter (after some extensive reading in the help file) but then failed again when constructing the whole enchilada for "AhkPath": ...
So anyway, I am really glad your reply came in and put an end to my agonizing.
Your function is WAY over my head , but it works perfectly fine. There is no way I would have ever figured out how to make it portable.
Thanks again. I really appreciate it.
"AhkPath": A_ScriptDir "\AutoHotkeyU64.exe"
I expected something involving A_ScriptDir and a bunch of \..\.. the way I am used to from other programs. So I went ahead and read out A_ScriptDir and the MsgBox specified it without the exe, only the path component alone.
Meanwhile I had been tinkering with
SplitPath, A_ScriptDir,,,,,DriveLetter (after some extensive reading in the help file) but then failed again when constructing the whole enchilada for "AhkPath": ...
So anyway, I am really glad your reply came in and put an end to my agonizing.
Your function is WAY over my head , but it works perfectly fine. There is no way I would have ever figured out how to make it portable.
Thanks again. I really appreciate it.
-
- Posts: 175
- Joined: 24 Dec 2016, 13:16
- Location: Antarctica
Re: [Script] CodeQuickTester - Write and run code without touching the file system
If i may make a suggestion that would make it tons better. Could you consider adding np++ like functionality where all text in current window is used as a wordlist to autocomplete text, this function i reckon should make it a breeze to implement.... https://autohotkey.com/board/topic/9612 ... -down-list.
Great tool regardless...
Great tool regardless...
Outsourcing Clicks & Presses Since 2004.
-
- Posts: 175
- Joined: 24 Dec 2016, 13:16
- Location: Antarctica
Re: [Script] CodeQuickTester - Write and run code without touching the file system
On the subject of my suggestion above(which i opted out of editing), check THIS out, it basically does what i asked for above,just across multiple editors.
Here's the code 'snippet' is used to retrieve the alphabetically ranked word-list from the active editor, just thought it would save you sometime if you chose to do it...
Here's the code 'snippet' is used to retrieve the alphabetically ranked word-list from the active editor, just thought it would save you sometime if you chose to do it...
Code: Select all
updateWordList:
SetBatchLines, -1 ;go as fast as possible to reduce update delay
thisEditorText := GetTextFromControl()
;don't rebuild word list if text content of window hasn't changed
IfEqual, thisEditorText, %lastEditorText%
Return
WordList := AlphaSortList(GetActiveWinWordList()) ;get & sort worldlist from active window text
;rebuild wordlist to vars
Loop, Parse, Wordlist, `n
{
tosend = %a_loopfield%
cmd%a_index% = %toSend%
}
; ToolTip, %WordList%
lastEditorText := thisEditorText
SetBatchLines, 10ms ;default speed
Return
Put(string){ ;as an alternative to send,to instantly place a string
ClipSaved := ClipboardAll
clipboard := ""
clipboard := string
clipwait
Send ^v
Clipboard := ClipSaved
}
GetActiveWinWordList(){
Global lastText
Global lastWordList
text := GetTextFromControl()
If !text ;if no text can be retrieved from a control get all text in window
WinGetText, text, A
;rebuild WordList only if text in editor has changed
IfEqual, text, %lastText%
Return lastWordList
lastText := text
StringReplace, text, text, `,, `n, ALL
StringReplace, text, text, `r`n, `n, ALL
StringReplace, text, text, %A_Space%, `n, ALL
StringReplace, text, text, %A_Tab%, `n, ALL
;remove white spaces
wordListText := RegExReplace(text , "(^|\R)\K\s+")
;rebuild wordlist using only strings longer than 3 characters
Wordlist:=""
Loop, Parse, wordListText, `n
If StrLen(A_LoopField) >= 3 ;strings of over 3 characters
IfNotInString, Wordlist, %A_Space%%A_LoopField%%A_Space% ;avoid repeated strings
Wordlist.= " " A_LoopField " " "`n" ;add spaces on either side so that words in other word can easily be added to list
StringReplace, Wordlist, Wordlist, %A_Space%, , ALL ;spaces are no longer needed as list is done building
lastWordList := WordList
Return WordList
}
GetTextFromControl(){
WinGet, controlList, ControlList, A
WinGet, ProcName , ProcessName, A
if regexmatch(ProcName, "i)(?:Sc(?:\d+|iTE))|(?:notepad(?:\+\+|2)).exe")
ControlGetText, text ,Scintilla1, A
else if InStr(controlList, "Edit1")
ControlGetText, text ,Edit1, A
else if InStr(controlList, "TConTEXTSynEdit1")
ControlGetText, text ,TConTEXTSynEdit1, A
else if InStr(controlList, "RICHEDIT50W1")
ControlGetText, text ,RICHEDIT50W1, A
else if InStr(controlList, "Scintilla1")
ControlGetText, text ,Scintilla1, A
return (text ? text : "")
}
AlphaSortList(list){
StringSplit, line, list, `n,`r
Loop, parse, list, `n, `r
data1 .= (data1?"`n":"") A_LoopField "|" A_Index
data1 := RegExReplace(data1, "[ `,“”\(\)\/`:]")
sort, data1
loop, parse, data1, `n,`r
l := RegExReplace(A_LoopField, ".*\|") , out .= (out?"`n":"") line%l%
Return out
}
Outsourcing Clicks & Presses Since 2004.
Re: [Script] CodeQuickTester - Write and run code without touching the file system
Glad I could help!StefOnSteroids wrote:Thanks again. I really appreciate it.
Unfortunately that function cannot be applied to what is being done with CodeQuickTester. It appears to be more for navigation bars or search menus.brutus_skywalker wrote:If i may make a suggestion that would make it tons better. Could you consider adding np++ like functionality where all text in current window is used as a wordlist to autocomplete text, this function i reckon should make it a breeze to implement.... https://autohotkey.com/board/topic/9612 ... -down-list.
Check THIS outbrutus_skywalker wrote:On the subject of my suggestion above(which i opted out of editing), check THIS out, it basically does what i asked for above,just across multiple editors.
-
- Posts: 175
- Joined: 24 Dec 2016, 13:16
- Location: Antarctica
Re: [Script] CodeQuickTester - Write and run code without touching the file system
It actually works on edit controls as well,here:GeekDude wrote: Unfortunately that function cannot be applied to what is being done with CodeQuickTester. It appears to be more for navigation bars or search menus.
Code: Select all
;edit box
gui,new,hwndhgui
gui,add,edit,w300 h300 hwndhedit
gui,show
txt=I'm fine;That's ok;Thank you;Oh my god
AutoComplete(hedit,"init",txt,";")
AutoComplete(hedit,"option","AUTOSUGGEST AUTOAPPEND",0)
/* Autocompletion
Function : Autocomplete(hwnd , action , p1=0 , p2=0)
Parameter
hwnd : hwnd of edit control
action : init , enable , disable , release , option
Usage:
1. Initializes the autocomplete object.
Function : Autocomplete(hwnd , "init" , txt , delim)
Parameter
txt : Autocomplete list
delim : delimiter seperate each item
2. Enables autocompletion.
Function : Autocomplete(hwnd , "enable" , 0 , 0)
3. Disables autocompletion.
Function : Autocomplete(hwnd , "disable" , 0 , 0)
4. Release autocompletion.
Function : Autocomplete(hwnd , "release" , 0 , 0)
5. Sets the current autocomplete options.
Function : Autocomplete(hwnd , "option" , mode , 0)
Parameter
mode : options seperated by space
AUTOSUGGEST : Enable the autosuggest drop-down list.
AUTOAPPEND : Enable autoappend.
SEARCH : Add a search item to the list of completed strings. When the user selects this item, it launches a search engine.
FILTERPREFIXES : Do not match common prefixes, such as "www." or "http://".
USETAB : Use the TAB key to select an item from the drop-down list.
UPDOWNKEYDROPSLIST : Use the UP ARROW and DOWN ARROW keys to display the autosuggest drop-down list.
RTLREADING : read right-to-left (RTL).
WORD_FILTER : If set, the autocompleted suggestion is treated as a phrase for search purposes.
NOPREFIXFILTERING : Disable prefix filtering when displaying the autosuggest dropdown. Always display all suggestions.
*/
AutoComplete(self,celt,rgelt,pceltFetched){
static es:=[]
if (celt="init"){ ; Initializes the autocomplete object.
sList:=[]
loop,parse,rgelt,%pceltFetched%,%A_Space%%A_Tab%
sList[A_Index]:=A_LoopField
obj:=[],obj.List:=sList,obj.CurrentElement:=1,obj.hwnd:=self
obj.SetCapacity("EnumString",A_PtrSize*8)
pes:=obj.GetAddress("EnumString")
,NumPut(pes+A_PtrSize,pes+0)
,NumPut(RegisterCallback("_EnumString_QueryInterface","F"),pes+A_PtrSize*1)
,NumPut(RegisterCallback("_EnumString_AddRef","F"),pes+A_PtrSize*2)
,NumPut(RegisterCallback("_EnumString_Release","F"),pes+A_PtrSize*3)
,NumPut(RegisterCallback(A_ThisFunc,"F"),pes+A_PtrSize*4)
,NumPut(RegisterCallback("_EnumString_Skip","F"),pes+A_PtrSize*5)
,NumPut(RegisterCallback("_EnumString_Reset","F"),pes+A_PtrSize*6)
,NumPut(RegisterCallback("_EnumString_Clone","F"),pes+A_PtrSize*7)
pac2:=ComObjCreate("{00BB2763-6A77-11D0-A535-00C04FD7D062}","{EAC04BC0-3791-11d2-BB95-0060977B464C}") ; IAutoComplete2
obj.pac:=pac2
DllCall(NumGet(NumGet(pac2+0)+3*A_PtrSize),"ptr",pac2,"ptr",self,"ptr",pes,"ptr",0,"ptr",0,"uint")
es[pes]:=obj
return 0
}else if (celt="enable"){ ; Enables autocompletion.
for k,v in es
{
if (v.hwnd=self)
return DllCall(NumGet(NumGet(v.pac+0)+4*A_PtrSize),"ptr",v.pac,"int",1,"uint")
}
return
}else if (celt="disable"){ ; Disables autocompletion.
for k,v in es
{
if (v.hwnd=self)
return DllCall(NumGet(NumGet(v.pac+0)+4*A_PtrSize),"ptr",v.pac,"int",0,"uint")
}
return
}else if (celt="release"){ ; Release autocompletion.
for k,v in es
{
if (v.hwnd=self)
ObjRelease(v.pac),es.remove(k)
}
return
}else if (celt="option"){ ; Sets the current autocomplete options.
if rgelt is Integer
{
if rgelt<0x200
option:=rgelt
else return
}else{
mode:={AUTOSUGGEST:1 ; Enable the autosuggest drop-down list.
,AUTOAPPEND:2 ; Enable autoappend.
,SEARCH:4 ; Add a search item to the list of completed strings. When the user selects this item, it launches a search engine.
,FILTERPREFIXES:8 ; Do not match common prefixes, such as "www." or "http://".
,USETAB:0x10 ; Use the TAB key to select an item from the drop-down list.
,UPDOWNKEYDROPSLIST:0x20 ; Use the UP ARROW and DOWN ARROW keys to display the autosuggest drop-down list.
,RTLREADING:0x40 ; read right-to-left (RTL).
,WORD_FILTER:0x80 ; If set, the autocompleted suggestion is treated as a phrase for search purposes. The suggestion, Microsoft Office, would be treated as "Microsoft Office" (where both Microsoft AND Office must appear in the search results).
,NOPREFIXFILTERING:0x100} ; Disable prefix filtering when displaying the autosuggest dropdown. Always display all suggestions.
option:=0
loop,parse,rgelt,%A_Space%
if mode[A_LoopField]
option|=mode[A_LoopField]
}
for k,v in es
{
if (v.hwnd=self)
return DllCall(NumGet(NumGet(v.pac+0)+5*A_PtrSize),"ptr",v.pac,"uint",option,"uint") ; IAutoComplete2::SetOptions
}
return
}else if !es.haskey(self){
return 1
}else if (celt="reset"){ ; Resets the enumeration sequence to the beginning.
es[self].CurrentElement:=1
}
if !celt
celt:=1
i:=0
loop % celt ; IEnumString::Next method
{
if (es[self].CurrentElement=es[self].List.maxindex()+1)
break
string:=es[self].List[es[self].CurrentElement]
NumPut(p:=DllCall("Ole32\CoTaskMemAlloc","uint",len:=2*(StrPut(string,"utf-16"))),rgelt+(A_Index-1)*A_PtrSize)
;DllCall("RtlMoveMemory","ptr",p,"ptr",&string,"uint",len)
StrPut(string,p,"utf-16")
NumPut(NumGet(pceltFetched+0,"uint")+1,pceltFetched,0,"uint")
es[self].CurrentElement:=es[self].CurrentElement+1
i++
}
return (i=celt)?0:1
}
_EnumString_QueryInterface(self,riid,pObj){
DllCall("Ole32\StringFromCLSID","ptr",riid,"ptr*",sz),string:=StrGet(sz,"utf-16")
if (string="{00000101-0000-0000-C000-000000000046}"){
return NumPut(self,pObj+0)*0
}else return 0x80004002
}
_EnumString_AddRef(self){
return 1
}
_EnumString_Release(self){
return 0
}
_EnumString_Skip(self,celt){
return 0
}
_EnumString_Reset(self){
AutoComplete(self,"reset",0,0)
return 0
}
_EnumString_Clone(self,ppenum){
NumPut(self,ppenum+0)
return 0
}
THAT'S WHAT I WAS SAYIN' , is it going to be an update?GeekDude wrote: Check THIS out
Outsourcing Clicks & Presses Since 2004.
Re: [Script] CodeQuickTester - Write and run code without touching the file system
It's not quite ready for prime time, but here's a copy of my current test https://p.ahkscript.org/?p=9937466bbrutus_skywalker wrote:THAT'S WHAT I WAS SAYIN' , is it going to be an update?
Let me know what you think! I'm sure there's some aspects of it that I haven't considered but as far as functionality goes I think it's almost there.
-
- Posts: 175
- Joined: 24 Dec 2016, 13:16
- Location: Antarctica
Re: [Script] CodeQuickTester - Write and run code without touching the file system
Objectively speaking, RADDD!. Text completion is basically instantaneous,so it doesn't slow you down & you also included ahk commands in addition to auto-completing text in the editor,which is just icing on the cake. If possible tooltips would be nice for the commands,i imagine it's easy enough given rajat's intellisense script uses the commands.txt included with ahk.GeekDude wrote:It's not quite ready for prime time, but here's a copy of my current test https://p.ahkscript.org/?p=9937466bbrutus_skywalker wrote:THAT'S WHAT I WAS SAYIN' , is it going to be an update?
Let me know what you think! I'm sure there's some aspects of it that I haven't considered but as far as functionality goes I think it's almost there.
BTW, notepad++ doesn't even have case corrective auto-completion(i.e case of typed string must match a suggestion) which was a freaking pain,guess i have a new default ahk editor.
Love it, and thanks for this dude.
EDIT:
One more thing i noticed,if a string contains a integer it's split into multiple strings instead of being one,i.e Unicode2Ascii is only autocompleted as 'Unicode' and 'Ascii' not as one string, i understand the reasons for this, especially symbols but i think exceptions should be made for integers & certain symbols such as '_' which are often used to define variables & functions.
Outsourcing Clicks & Presses Since 2004.
Re: [Script] CodeQuickTester - Write and run code without touching the file system
What do you think about allowing keywords containing numbers as long as the keyword does not start with the number? Right now the rule is alpha characters and underscore only.brutus_skywalker wrote:One more thing i noticed,if a string contains a integer it's split into multiple strings instead of being one,i.e Unicode2Ascii is only autocompleted as 'Unicode' and 'Ascii' not as one string, i understand the reasons for this, especially symbols but i think exceptions should be made for integers & certain symbols such as '_' which are often used to define variables & functions.
-
- Posts: 175
- Joined: 24 Dec 2016, 13:16
- Location: Antarctica
Re: [Script] CodeQuickTester - Write and run code without touching the file system
GeekDude wrote:What do you think about allowing keywords containing numbers as long as the keyword does not start with the number? Right now the rule is alpha characters and underscore only.
I think that should cover an absolute majority of use cases. I've never seen code where a function/var name starts with an integer.
Edit:
On another note, Just realized that command usage is shown on the status bar for command on caret position,never looked there before despite using for ages...till now... I think you might consider using a different font face and/or making it bold+italic or even a different color to make it standout,that's at least how i modified it for my use. All aside sweet usage of the status bar,lest we miss it.
Outsourcing Clicks & Presses Since 2004.
Re: [Script] CodeQuickTester - Write and run code without touching the file system
CodeQuickTester v2.7 has been released
Please see the original post for a link to the release and revision history pages.
Changes
The original post has been updated
It now includes a lot of information about steps you can optionally take to integrate CodeQuickTester into your system. Please go back and re-read it!
Please see the original post for a link to the release and revision history pages.
Changes
- Improved script options menu file selector default folders/files
- Fixed help file integration when only IE8 is available
- Various improvements to Wine compatibility
- Reorganized the menu bar
- Made the default pastebin dialog values more generic
- Dynamic keyword autocompletion
- Menu for inserting includes
- Menu button/hotkey for exiting (Ctrl+W)
- Menu button to open the working directory
- Support for an external Settings.ini file
- Support for compiling into a portable exe via AutoHotkey_H
The original post has been updated
It now includes a lot of information about steps you can optionally take to integrate CodeQuickTester into your system. Please go back and re-read it!
-
- Posts: 77
- Joined: 08 Aug 2015, 10:22
Re: [Script] CodeQuickTester - Write and run code without saving to a temporary file
Great idea to allow a settings file - so users can keep their custom font sizes, colors etc from version to version.
Would you please provide a sample settings.ini or give a few guidelines what the ini-file must look like?
Would you please provide a sample settings.ini or give a few guidelines what the ini-file must look like?
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 73 guests