Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: "James Whitlow" <jwhitlow.60372693@xxxxxxxxxxxxx>
- Date: Wed, 10 Jun 2009 17:29:39 -0500
"Larry" <larry328NOSPAM@xxxxxxx> wrote in message
news:%23o%23lYih6JHA.1424@xxxxxxxxxxxxxxxxxxxxxxx
James,
It works!
Here's the first .vbs file, which turns the clipboard contents into a
string, and then turns the string into a Volatile Environment item in the
Registry:
Dim oHtml, sText
Set oHtml = CreateObject("htmlfile")
'make string out of text in clipboard
sText = oHtml.parentwindow.clipboardData.getData("text")
Set oWSH = CreateObject("WScript.Shell")
oWSH.Environment("Volatile").Item("zzTestVar") = sText
And here's the second .vbs file, which turns the item that's been reserved
or saved (I don't know the right word) in the Registry into a string, and
then puts the string in the Clipboard and pastes the Clipboard contents:
Dim sText
Set oWSH = CreateObject("WScript.Shell")
sText = oWSH.Environment("Volatile").Item("zzTestVar")
' Put string into Clipboard and paste Clipboard contents
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.ClipPut(sText)
oWSH.SendKeys"^v"
And this works noticeably faster than extracting saved text from a
tempfile.
But even more than the increased speed, I like the economy of it. It's
great
to find out that the WSH and Windows have this built in capacity to save
an
item in the system which can be extracted at any time.
The only further refinement, which would be a luxury, not a necessity,
would
be if this could be done with formatted text.
If I read your previous message correctly, you are using Windows 98, is
this correct?
.
- Follow-Ups:
- References:
- Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: Larry
- Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: Pegasus [MVP]
- Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: Larry
- Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: Pegasus [MVP]
- Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: Larry
- Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: James Whitlow
- Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: Larry
- Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: James Whitlow
- Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- From: Larry
- Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- Prev by Date: Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- Next by Date: Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- Previous by thread: Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- Next by thread: Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file
- Index(es):
Relevant Pages
|