Page 1 of 1 1
Topic Options
#36165 - 2003-02-07 05:39 PM dump to clipboard?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Ok, I searched and found many post on how to read the clipboard in windows but I would like to dump some text to the clipboard.

Is that possible? If so how?

Thanks,
Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#36166 - 2003-02-07 08:08 PM Re: dump to clipboard?
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Rocco...
Just found this and thought it might give you some insight...
Cheers...

The Clipboard Object
_________________________
We all live in a Yellow Subroutine...

Top
#36167 - 2003-02-07 08:42 PM Re: dump to clipboard?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
That's all G(r)eek to me.

Would the CreateObject() or GetObject(), functions be of any value?

I have no idea how to do com stuff.
I'm going to go look in the COM forum to see if I can find any leads.

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#36168 - 2003-02-07 08:51 PM Re: dump to clipboard?
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
I hear you...
Maybe some of the WiSHy WaSHy WiZards can help out?
_________________________
We all live in a Yellow Subroutine...

Top
#36169 - 2003-02-07 08:57 PM Re: dump to clipboard?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
code:
Dim $clip, $strText
$clip = CreateObject('WshExtra.Clipboard')
$clip.Copy='Hello, world'
$strText = $clip.Paste()
? $strText

quote:

You can download wshextra.dll from the Code Library on the Windows Scripting Solutions Web site at http://www.winscriptingsolutions.com



[ 07. February 2003, 21:17: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#36170 - 2003-02-07 09:15 PM Re: dump to clipboard?
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Good one... [Big Grin]
_________________________
We all live in a Yellow Subroutine...

Top
#36171 - 2003-02-07 09:23 PM Re: dump to clipboard?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Hummmm,

I do not get the 'Hello, world' output but the last thing I acually 'Ctrl+C' from the keyboard.
??

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#36172 - 2003-02-07 09:25 PM Re: dump to clipboard?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Maye it's
code:
 $clip.Copy('Hello, world')

Just ported the VB code on that link.
_________________________
There are two types of vessels, submarines and targets.

Top
#36173 - 2003-02-07 09:28 PM Re: dump to clipboard?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Duh, WooHoo that did it!

I just wit=sh there was a way to do without registering that dll.

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#36174 - 2003-02-07 09:47 PM Re: dump to clipboard?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Well bummer.

After further testing it seems that it doesn't acually get copied to the 'clipboard'. Cause when I do the [ $clip.Copy('Hello, world') ] and then try and 'Ctrl+V' into another app it don't work.

[Frown]

Rocco
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#36175 - 2003-02-07 09:51 PM Re: dump to clipboard?
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Rocco...
Share your specs with us...maybe there's a way to get there from here if we had more info...
Cheers... [Smile]
_________________________
We all live in a Yellow Subroutine...

Top
#36176 - 2003-02-07 10:02 PM Re: dump to clipboard?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Yea that would help wouldn't it...

I have a scipt that pulls a PC name out of an INI file and displays it in a MessageBox(). There is no way to select the text in the MessageBox. I wanted to see if there is a way to push it to the clipboard too so all you have to do is 'Ctrl+V' wherever you need.

Does that make sence. Maybe there is a different route I need to take?

I guess I could unhide the cmd window and copy paste from there, but I don't like it up when it doesn't show anything to begin with.

Rocco

{I may just make a form to open the app I need and push a variable to it from within the script.}

[ 07. February 2003, 22:06: Message edited by: Rocco Capra ]
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#36177 - 2003-02-07 10:09 PM Re: dump to clipboard?
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Huh?
quote:
There is no way to select the text in the MessageBox.
Is this a KiX messagebox()?
How does the text get into the messagebox?
_________________________
We all live in a Yellow Subroutine...

Top
#36178 - 2003-02-07 10:19 PM Re: dump to clipboard?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
code:
$RETRY=MessageBox('The most recent logged on PC for:'+@CRLF+@CRLF+
'[ '+Ucase($USER)+' ] = [ '+Ucase($COMPUTER)+' ]'+@CRLF+@CRLF+
'Do you want to look for another?',
'PCName from UserName',68)

_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
#36179 - 2003-02-08 12:26 AM Re: dump to clipboard?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Am I missing something? Why would you need to select the text in the MessageBox()? I mean, that your KiX script had to put it there, so then KiX would already have the message.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#36180 - 2003-02-08 04:07 PM Re: dump to clipboard?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I think the problem is more about how to put some text (e.g. the computer name) into the clipboard so that you can then paste it into something else. And yes, you cannot just select text inside the messagebox to do this. That's why you need some other way.

[ 11. February 2003, 04:24: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#36181 - 2003-02-09 02:56 PM Re: dump to clipboard?
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I you have to register a DLL, might I also offer the AutoItX component? It has clipboard put and get methods and of course offers a lot of functionality in controlling windows.
Top
#36182 - 2003-02-10 02:13 PM Re: dump to clipboard?
Rocco Capra Offline
Hey THIS is FUN
*****

Registered: 2002-04-01
Posts: 380
Loc: Mansfield Ohio
Jens nailed it.

Yeah Chris I'm gonna try AutoItX next.

Oh well, There still should be a way to put something in the windows clipboard to be able to use it in another app after the script has run.

Thanks all,
Rocco

[ 10. February 2003, 14:17: Message edited by: Rocco Capra ]
_________________________
I Love this board!! -------------------- My DEV PC is running KIX 4.22 WINXP Pro

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 847 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.076 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org