Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Clipboard utility to interface with AU3


  • Please log in to reply
8 replies to this topic

#1 trids

trids

    Hmmm .. and what have we here?

  • Active Members
  • PipPipPipPipPipPip
  • 1,004 posts

Posted 04 June 2004 - 06:47 AM

Here's a cool little utility (cb.exe) to route output from a commandline app straight to the clipboard .. which can then be interrogated from within AU3 (thereby avoiding the need to bounce the info through a file)
;BOUNCING RESULTS THROUGH A FILE     $sExeListName = "c:\exelist.txt"     RunWait(@comspec & " /c dir *.EXE /s/b>" & $sExeListName,"",@SW_HIDE)     $sExeList = FileRead($sExeListName, FileGetSize($sExeListName))     FileDelete($sExeListName) ;CLEVERLY USING CB.EXE INSTEAD     RunWait(@comspec & " /c dir *.EXE /s/b|cb.exe","",@SW_HIDE)     $sExeList = ClipGet()


Have fun :D







#2 SlimShady

SlimShady

    AutoIt lover

  • Active Members
  • PipPipPipPipPipPip
  • 2,383 posts

Posted 04 June 2004 - 07:48 AM

Nice. Very nice.

#3 kalayaan

kalayaan

    Wayfarer

  • Active Members
  • Pip
  • 69 posts

Posted 04 June 2004 - 07:51 AM

this'll come in handy. :D

#4 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 04 June 2004 - 08:09 AM

How would you write the ClipGet to a txt file ?

#5 Guest_rathore_*

Guest_rathore_*
  • Guests

Posted 04 June 2004 - 08:34 AM

How would you write the ClipGet  to a txt file ?

to output to text file:

dir c:\windows > c:\dirlist.txt

to append:

dir c:\windows >> c:\dirlist.txt

#6 Chris_1013

Chris_1013

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 347 posts

Posted 04 June 2004 - 10:47 AM

What does this do that DirectTo.exe doesn't?

#7 trids

trids

    Hmmm .. and what have we here?

  • Active Members
  • PipPipPipPipPipPip
  • 1,004 posts

Posted 04 June 2004 - 12:47 PM

What does this do that DirectTo.exe doesn't?

Dunno till I see DirectTo.exe :D .. What / where is DirectTo.exe? Even Google doesn't appear to have heard of it. Care to share a link?

#8 Chris_1013

Chris_1013

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 347 posts

Posted 04 June 2004 - 01:12 PM

Ummm, best I can do you is a cut-n-paste of the e-mail Larry sent to the Yahoo Group a while back:

http://groups.yahoo.com/group/AutoItList/f...IL/DirectTo.zip

I have created a utility to direct %comspec% derived information into
the clipboard OR an Environment Variable that can be retrieved
through a subsequently run script... here is the readme text...

DirectTo.exe
-  A console app to use in a %comspec% session to pipe info
into the clipboard or into an "Environment Variable".

Usage
-  redirect to clipboard
....<stdout> | DirectTo.exe /c
-  redirect to Environment Variable and run App
....<stdout> | DirectTo.exe /e "VariableName" "File String To Run"

Examples

Dir | DirectTo.exe /c

Dir | DirectTo.exe /e OUTPUT "MyExe.exe MyArgument"



AutoIt Usage (Compiled AutoIt3)

If $CmdLine[0] = 1 Then
MsgBox(4096,"I got the Output",EnvGet("OUTPUT"))
Else
MsgBox(4096,"","Click OK to run DirectTo.exe test")

;WORD WRAP CRAPPED
RunWait(@COMSPEC & ' /c DIR | DirectTo.exe /e OUTPUT "' &
@ScriptFullPath & ' test"',"",@SW_HIDE)

EndIf


essentially the RunWait runs this... (on my PC)

cmd.exe /c DIR | DirectTo.exe /e OUTPUT "c:\DirectToTest.exe test"

which populates the environment var "OUTPUT" with the dir listing and
reruns my script so that I can play with EnvGet("OUTPUT")

Larry



#9 trids

trids

    Hmmm .. and what have we here?

  • Active Members
  • PipPipPipPipPipPip
  • 1,004 posts

Posted 04 June 2004 - 01:39 PM

Thanks Chris - and thanks Larry :D Now we have two to choose from!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users