Jump to content

QuickScript


therks
 Share

Recommended Posts

Updated 2008-10-14

Author:         Rob Saunders - www.therks.com
Language:       AutoIt v3.2.13.8 - www.autoitscript.com
Description:
    A simple text window that will run and/or compile AutoIt3 code.
    Using the compiled version of this script you should be able to run and
    compile AutoIt code on machines that do not even have AutoIt installed.
    
    Program settings are stored, by default, in the current user's application data
    folder (ie: C:\Documents and Settings\Rob\Application Data\quickscript.ini).
    HOWEVER, if you create a quickscript.ini in the same folder as the program
    it will use that file instead when saving/loading program settings.
    
    To run the code in the content area, choose Options > Run, or press Ctrl+R.
    To stop code execution (in the case of an infinite loop, for example) press Ctrl+Q
    or try to close the QuickScript window (note that unless you used #NoTrayIcon, or
    otherwise hid the tray icon, the icon will remain in your system tray, just like
    every other program that hasn't closed properly, just mouse over the icon and it
    should disappear).
    
    Snippets are chunks of code that you can store for quick use, it's a good place
    to store a piece of code used in common tests like a GUI template or an
    infinite loop. A few snippets come pre-loaded. You can add your own by using
    the Snippet menu, or manually editing the settings file.
    
    For more information about AutoIt check online at http://www.autoitscript.com
    
    Important Notes:
        A)  To use include files, when QuickScript is compiled, they must be
            placed in an "include" subfolder where the .exe is stored.
            Example:
                EXE path = D:\Files\QuickScript.exe
                String.au3 path MUST = D:\Files\Include\String.au3
                or else #include <String.au3> will not work.
                #include "D:\Files\String.au3" will work though, obviously.
        B)  If you wish to compile this script yourself you may need to alter the lines
            that pertain to the location of the AutoIt3 compiler files. Look for the
            function "_CompilerGetFiles" and edit the FileInstall lines appropriately.
        C)  The include files (String.au3, File.au3, GUIConstants.au3, etc..) are not
            installed by this script, whether it's compiled or not. Just too many to
            add. You will have to get those yourself.
    
    Version History:
        1.0)    First numbered version.

Compiled (1.10MB, AutoIt v3.2.13.8) / Source (40KB)

Enjoy!

So I originally wrote this a while ago so that I could quickly test AutoIt code. Whether it was code I saw on the forum, or I needed to test a bug, or an idea, etc. I keep a compiled version on a jumpdrive, so I can also try code whether AutoIt is installed on the machine or not.

The code is fairly messy, like I said, I started it a while ago, and I've just tweaked it as I went along, but I use this on a daily basis and I find it really handy.

Edited by RobSaunders
Link to comment
Share on other sites

I like it!

And even better I've been looking for something like this.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Hmm, anybody know if there's a way I could grab the ConsoleWrite() output from a script with this? It'd be handy for when testing since a lot of people use ConsoleWrite with Scite instead of MsgBox's or something.

*Edit: Nevermind I figured it out. StdoutRead works fine. Time to add that in. :whistle:

Edited by Saunders
Link to comment
Share on other sites

  • 2 weeks later...

All I really have to say is feel free to edit to your hearts content.

Concerning your suggestions directly:

1: I don't keep track of versions of the script. I'm constantly tweaking it.

2: Personally, I always have the beta installed, I don't keep separate copies of stable and beta. I find the whole switching back and forth very annoying.

But thanks for the interest and the suggestions anyway!

*Edit: Had to add in that last part, didn't realize how rude I sounded at first. Sorry.

Edited by Saunders
Link to comment
Share on other sites

  • 3 weeks later...
  • 9 months later...

_GUICtrlEdit_SetSel instead of _GUICtrlEditSetSel. Can someone correct this?

The other parts if you replace _GUICtrlEditLineFromChar to _GUICtrlEdit_LineFromChar it should work fine.

I just don't understand the code on line 102 which has only one parameter.

Edited by Yho2005
Link to comment
Share on other sites

I just don't understand the code on line 102 which has only one parameter.

_GUICtrlEditGetSel()? Same as _GUICtrlEdit_GetSel()

Sorry this is not working with the latest version. I haven't had time to work on it lately. Even on my own computer with the new Stdin/out functions everytime I run a script I'm getting 100% CPU usage, I can't imagine it's a bug with AutoIt (that hasn't been reported yet) so I think I just need to have a better look at that section of code and probably rewrite it totally instead of just trying to tweak it for the new function syntax.

And I don't know when I'll have time to do any of that. I just came off a 14 day run of 12 hour shifts and am looking at another (possibly longer this time) after only 1 (sort of) day off.

Link to comment
Share on other sites

Yeah sorry about that. I changed it to that as well but then another error popped up.

After having looked through it and updated the old functions to the new was Line 103 which said:

If $aEditSel[1] <> $aEditSelMem[1] Or $aEditSel[2] <> $aEditSelMem[2] Then

If $aEditSel[1] <> $aEditSelMem[1] Or ^ERROR

Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded

Edited by Yho2005
Link to comment
Share on other sites

Hi !

Checked into this a bit (Compared old vs. new GuiEdit.au3 include) & it turns out to be

a shift in the parameters, if you change

If $aEditSel[1] <> $aEditSelMem[1] Or $aEditSel[2] <> $aEditSelMem[2] Then

into

If $aEditSel[0] <> $aEditSelMem[0] Or $aEditSel[1] <> $aEditSelMem[1] Then

it compiles fine under 3.2.10.0. Not having tested the program before, I wouldn't be able to

say if that makes the program usable though ...

wim

edit: runs on 3.2.11.1 too, if you add:

#include <WindowsConstants.au3>
  #include <StaticConstants.au3>

edit2: played a bit with it .... Thanks a lot Saunders, this is gonna come in real handy !

Edited by whim
Link to comment
Share on other sites

  • 4 weeks later...

Update 2008-03-20: Wow, almost a year later...

Author:         Rob Saunders - www.therks.com
Language:       AutoIt v3.2.11.3 (beta) - www.autoitscript.com
Description:
    A simple text window that will run and/or compile AutoIt3 code.
    Using the compiled version of this script you should be able to run and
    compile AutoIt code on machines that do not even have AutoIt installed.
    
    Program settings are stored, by default, in the current user's application data
    folder (ie: C:\Documents and Settings\Rob\Application Data\quickscript.ini).
    HOWEVER, if you create a quickscript.ini in the same folder as the program
    it will use that file instead when saving/loading program settings.
    
    To run the code in the content area, choose Options > Run, or press Ctrl+R.
    To stop code execution (in the case of an infinite loop, for example) press Ctrl+W
    or try to close the QuickScript window.
    
    Snippets are chunks of code that you can store for quick use, a good place
    to store a piece of code used in common tests like a GUI template, or an
    infinite loop. A few snippets come pre-loaded. You can add your own by using
    the Snippet menu, or manually editing the settings file.
    
    For more information about AutoIt check online at http://www.autoitscript.com
    
    Important Notes:
        A)  To use include files, when QuickScript is compiled, they must be
            placed in an "include" subfolder where the .exe is stored.
            Example:
                EXE path = D:\Files\QuickScript.exe
                String.au3 path must = D:\Files\Include\String.au3
                Or else #include <String.au3> will not work.
                #include "D:\FullPathToFile\String.au3" will still work though.
        B)  If you wish to compile this script yourself you may need to alter the lines
            that pertain to the location of the AutoIt3 compiler files. Look for the
            function "_CompilerGetFiles" and edit the FileInstall lines appropriately.
        C)  The include files (String.au3, File.au3, GUIConstants.au3, etc..) are not
            installed by this script, whether it's compiled or not. Just too many to
            add. You will have to get those yourself.

Compiled (1.0MB) / Source (34KB)

Enjoy!

Link to comment
Share on other sites

  • 6 months later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...