Jump to content
Macro Express Forums

Set clipboard text


Recommended Posts

I am trying to figure out a more reliable way to type text. Currently, I have blocks of text set to variables and I am using the textype function. While this works most of the time, if I have a longer macro and/or hardware/software lag issues, I have found that typing one keystroke at a time can be unreliable. I was thinking that a better solution might be to set the clipboard text to my variable and then use the clipboard paste function. Is there a way to do this? I am not sure if any of the clipboard functions in MEX Pro do this. I am want to do something like 'Variable Set String from Clipboard" -- only the reverse of that.

 

Thanks in advance.

Link to comment
Share on other sites

Variable Modify String [Option 2 tab] / Save to Clipboard is where that function is "hidden" in ME3.

Test carefully -- I have sometimes had bad results in pasting via the clipboard. I don't know but what it is a timing issue, like Copy to Clipboard which takes an unpredictable amount of time to complete???

You can try setting the keyboard delay time which might make text typing more reliable. Generally I have found 30ms to be more than enough.

Link to comment
Share on other sites

There are macro commands to copy to and from the clipboard. Try something like this:

Variable Set String %Temp% to "This is a test."
Variable Modify String: Save %Temp% to the clipboard

The Text Type command has an option to "Use Clipboard and Paste Text". By default this is set to "Simulate Keystrokes". Using this option you don't even need to use the Variable Modify String command.

 

Sometimes I want to keep the text on the clipboard so I have my macro save and restore it, like this:

Variable Set String %ClipboardSave% from the clipboard contents // Save the content of the clipboard
 
Variable Set String %Temp% to "This is a test."
Variable Modify String: Save %Temp% to the clipboard
 
Variable Modify String: Save %ClipboardSave% to the clipboard // Restore the content of the clipboard

Link to comment
Share on other sites

Variable Modify String [Option 2 tab] / Save to Clipboard is where that function is "hidden" in ME3.

Test carefully -- I have sometimes had bad results in pasting via the clipboard. I don't know but what it is a timing issue, like Copy to Clipboard which takes an unpredictable amount of time to complete???

You can try setting the keyboard delay time which might make text typing more reliable. Generally I have found 30ms to be more than enough.

 

 

 

There are macro commands to copy to and from the clipboard. Try something like this:

Variable Set String %Temp% to "This is a test."
Variable Modify String: Save %Temp% to the clipboard

The Text Type command has an option to "Use Clipboard and Paste Text". By default this is set to "Simulate Keystrokes". Using this option you don't even need to use the Variable Modify String command.

 

Sometimes I want to keep the text on the clipboard so I have my macro save and restore it, like this:

Variable Set String %ClipboardSave% from the clipboard contents // Save the content of the clipboard
 
Variable Set String %Temp% to "This is a test."
Variable Modify String: Save %Temp% to the clipboard
 
Variable Modify String: Save %ClipboardSave% to the clipboard // Restore the content of the clipboard

Thank you both!

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...
 Share

×
×
  • Create New...