CodeQuickTester - Write and run code without touching the file system

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

CodeQuickTester - Write and run code without touching the file system

26 Jan 2015, 11:37

CodeQuickTester

Write and run code without touching the file system.

Image
Old Image
Example script output


Features

  • Write and run code without touching the file system (except under WINE)
  • Run multiple instances simultaneously
  • Share code directly to the IRC pastebin
  • Saving to file is supported, but optional
  • Fetch code from any given URL
  • RichEdit based code highlighter
  • Supports file drag and drop
  • Can be registered as the service handler for ahk: links
  • Automatic re-indentaiton of code
  • Quick AHK version switching
  • Specify script command line parameters

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
  • The dynamic script's name will be AHK_CQT_%A_TickCount%

Known Issues

  • Selecting things while the highlighter is active sometimes messes up
  • Formatting isn't stripped from rich content when being dragged into the editor

Related

  • Greasemonkey script for adding ahk: service handler links to the forum code boxes and gist boxes:
    Spoiler



Releases

Revision history
Last edited by GeekDude on 05 Oct 2015, 15:11, edited 7 times in total.
User avatar
joedf
Posts: 5812
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: 5812
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: 739
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: 739
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: 5812
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: 243
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: 1825
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: 739
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.
User avatar
Soft
Posts: 174
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: 739
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: 243
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: 739
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: 1825
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 15 guests