Jump to content

[Idea] ClipScript


Marlo
 Share

Recommended Posts

This is just an idea i thought someone might like to expand on.

Basicly it writes the contents of your clipboard to a temp file then runs it using /AutoIt3ExecuteScript. Pretty basic idea but very useful if your using these forums and very quickly want to test someones source. I have written a small example:

$String = ClipGet()
$File = FileOpen(@TempDir & "\DebugScript.au3", 2)
$Code = StringReplace($String, "#include <", "#include <C:\Program Files\AutoIt3\Include\")
$Code = StringReplace($Code, "#include<", "#include <C:\Program Files\AutoIt3\Include\")
FileWrite($File, $Code)
FileClose($File)
ShellExecute(@ScriptFullPath, '/AutoIt3ExecuteScript "' & @TempDir & '\DebugScript.au3"')

Hope this helps somebody

Edited by Marlo
Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
Link to comment
Share on other sites

This is just an idea i thought someone might like to expand on.

Basicly it writes the contents of your clipboard to a temp file then runs it using /AutoIt3ExecuteScript. Pretty basic idea but very useful if your using these forums and very quickly want to test someones source. I have written a small example:

$String = ClipGet()
$File = FileOpen(@TempDir & "\DebugScript.au3", 2)
$Code = StringReplace($String, "#include <", "#include <C:\Program Files\AutoIt3\Include\")
$Code = StringReplace($Code, "#include<", "#include <C:\Program Files\AutoIt3\Include\")
FileWrite($File, $Code)
FileClose($File)
ShellExecute(@ScriptFullPath, '/AutoIt3ExecuteScript "' & @TempDir & '\DebugScript.au3"')

Hope this helps somebody

Add a FileDelete() to the end and a HotKeySet() for it all and you have your idea! Not really any need for expansion, I like it.

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

Link to comment
Share on other sites

you could use stringregexpreplace for the include lines (so you can have as many blank spaces as you like)

and also C:\Program files\Autoit3\Include\ should be

RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt" , "InstallDir" , @ProgramFilesDir&"\Autoit3")&"\Include\"

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Link to comment
Share on other sites

a very good idea, but your script is not complete. also it will ClipGet() all the copied text and run it. you have to make it for only copying text from this site and run it.

Why? What if I find code on another site? Also with how it is you could make a settings GUI that allows multiple languages.

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

Link to comment
Share on other sites

[crazy idea]

Another variation to your good idea, could be a FF extension or Greasemonkey script that reads the contents in the thread and insert a button at top of the every code tag for run code.

[/crazy idea]

Potentially harmful or potentially useful. Only a crazy idea. :P

Link to comment
Share on other sites

[crazy idea]

Another variation to your good idea, could be a FF extension or Greasemonkey script that reads the contents in the thread and insert a button at top of the every code tag for run code.

[/crazy idea]

Potentially harmful or potentially useful. Only a crazy idea. :(

I would like that, that would be very useful :P
Link to comment
Share on other sites

i made this just for practicing :P

but it's a tray program you select and copy a script here and click in tray or use shortcut ctrl+q and the script runs

its just like the idea it makes a temp file in the temp folder

there is a FireFox Add-On which is good. and i use FireFox :(
Enjoy the complexity.Feel the power of simplicity.
Link to comment
Share on other sites

its just for me for practice and if someone wants it without firefox they can use this

updated it a little now also opens in scite so you can save it youself (shortcuts= ctrl+q:run script-ctrl+w:open script-ctrl+s:quit

http://www.megaupload.com/?d=VFB42VV3

ps does it work on your comuters?? :P

Hey! You could post the source code and save us from downloading it, and also waiting 45 seconds. Post the code in your reply with [code ] [/code ] tags around it, just remove the spaces :(

EDIT: Only post the source code if you want to, if not then upload it to another webhost like http://trashbin.nfshost.com/

Edited by TehWhale
Link to comment
Share on other sites

ok i made this building and change the code in the firs script:P

http://pastebin.com/f51fc59eb

tell me if i can make it better :P

I like the idea in your script and I am still playing around with your code to adapt to my needs. Here are some comments:

1. Looks like the two "FileDelete($File)" statements should be:

"FileDelete(@TempDir & "\DebugScript.au3")"

2. I have actually removed these deletes because this allows the editing of the temp file and doing a "Save As".

I placed "FileDelete(@TempDir & "\DebugScript.au3")" at the top of the script.

3. I have added a "move" Hotkey to save the contents of the temp file.

4. I've added a "help" HotKey.

5. For my work I do not need to substitute full paths for the include files...so I have removed $Code (StringReplace).

Thanks for the good work!

RW Baker

RW Baker

Link to comment
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
 Share

  • Recently Browsing   0 members

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