can vbscript retrieve the clipboard contents ?

I would like to sort it and paste it to back into an active document

Re: Get clipboard contents for sorting by ekkehard

ekkehard
Fri Aug 19 16:55:10 CDT 2005

Jon Paal wrote:
> can vbscript retrieve the clipboard contents ?

no, but

> I would like to sort it and paste it to back into an active document

perhaps the object you use to work with the document can.
For example, the IE window gives access to the clipboard.

value = window.clipboardData.getData( "Text" )
window.clipboardData.setData "Text", value




Re: Get clipboard contents for sorting by Jon

Jon
Fri Aug 19 22:21:37 CDT 2005

i'm testing this with the crimson editor, how do I define the window object
?


"ekkehard.horner" <ekkehard.horner@arcor.de> wrote in message
news:4306553f$0$28537$9b4e6d93@newsread2.arcor-online.net...
> Jon Paal wrote:
>> can vbscript retrieve the clipboard contents ?
>
> no, but
>
>> I would like to sort it and paste it to back into an active document
>
> perhaps the object you use to work with the document can.
> For example, the IE window gives access to the clipboard.
>
> value = window.clipboardData.getData( "Text" )
> window.clipboardData.setData "Text", value
>
>
>



Re: Get clipboard contents for sorting by DJP

DJP
Fri Aug 19 23:19:16 CDT 2005


When you are programming for Internet Explorer, you don't have to define a
the Window object. It is intrinsic to IE (and other browsers also I think).
However, it is not available to the Windows scripting host (eg. vbs files).
You say that you want to "paste it to back into an active document". If your
active document is within IE, then you won't have a problem with the Window
object.

"Jon Paal" <Jon nospam Paal @ everywhere dot com> wrote in message
news:%23DkoIZTpFHA.2504@tk2msftngp13.phx.gbl...
> i'm testing this with the crimson editor, how do I define the window
> object ?
>
>
> "ekkehard.horner" <ekkehard.horner@arcor.de> wrote in message
> news:4306553f$0$28537$9b4e6d93@newsread2.arcor-online.net...
>> Jon Paal wrote:
>>> can vbscript retrieve the clipboard contents ?
>>
>> no, but
>>
>>> I would like to sort it and paste it to back into an active document
>>
>> perhaps the object you use to work with the document can.
>> For example, the IE window gives access to the clipboard.
>>
>> value = window.clipboardData.getData( "Text" )
>> window.clipboardData.setData "Text", value
>>
>>
>>
>
>



Re: Get clipboard contents for sorting by Jon

Jon
Sat Aug 20 01:24:20 CDT 2005

It's not in IE , it's in a separate application like notepad



"DJP" <djp@snotmail.com> wrote in message
news:8byNe.5151$FA3.4471@news-server.bigpond.net.au...
>
> When you are programming for Internet Explorer, you don't have to define a
> the Window object. It is intrinsic to IE (and other browsers also I
> think). However, it is not available to the Windows scripting host (eg.
> vbs files). You say that you want to "paste it to back into an active
> document". If your active document is within IE, then you won't have a
> problem with the Window object.
>
> "Jon Paal" <Jon nospam Paal @ everywhere dot com> wrote in message
> news:%23DkoIZTpFHA.2504@tk2msftngp13.phx.gbl...
>> i'm testing this with the crimson editor, how do I define the window
>> object ?
>>
>>
>> "ekkehard.horner" <ekkehard.horner@arcor.de> wrote in message
>> news:4306553f$0$28537$9b4e6d93@newsread2.arcor-online.net...
>>> Jon Paal wrote:
>>>> can vbscript retrieve the clipboard contents ?
>>>
>>> no, but
>>>
>>>> I would like to sort it and paste it to back into an active document
>>>
>>> perhaps the object you use to work with the document can.
>>> For example, the IE window gives access to the clipboard.
>>>
>>> value = window.clipboardData.getData( "Text" )
>>> window.clipboardData.setData "Text", value
>>>
>>>
>>>
>>
>>
>
>



Re: Get clipboard contents for sorting by Miyahn

Miyahn
Sat Aug 20 02:09:25 CDT 2005

"Jon Paal" wrote in message news:utcJP$UpFHA.2976@TK2MSFTNGP12.phx.gbl
> It's not in IE , it's in a separate application like notepad

Will this help?

Subject: Re: clipboard
Date: Thu, 4 Aug 2005 02:05:26 +0900
news:#hBgn0EmFHA.3656@TK2MSFTNGP09.phx.gbl

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2005 - Dec 2005)
HQF03250@nifty.ne.jp


Re: Get clipboard contents for sorting by ekkehard

ekkehard
Sat Aug 20 04:58:08 CDT 2005

Jon Paal wrote:

> i'm testing this with the crimson editor, how do I define the window object
> ?
>
>
> "ekkehard.horner" <ekkehard.horner@arcor.de> wrote in message
> news:4306553f$0$28537$9b4e6d93@newsread2.arcor-online.net...
>
>>Jon Paal wrote:
>>
>>>can vbscript retrieve the clipboard contents ?
>>
>>no, but
>>
>>
>>>I would like to sort it and paste it to back into an active document
>>
>>perhaps the object you use to work with the document can.
>>For example, the IE window gives access to the clipboard.
>>
>> value = window.clipboardData.getData( "Text" )
>> window.clipboardData.setData "Text", value
>>
Based on a quick look at the crimson editor, I *think* that you'll
have to

Specify a file - let's say "...\ce_clpb.txt"

Write a VBScript programm that
reads the content of ce_clpb.txt
sorts the content according to your needs
writes the sorted content to ce_clpb.txt

Put this script into the crimsom tool menue

Record a crimson macro that
saves the current selection to ce_clpb.txt
calls the script
replaces the current selection with the content of ce_clpb.txt

Re: Get clipboard contents for sorting by ggrothendieck

ggrothendieck
Sat Aug 20 12:59:14 CDT 2005


Jon Paal wrote:
> can vbscript retrieve the clipboard contents ?
>
> I would like to sort it and paste it to back into an active document

Note that jscript has an array sort method but vbscript does not
(although vbscript can call jscript).


Re: Get clipboard contents for sorting by James

James
Sat Aug 20 13:25:07 CDT 2005

"Jon Paal" <Jon nospam Paal @ everywhere dot com> wrote in message
news:uHOI86PpFHA.3760@TK2MSFTNGP10.phx.gbl...
> can vbscript retrieve the clipboard contents ?
>
> I would like to sort it and paste it to back into an active document

This thread contains some very useful information:

http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_thread/thread/946ff5d0c26b12b6/49060196c0205131

Basically, you could use something like this:

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sText = CreateObject("htmlfile").parentWindow._
clipboardData.getData("Text")

'Your sorting code goes here

With Createobject("InternetExplorer.Application")
.navigate "about:blank"
Do Until .readyState = 4 : Wscript.Sleep 10 : Loop
.document.parentWindow.clipboardData.setData "Text", sText
End With
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Re: Get clipboard contents for sorting by Jon

Jon
Sat Aug 20 14:04:54 CDT 2005

thanks , I'll look into that


<ggrothendieck@gmail.com> wrote in message
news:1124560754.080126.177270@g47g2000cwa.googlegroups.com...
>
> Jon Paal wrote:
>> can vbscript retrieve the clipboard contents ?
>>
>> I would like to sort it and paste it to back into an active document
>
> Note that jscript has an array sort method but vbscript does not
> (although vbscript can call jscript).
>



Re: Get clipboard contents for sorting by Jon

Jon
Sat Aug 20 14:09:11 CDT 2005

thanks for looking into this.

I think I'm going to go with the approach suggested by Miyahn and have the
vbscript run an hta app to retrieve the clipboard , sort it , and refill the
clipboard.


"ekkehard.horner" <ekkehard.horner@arcor.de> wrote in message
news:4306feb1$0$28524$9b4e6d93@newsread2.arcor-online.net...
> Jon Paal wrote:
>
>> i'm testing this with the crimson editor, how do I define the window
>> object ?
>>
>>
>> "ekkehard.horner" <ekkehard.horner@arcor.de> wrote in message
>> news:4306553f$0$28537$9b4e6d93@newsread2.arcor-online.net...
>>
>>>Jon Paal wrote:
>>>
>>>>can vbscript retrieve the clipboard contents ?
>>>
>>>no, but
>>>
>>>
>>>>I would like to sort it and paste it to back into an active document
>>>
>>>perhaps the object you use to work with the document can.
>>>For example, the IE window gives access to the clipboard.
>>>
>>> value = window.clipboardData.getData( "Text" )
>>> window.clipboardData.setData "Text", value
>>>
> Based on a quick look at the crimson editor, I *think* that you'll
> have to
>
> Specify a file - let's say "...\ce_clpb.txt"
>
> Write a VBScript programm that
> reads the content of ce_clpb.txt
> sorts the content according to your needs
> writes the sorted content to ce_clpb.txt
>
> Put this script into the crimsom tool menue
>
> Record a crimson macro that
> saves the current selection to ce_clpb.txt
> calls the script
> replaces the current selection with the content of ce_clpb.txt



Re: Get clipboard contents for sorting by Jon

Jon
Sat Aug 20 14:12:56 CDT 2005

I think this is the solution I need.

I will have crimson editor run a vbscript ,and have the vbscript run the hta
app to retrieve the clipboard sort it and refill the clipboard.

if I can figure out how to get the vbscript to wait until the hta is closed
then the vbscript can finish by pasting back into the active crimson window
.

thanks


"Miyahn" <HQF03250@nifty.ne.jp> wrote in message
news:eLATCaVpFHA.2916@TK2MSFTNGP14.phx.gbl...
> "Jon Paal" wrote in message news:utcJP$UpFHA.2976@TK2MSFTNGP12.phx.gbl
>> It's not in IE , it's in a separate application like notepad
>
> Will this help?
>
> Subject: Re: clipboard
> Date: Thu, 4 Aug 2005 02:05:26 +0900
> news:#hBgn0EmFHA.3656@TK2MSFTNGP09.phx.gbl
>
> --
> Miyahn (Masataka Miyashita) JPN
> Microsoft MVP for Microsoft Office - Excel(Jan 2005 - Dec 2005)
> HQF03250@nifty.ne.jp
>



Re: Get clipboard contents for sorting by Michael

Michael
Sat Aug 20 15:07:02 CDT 2005

> if I can figure out how to get the vbscript to wait until the hta is
> closed then the vbscript can finish by pasting back into the active
> crimson window .


If you launch the HTA via WshShell.Run, then pass True as the 3rd argument
of .Run to wait for the HTA to exit.


--
Michael Harris
Microsoft MVP Scripting





Re: Get clipboard contents for sorting by Jon

Jon
Sat Aug 20 15:33:55 CDT 2005

excellent resource.

This thread just keeps getting better and better :)


"James Whitlow" <jwhitlow@letter.com> wrote in message
news:%23Y1g$RbpFHA.1968@TK2MSFTNGP14.phx.gbl...
> "Jon Paal" <Jon nospam Paal @ everywhere dot com> wrote in message
> news:uHOI86PpFHA.3760@TK2MSFTNGP10.phx.gbl...
>> can vbscript retrieve the clipboard contents ?
>>
>> I would like to sort it and paste it to back into an active document
>
> This thread contains some very useful information:
>
> http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_thread/thread/946ff5d0c26b12b6/49060196c0205131
>
> Basically, you could use something like this:
>
> '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sText = CreateObject("htmlfile").parentWindow._
> clipboardData.getData("Text")
>
> 'Your sorting code goes here
>
> With Createobject("InternetExplorer.Application")
> .navigate "about:blank"
> Do Until .readyState = 4 : Wscript.Sleep 10 : Loop
> .document.parentWindow.clipboardData.setData "Text", sText
> End With
> '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>



Re: Get clipboard contents for sorting by Jon

Jon
Sat Aug 20 17:09:31 CDT 2005

I can hardly believe how much I have learned from this one thread


"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:e$NX5KcpFHA.1204@TK2MSFTNGP12.phx.gbl...
>> if I can figure out how to get the vbscript to wait until the hta is
>> closed then the vbscript can finish by pasting back into the active
>> crimson window .
>
>
> If you launch the HTA via WshShell.Run, then pass True as the 3rd argument
> of .Run to wait for the HTA to exit.
>
>
> --
> Michael Harris
> Microsoft MVP Scripting
>
>
>
>