Total novice here trying out Keyboard Maestro before ultimately purchasing. I am trying to create an action that replaces a comma plus a space by an Enter/Return. I have managed to copy the text, open Microsoft Word, paste the text, but I can't seem to find out how to remove the comma and space, and then replace it by an Enter/Return. My idea is to then copy the result, open my label printer software and paste the text, so that it will be ready to print.
Any suggestion on how to do that? If you know of a more efficient way to do this without opening a text processing application, that would also be very welcome.
Here's a demo macro for you to explore. The two red-coloured actions are there just for when I was testing so you can just delete them.
The macro in essence takes the clipboard contents and uses a regular expression replacement action to perform the reformatting as you required, leaving the result in the clipboard - ready to be pasted into your label software.
To run the macro, just enable it. I've assign a hot key of F5 to it - you can change that to something that suits you better.
You could extend the macro to do a Copy at the start (assuming you have some text selected already) and a Paste at the end to get the reformatted text into your label s/w. But I leave that to you.
Hopefully, this will point you in the right direction but in any case let us know how you get on!
Thank you so much for your help. I've come to realise that I need some more reading and practice before really getting started. I understand the basics and was hoping to learn along the way, but it probably doesn't help that I have no programming experience either.
I will bookmark this page and get back to it once I understand macros and all KM's features a little bit better. I'm pretty sure I will then be able to solve my issue. Thank you once again.
Thank you for your response. The single line address is in a PDF file, not in Word. I only used Word as a text processor in order to change the formatting, since I didn't know about the regular expression action that doesn't require a text processor. After copying, the text should be pasted in Dymo Label software.
The macro as you sent it does not seem to do anything for me. It does not even copy the selected text (when I paste manually, some previously copied text is pasted).
In order to paste something in Dymo Label, I guess a step 'Activate Dymo' and then a mouse click in the text field are required before pasting. But when I add those steps, still nothing happens.