Re: Grabbing a string that's already been created in one .vbs file and doing stuff with it in a second .vbs file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Larry" <larry328NOSPAM@xxxxxxx> wrote in message
news:OAbxYr45JHA.480@xxxxxxxxxxxxxxxxxxxxxxx

The script you've linked me to, by which a string is transferred to the
Clipboard, won't help me. I already know how to put a string in the
Clipboard, and in fact, my first .vbs file begins with the desired text
already in the clipboard, and I make it into a string.

Here's the idea. I have text in the clipboard, which I'm planning to paste
somewhere. But then I realize that before I can paste it, I've got to copy
something else to the clipboard. I don't want to have the initial text
wiped
out before I've had the chance to paste it, so I make it into a string
for
the interim. Then, after I've done the other operation which has put other
text in the clipboard, I want to retrieve the string I created, and turn
it
back into Clipboard contents so that I can paste it.

The problem is that by the time I get to that last step, the .vbs file
where
the string was created is no longer running since I have switched to a
different application where I was performing other tasks. Therefore the
retrieval of the string must be done from a second .vbs file. So my
question is, having created a string in .vbs file 1, how do I then
retrieve
that string using .vbs file 2?

To sum up:

1. In .vbs file 1, Clipboard contents is made into string sText.

2. Then I do other stuff in another application, involving putting some
other contents into Clipboard.

3. (This is the part I need help with.) Now I want to run .vbs file 2,
with
which I retrieve sText from .vbs file 1, and turn it into Clipboard
contents
so that I can paste it.

Your explanation makes it a lot clearer. Using the steps you posted, here is
a simple solution:

1. In .vbs file 1, Clipboard contents is made into string sText, then write
sText into a temp file.

2. Then I do other stuff in another application, involving putting some
other contents into Clipboard.

3. Run vbs file 2 to retrieve sText from the temp file and to turn it into
Clipboard
contents so that I can paste it.


.



Relevant Pages

  • Re: Inserting a string into an application
    ... Well, VBscript has a lot in common with VBA, and VBA has the typetext ... A string has already been created, ... Clipboard, and then it is pasted into whatever application is the active ... Since the sText string is already created in the ...
    (microsoft.public.scripting.vbscript)
  • Re: Grabbing a string thats already been created in one .vbs file and doing stuff with it in a secon
    ... string, and then turns the string into a Volatile Environment item in the ... 'make string out of text in clipboard ... Set oWSH = CreateObject ... And here's the second .vbs file, which turns the item that's been reserved ...
    (microsoft.public.scripting.vbscript)
  • Re: Grabbing a string thats already been created in one .vbs file and doing stuff with it in a secon
    ... Clipboard, and in fact, my first .vbs file begins with the desired text ... and I make it into a string. ... Clipboard contents is made into string sText. ...
    (microsoft.public.scripting.vbscript)
  • Re: Split passwords
    ... You generate a string of random numbers and HMAC the string ... > Once I cut it into the clipboard, I have to be sure it gets erased. ... floppy drive or support those little USB drives, ... I have a feeling that I'm going to be the only one using this scheme, ...
    (sci.crypt)
  • Re: need code to copy paste extended
    ... The clipboard isn't being utilized so there is no need for the forms object ... Dim strTrans As String ... Dim objDoc As Word.Document ... Dim strPlus As String ...
    (microsoft.public.word.vba.general)