Macro . Copy/Paste . Filename - Not working?

General questions about using TextPad

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

Post Reply
redcairo
Posts: 39
Joined: Fri May 06, 2011 6:34 am

Macro . Copy/Paste . Filename - Not working?

Post by redcairo »

I'm trying to work out a macro that does the following. All but one piece is set.

* selects and COPIES a piece of content in a file (which is to be used as a filename) later
* selects a larger group of text content in that file (which is to be saved as a new file)
* does 'save as' and clicks 'selection only' box
* pastes in the filename from buffer and adds '.xml' to it
* saves and then closes the file
* does this with the next line/block.

Everything is working great except one thing not working at all. :-(

When I tell it to paste the filename, it does not use and/or have what is in my copy buffer. (Even when I do it manually to test, so I know it IS in my copy buffer.) Rather, it puts in whatever filename was used in the macro I saved. So it just keeps overwriting the same file every time.

I thought since 'paste' is something that a macro can remember, that if I had it 'paste' in the filename (and I'd arrange my content so it could copy or cut it out of the doc first, so it had it in buffer), I could just do "paste" for the filename. Yet the macro is clearly remembering the filename instead of the 'function/action' that creates the filename.

I'm so frustrated now. Surely there is a way to have a custom filename if save-as is part of a macro??

Any help would be SO appreciated. Thanks ever so much.

Best,
PJ
redcairo
Posts: 39
Joined: Fri May 06, 2011 6:34 am

Post by redcairo »

If there is another forum this should be in, I'd hugely appreciate a tip. I couldn't find one that seemed right and the search results didn't lead to anything to help with this.

Best,
PJ
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

As you say, if you record a macro that performs File | Save As..., TextPad records the saved file name, not the action that enters it. I don't know a way to obtain the behaviour you require. You might consider using an external automation application.
Post Reply