Sign in to follow this  
Followers 0
ksmith247

Manually copy data from msgbox

9 posts in this topic

Small script pulls info from WMI on a remote PC then displays that info in a msgbox. It works fine but I would like to be able to manually copy that info and paste in an email or txt file, etc. versus a screenshot of the msgbox. Could I use something other than a msgbox to display my results to accomplish this?


Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Small script pulls info from WMI on a remote PC then displays that info in a msgbox. It works fine but I would like to be able to manually copy that info and paste in an email or txt file, etc. versus a screenshot of the msgbox. Could I use something other than a msgbox to display my results to accomplish this?

You must be passing a string to the message box so instead of

$Txt = "BlaBlaBla"
MsgBox(4096, "TEST", $Txt)

use

$Txt = "BlaBlaBla"
ClipPut($Txt)
MsgBox(4096, "TEST", $Txt)
to put it on the clipboard.

EDIT:

Or if You are using Multiple MSGBOXs then

ClipPut("")

ClipPut(ClipGet() & $Txt & @CRLF)

Edited by GEOSoft

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!"

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You could also use a Gui with an input box and make the desired text the default.

Edited by sccrstvn93

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

... It works fine but I would like to be able to manually copy that info and paste in an email or txt file, ...

You said manually?

Run this

MsgBox(0, 'The Msgbox Title', 'Some text here')

Then press Ctrl + C to copy the text. The press Ctrl + V to paste into your email or txt file to get the below result.

---------------------------

The Msgbox Title

---------------------------

Some text here

---------------------------

OK

---------------------------

:) Edited by MHz

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Does it just automatically copy the text of the msg box? Because i can't figure out how to highlight the text.

Edited by sccrstvn93

Share this post


Link to post
Share on other sites

You must be passing a string to the message box so instead of

$Txt = "BlaBlaBla"
MsgBox(4096, "TEST", $Txt)

use

$Txt = "BlaBlaBla"
ClipPut($Txt)
MsgBox(4096, "TEST", $Txt)
to put it on the clipboard.

EDIT:

Or if You are using Multiple MSGBOXs then

Thanks for the tip.

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites

Does it just automatically copy the text of the msg box? Because i can't figure out how to highlight the text.

Yes. It does copy automatically without highlighting. A little feature MS added in.

Share this post


Link to post
Share on other sites

Does it just automatically copy the text of the msg box? Because i can't figure out how to highlight the text.

Yes. In the example given the text is automatically copied to the clipboard prior to creating the msgbox. I have decided (until I find a better way) to use a msgbox with a flag 4 to give a Yes/No option. Clicking Yes results in copying the data, No will not.


Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

You said manually?

Run this

MsgBox(0, 'The Msgbox Title', 'Some text here')

Then press Ctrl + C to copy the text. The press Ctrl + V to paste into your email or txt file to get the below result.

:P

:) Just call me brain dead. Anyone have a smiley for :duhhhh: ???

Thanks MHz

Edited by ksmith247

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

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