Write macro to save copy as with date in filename

General questions about using TextPad

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

Post Reply
rechmbrs
Posts: 7
Joined: Wed Nov 03, 2004 9:50 pm

Write macro to save copy as with date in filename

Post by rechmbrs »

Can someone help me write a Save-CopyAs macro that inserts the date/time in the filename? I know zero about macros.

Thanks,
RON C
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

This can be done easily with Macro Scheduler from MJT Net.

And syntax files are available to do editing in TextPad.
Hope this was helpful.............good luck,
Bob
rechmbrs
Posts: 7
Joined: Wed Nov 03, 2004 9:50 pm

Post by rechmbrs »

Can't the macro language in TP do it? Is there a freeware equilvalent to Macro Scheduler?

RON C :D
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

You could use TextPad macro to insert Date, Time into document.
Format it into a filename format and then copy it to clipboard.
Then delete section inserted into the document.
Then you could save file and paste filename from clipboard.

Sounds good, except.......when you play back the macros, the clipboard contents becomes hardcoded in the macro. The macro cannot adapt to the current clilpboard contents. So you will always have the date entered that matches the date you recorded the macro.

Try Macro Scheduler for free trial period. Similar terms to TextPad.
Hope this was helpful.............good luck,
Bob
Grizzly
Posts: 14
Joined: Thu Aug 14, 2003 9:23 pm

Write macro to save copy as with date in filename

Post by Grizzly »

I've found if you create a macro inside a document that has already been saved, then the clipboard contents won't get hard coded inside the macro.

I don't have a clue how one would insert the date and time into the title via a macro but maybe this will help get past the hard coded information from the clipboard. I hope. :o
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Will look something like this:

Macro contents:
==================
CTL-END to go to end of page
ENTER to advance one line
Edit, Insert, Short Date for filename trailer
Replace "/" with nothing for filename trailer
Home to get to start of line.
Type FileName_, End, .Suffix to surround date with filename and extension, like the following.

FileName_1152004.txt

Now select line, Copy to Clipboard.
Now delete line.
File,Save As.
Paste from clipboard into File name location.
ENTER to Save.

Macro done
=====================
Perhaps it may be necessary to include the Path at the front of the core filename.
Hope this was helpful.............good luck,
Bob
Grizzly
Posts: 14
Joined: Thu Aug 14, 2003 9:23 pm

Post by Grizzly »

Bob, you are just too cool for words. <grin>
Seriously, I sure hope the original poster for this question is still following the link.
rechmbrs
Posts: 7
Joined: Wed Nov 03, 2004 9:50 pm

Post by rechmbrs »

WOW.

Thanks for the suggestion on how to build the macro. I'll try to do it soon.

Been away from computer as my daughter had my first grandchild and had other things to do. :D :D

Thanks,
RON C :)
User avatar
boldan
Posts: 31
Joined: Tue Jul 22, 2003 2:47 pm
Location: Toronto
Contact:

Post by boldan »

rechmbrs wrote:WOW.

Been away from computer as my daughter had my first grandchild and had other things to do. :D :D

Thanks,
RON C :)
I have 10 grandchildren... so far :-) When I got my first, somebody asked me: "What do you do to have a grandchild?" I answered: "You work 5 minutes, then wait for 20 years."

Mazal Tov!
rechmbrs
Posts: 7
Joined: Wed Nov 03, 2004 9:50 pm

Post by rechmbrs »

I don't remember 5 minutes of work.
:wink: :wink:


RON C :D :D
Post Reply