CodeQuickTester

Post your working scripts, libraries and tools
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

CodeQuickTester

26 Jan 2015, 11:37

Image

And the output of the example script shown:
Spoiler


Features:
  • Dynamic script execution
  • Multiple instances
  • ahkbin (IRC pastebin) integration
  • Save and load from file
  • Download code from any given URL
  • RichEdit
  • Dark theme
  • 4-space tab width
  • Consolas
  • Able to pass parameters to the script
  • Drop file onto GUI to open it
  • Can be registered as the service handler for ahk: links
  • Automatically re-indent your code
  • AlwaysOnTop toggle

Notes:
  • The run button changes to a kill button while the script is running
  • It will attempt to close the script nicely for a second or two before killing the scripts process
  • Requires AHK v1.1
  • Due to the nature of tab widths, attempting to change the font from Consolas could result in messed up tabs
  • The dynamic script's name will be AHK_CQT_%A_TickCount%

Here's a user script for adding ahk: service handler links to the ahkscript forum code boxes and gist boxes:
Spoiler


Code
Last edited by GeekDude on 05 Oct 2015, 15:11, edited 7 times in total.
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: CodeQuickTester

26 Jan 2015, 15:44

Nice you finally posted it!
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: CodeQuickTester

26 Jan 2015, 18:58

But i mean your updated version :)
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

26 Jan 2015, 19:06

Well I'm glad you like it, though! Interesting thing about running scripts dynamically. File loops get $CONIN and $CONOUT as listed in the script's directory.
enthused
Posts: 94
Joined: 27 Dec 2014, 03:28

Re: CodeQuickTester

26 Jan 2015, 23:11

Now this is very nice and very compact too.
Thank you GeekDude
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

26 Jan 2015, 23:41

WARNING: It will throw errors if you try to run a script with unicode characters in it. See here.

Edit: Fixed
Last edited by GeekDude on 17 Feb 2015, 14:16, edited 1 time in total.
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: CodeQuickTester

26 Jan 2015, 23:49

Lol
Coco
Posts: 771
Joined: 29 Sep 2013, 20:37
GitHub: cocobelgica

Re: CodeQuickTester

28 Jan 2015, 10:39

Simple wish: perhaps add another edit control to allow passing of command line parameters.
User avatar
cyruz
Posts: 242
Joined: 30 Sep 2013, 13:31

Re: CodeQuickTester

28 Jan 2015, 13:59

Very nice! I can finally stop creating tmp.ahk & test.ahk everywhere :D :D
ABCza on the old forum.
My GitHub.
User avatar
boiler
Posts: 1535
Joined: 21 Dec 2014, 02:44

Re: CodeQuickTester

28 Jan 2015, 15:32

^ Yes, now I can out of the habit of littering my desktop with all these little test scripts I write and try from from forum posts. Love this.
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

28 Jan 2015, 15:45

Nevermind about my mention of $CONIN and $CONOUT. I'm just an idiot who was using those instead of CONIN$ and CONOUT$, thus causing files to actually be created and my print function to not work.
Soft
Posts: 160
Joined: 07 Jan 2015, 13:18
GitHub: visionary1
Location: Seoul
Contact:

Re: CodeQuickTester

28 Jan 2015, 23:25

I really like this! good work
AutoHotkey & AutoHotkey_H v1.1.22.07
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

29 Jan 2015, 11:20

Update: Removed /ErrorStdOut. Interestingly I hadn't noticed the implications of having it in there without actually handling the errors until now.
User avatar
cyruz
Posts: 242
Joined: 30 Sep 2013, 13:31

Re: CodeQuickTester

29 Jan 2015, 11:29

What about an integration with your console class so that the user can redirect the output there?
ABCza on the old forum.
My GitHub.
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: CodeQuickTester

29 Jan 2015, 11:33

Because that would ruin the lightweight single-file thing I'm going for. Besides, you don't actually need the console class unless you want to do crazy stuff. Simple console output can be done in two lines:

Code: [Select all] [Download] GeSHi © Codebox Plus

DllCall("AttachConsole") ; Top of script
FileOpen("CONOUT$", "w").Write("Some text") ; Wherever you want to print


However, this wouldn't really help much, seeing as there's already a pretty good built-in method of showing the user error messages.
User avatar
boiler
Posts: 1535
Joined: 21 Dec 2014, 02:44

Re: CodeQuickTester

29 Jan 2015, 11:49

What's the script directory? What if an app creates .ini files or something in the script directory. Where do they go? Sorry if you said that already. I couldn't find that mentioned.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 17 guests