Page 1 of 1

Dynamic clipboard paste within a macro

Posted: Wed Dec 06, 2006 6:58 pm
by bleblanc
Hi,

For a huge number of text chunks within the current file, I wrote a macro that saves each of them within a new file. For each new file created, the name must match the clipboard contents a the moment of the 'SaveAs' operation (F12).

It works fine for the first created file, but the problem is that all the subsequent files take the same name as the first one, overwriting each other. Obviously, at the moment of the macro recording, the string contained in the clipboard has been hardcoded instead of the 'CTRL+V' sequence.

Is there an escape sequence or something else that I could use instead of 'CTRL+V' in order to get a dymanic paste at the macro runtime?

Posted: Wed Dec 06, 2006 8:37 pm
by Bob Hansen
My experience with TextPad macros says NO.

Copy/Paste clipboard values are hard coded into the macros.

This is a technique that may/may not work for you .... make two macros.
The first one ends, you manually do the paste, then start a second macro that continues from that point.

The technique works, but it probably OK for infrequent, small quantity of actions. If you have multiple things to do, then this will be too much work.

I highly recommend using Macro Scheduler for all macros vs. using the TextPad macros. A big advantage is the ability to edit them. I use it with TextPad, and in some instances I use it to call a TextPad macro and continue.
Macro Scheduler info at http://www.mjtnet.com/macro_scheduler.htm

Did it using an awk script

Posted: Thu Dec 07, 2006 2:13 am
by bleblanc
Hi Bob,

Forecasting the dead-end, I wrote a tiny AWK script and ran it on a Linux box. It worked well and ligthning fast! 8)

Thank you anyway for taking care. It's well appreciated.

Posted: Mon Oct 08, 2007 8:06 am
by fuzzbug
Bob Hansen wrote:I highly recommend using Macro Scheduler for all macros vs. using the TextPad macros. A big advantage is the ability to edit them. I use it with TextPad, and in some instances I use it to call a TextPad macro and continue.
Macro Scheduler info at http://www.mjtnet.com/macro_scheduler.htm
I was having the same problem as bleblanc and also I have been frustrated by the inability to edit macros. So thank you Bob.