Hi guys anybody can help me to build a simple macro to copy and paste? i certainly cannot make it possible
This is what i wanna do. i got 4 lines that i want copy 1 by 1 and when i press a combination of keys make the program paste them with a tab Key between them
Form example
Name (copy)
Address (copy)
Postal Code (copy)
Number (copy)
and when i press the combination keys
Name [ tab key ] Address [ tab key ] Postal Code [ tab key ] Number [ tab key ]
I'm sure there's a more elegant way to do this, but this should work. Just assign it a hotkey.
By the way, you can think of the action "Delete Past Clipboard 0" as meaning "Delete the current clipboard value, then set the clipboard to the previous clipboard value."
If you activate the Clipboard History Switcher, you can actually watch it work in real time, if you care.
There many ways to "skin a cat" using Keyboard Maestro. @DanThomas has given you a very good one.
Here is an alternate approach.
###Are you pasting into a web form?
If so, then you might consider this, which eliminates any issues with UI navigation (like if the order of the fields on the page changes).
Manual Steps (but could be automated if I knew more about your workflow)
Select and copy the lines manually (could be automated)
Go to the web page, and open the web form
Trigger the macro
.
Macro does this
Search Clipboard and set variables to use in form later
* Search for Regular Expression: (.+)\n(.+)\n(.+)\n(.+)
* Set KM variables for each capture group (each line)
Set the web form fields using these variables
You will need to enter the "Set Field" in each of the "Set Google Chrome Field" Actions.
The easiest way to do this is open the web form, and then go to the KM macro, and click on the "Google Chrome" dropdown to see a list of form field on the web page.
If you are using a web form and would like more help, please provide more details of your complete workflow, including which apps and browser you are using.
It makes a difference whether the āTab keyā is intended to switch between fields or as a tab character in a text document.
In the latter case, you can simply do something like this:
Insert Text by Pasting: %PastClipboard%3%%Tab%%PastClipboard%2%%Tab%%PastClipboard%1%%Tab%%PastClipboard%0%
If the Tab character is to switch fields, then it must be typed individually, not pasted altogether. You could do the same as above with Insert Text by Typing. Depending on the size of the text, that may be fine.
Otherwise a solution like @DanThomas posted will be necessary, although if you are using all Insert Text by Typing (like Dan does), then there is no need to read them in to variables first, you can just use the %PastClipboard%1% tokens to extract each one. If you are Insert Text by Pasting, then since the clipboard positions move around, it is necessary to read them out as shown and then paste each in turn.
And @JMichaelTXās solution is the direction you want if it is a well behaved web page.
Context makes all the difference, so itās good to always be clear about what you want to be doing.