Sign in to follow this  
Followers 0
Minikori

ClipRunner

3 posts in this topic

#1 ·  Posted (edited)

This is just a simple little script I've been using for a while, so I thought I'd post it. I put it in a thread a while back, but I'll put it in Example Scripts (it's also changed a tad).

Here it is:

Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)
TraySetIcon("shell32.dll", -175)
TraySetToolTip("Clip Runner by Minikori")

$TrayRun = TrayCreateItem("Run Script From Clipboard")
$TrayExit = TrayCreateItem("Exit Program")

TraySetState()
While 1
    $msg = TrayGetMsg()
    If $msg = $TrayRun Then
        $String = ClipGet()
        $File = FileOpen(@TempDir & "\DebugScript.au3", 2)
;~      $Code = StringReplace($String, "#include <", "#include <C:\Program Files\AutoIt3\Include\"); Needed to because it caused errors before
;~      $Code = StringReplace($Code, "#include<", "#include <C:\Program Files\AutoIt3\Include\"); Needed to because it caused errors before
        FileWrite($File, $String)
        FileClose($File)
        ShellExecuteWait(@TempDir & "\DebugScript.au3")
;~      Send("{F5}"); Use if your AutoIT scripts run in SciTE by default. If they do, then you need to run this program outside of SciTE at first
    ElseIf $msg = $TrayExit Then
        FileDelete(@TempDir & "\DebugScript.au3")
        ExitLoop
    EndIf
WEnd
Exit

Just have it running, copy code, and click "Run Script From Clipboard" on the tray icon.

Edited by Minikori

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

---

Edited by playlet

Share this post


Link to post
Share on other sites

Handy little tool, thanks!

Just a small suggestion that would make it better - you could add a loop which waits until the script ends and then deletes temporary file.

Playlet

Editing first post now...

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0