Dynamic clipboard paste within a macro

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
bleblanc
Posts: 2
Joined: Wed Dec 06, 2006 4:54 pm

Dynamic clipboard paste within a macro

Post 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?
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post 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
Hope this was helpful.............good luck,
Bob
bleblanc
Posts: 2
Joined: Wed Dec 06, 2006 4:54 pm

Did it using an awk script

Post 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.
fuzzbug
Posts: 14
Joined: Sun Oct 07, 2007 10:47 pm
Location: Watford, UK

Post 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.
Post Reply