Page 1 of 1
Copy to same folder and add today's Date as a suffix.
Posted: 25 Oct 2008 10:00
by Steadyhands
I was wondering if this is the best way to do this? Could be a problem if you use Copy Here with Suffix Number on other files in the folder.
Code: Select all
// Copy to same folder and add today's Date as a suffix.
Focus("List");#164;
selfilter "-01";
rename "b", "*.?.<date yymmdd> /e";
rename s, "-01/";
Edited to include Focus Command.
Re: Copy to same folder and add today's Date as a suffix.
Posted: 25 Oct 2008 15:35
by serendipity
Steadyhands wrote:I was wondering if this is the best way to do this? Could be a problem if you use Copy Here with Suffix Number on other files in the folder.
Code: Select all
// Copy to same folder and add today's Date as a suffix.
#164;
selfilter "-01";
rename "b", "*.?.<date yymmdd> /e";
rename s, "-01/";
But #165 (Copy here with suffix date now) does the same.
Re: Copy to same folder and add today's Date as a suffix.
Posted: 25 Oct 2008 21:05
by Steadyhands
No, #165 adds the date before the file extension. I like to add the date after the file extension so the original programs do not recognise the file as being associated.
Re: Copy to same folder and add today's Date as a suffix.
Posted: 26 Oct 2008 05:35
by serendipity
Steadyhands wrote:No, #165 adds the date before the file extension. I like to add the date after the file extension so the original programs do not recognise the file as being associated.
Oh sorry, then you are right. But like you said you might have problems with selfilter "-01", I modified your code to this:
Code: Select all
// Copy to same folder and add today's Date as a suffix.
#164;
setting HideFoldersInList;
sortby c, d;
sel 1;
rename "b", "*.?.<date yymmdd> /e";
rename s, "-01/";
Re: Copy to same folder and add today's Date as a suffix.
Posted: 29 Apr 2011 10:15
by Steadyhands
Time to dig up an old post of mine.
My original version is playing up for some reason. If I run it on a file for the first time. I get the error message
Nothing selected in the file list
If I cancel the error message and run it again it works.
It's like there now needs to be a pause before the selfiter command.
If I run the whole thing in step mode it works first time.
This is what I've been using
Code: Select all
// Copy to same folder and add todays Date as a suffix.
Focus("List");#164;
selfilter "-01";
rename "b", "*.?.<date yymmdd> /e";
rename s, "-01/";
Re: Copy to same folder and add today's Date as a suffix.
Posted: 29 Apr 2011 10:17
by admin
Which version are you using?
Re: Copy to same folder and add today's Date as a suffix.
Posted: 29 Apr 2011 10:23
by Steadyhands
oops forgot that bit.
9.90.0704
Re: Copy to same folder and add today's Date as a suffix.
Posted: 29 Apr 2011 12:04
by Stefan
Steadyhands wrote:
I like to add the date after the file extension
so the original programs do not recognise the file as being associated.
This is what I've been using
Code: Select all
// Copy to same folder and add todays Date as a suffix.
Focus("List");
#164; //copy here with increment
selfilter "-01";
rename "b", "*.?.<date yymmdd> /e";
rename s, "-01/";
BTW, I don't know about 2008 but today one can use copyas:
copyas
Creates copies named [original name]_backup_20100117.[original extension] if today is 17-Jan-2010:
copyas "*_backup_<date yyyymmdd>.?";
For example for "Steadyhands":
Code: Select all
// Copy to same folder and add todays Date as a suffix.
// * = basename
// . = dot
// ? = extension
// . = dot
// <date yymmdd> = 110429
copyas "*.?.<date yymmdd>";
Re: Copy to same folder and add today's Date as a suffix.
Posted: 29 Apr 2011 12:13
by Steadyhands
Thanks Stefan, that is a much better solution.
Re: Copy to same folder and add today's Date as a suffix.
Posted: 29 Apr 2011 12:35
by admin
Just FYI, your script probably failed because a backgrounded file operation was not finished yet. To make it work you to turn off backgrounding temporarily like this:
Code: Select all
Focus("List");
Setting "BackgroundFileOps", 0;
#164; //copy here with increment
selfilter "-01";
rename "b", "*.?.<date yymmdd> /e";
rename s, "-01/";
Re: Copy to same folder and add today's Date as a suffix.
Posted: 29 Apr 2011 20:48
by Steadyhands
Thanks