Jump to content
Macro Express Forums

Variable contents to clipboard?


Recommended Posts

How do I get the contents of a string variable into the clipboard for pasting into my target document? There must be a way, but I seem to be in a brain fog.

 

Just paste the string variable in directly - no need for clipboard. Here's a trivial example:

 

Variable Set String MyVariable1 to "Test string"

Window Activate: Textpad

Text Type (Simulate Keystrokes): Pasted result = %MyVariable1%

Macro Return

 

<VARIABLE SET STRING Option="\x00" Destination="MyVariable1" Value="Test string"/>
<WINDOW ACTIVATE Title="Textpad" Exact_Match="FALSE" Wildcards="FALSE"/>
<TEXT TYPE Action="0" Text="Pasted result = %MyVariable1%"/>
<MACRO RETURN/>

 

Having opened a blank document in my text editor, when I run the above I get the following typed in:

Pasted result = Test string

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Thanks Jeff. I found this 10 seconds before I received your reply. I first thought putting the command under Clipboard commands was more logical. After all, the variable is not "modified." But there are many analogous commands under "Variable Modify String" which copy but don't change the string, so I see how it makes sense--even if the title of the command group is a tad misleading to the slow-witted among us. :)

Link to comment
Share on other sites

Thanks Terry.

 

That is certainly the best way. I had even looked at the help for Text Type to see whether this would be possible, but I was in too much of a hurry. I see now that it is plainly documented there.

 

I have only been working with this new Macro Express Pro for a couple of days. I sure do like it. My upgrade purchase is coming right up.

 

Just paste the string variable in directly - no need for clipboard. Here's a trivial example:

 

Variable Set String MyVariable1 to "Test string"

Window Activate: Textpad

Text Type (Simulate Keystrokes): Pasted result = %MyVariable1%

Macro Return

 

<VARIABLE SET STRING Option="\x00" Destination="MyVariable1" Value="Test string"/>
<WINDOW ACTIVATE Title="Textpad" Exact_Match="FALSE" Wildcards="FALSE"/>
<TEXT TYPE Action="0" Text="Pasted result = %MyVariable1%"/>
<MACRO RETURN/>

 

Having opened a blank document in my text editor, when I run the above I get the following typed in:

Pasted result = Test string

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...