"Larry" <larry328NOSPAM@xxxxxx> wrote in message
news:OAbxYr45JHA.480@xxxxxx
>
> 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.