Copy - setting an Autoprefix

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
acheton
Posts: 293
Joined: 27 Jul 2010 23:58
Location: XY 64bit, Win 11 at 100%

Copy - setting an Autoprefix

Post by acheton »

Hi there,

I've been using the Drag & Drop menu option when moving files between panes which works well. I particularly like the ability to suffix with the current date however what I'd really like to be able to do is to prefix the copied file with the date rather than suffix it. So instead of:
Filename-20100802.txt

I would have:

20100802 filename.txt

Is this possible to achieve? The reason I'd like to do this is that I've used this format for many years and would like to retain it! Any suggestions most warmly entertained :)

blessings,


Ach

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Copy - setting an Autoprefix

Post by serendipity »

acheton wrote:Hi there,

I've been using the Drag & Drop menu option when moving files between panes which works well. I particularly like the ability to suffix with the current date however what I'd really like to be able to do is to prefix the copied file with the date rather than suffix it. So instead of:
Filename-20100802.txt

I would have:

20100802 filename.txt

Is this possible to achieve? The reason I'd like to do this is that I've used this format for many years and would like to retain it! Any suggestions most warmly entertained :)

blessings,


Ach
Its possible, but not with drag & drop. Use below script and assign it to keyboard shortcut or toolbar button instead:

Code: Select all

//Copy selected files from active pane, paste into inactive pane and prefix with current date
   copyas "<date yyyymmdd> *.?", "<get path i>\";
Hope that helps.

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Copy - setting an Autoprefix

Post by admin »

I liked the idea and added a powerful tweak to the next version. Now back to the hammock...! :mrgreen:

acheton
Posts: 293
Joined: 27 Jul 2010 23:58
Location: XY 64bit, Win 11 at 100%

Re: Copy - setting an Autoprefix

Post by acheton »

admin wrote:I liked the idea and added a powerful tweak to the next version. Now back to the hammock...! :mrgreen:
Enjoy!

acheton
Posts: 293
Joined: 27 Jul 2010 23:58
Location: XY 64bit, Win 11 at 100%

Re: Copy - setting an Autoprefix

Post by acheton »

serendipity wrote: Its possible, but not with drag & drop. Use below script and assign it to keyboard shortcut or toolbar button instead:

Code: Select all

//Copy selected files from active pane, paste into inactive pane and prefix with current date
   copyas "<date yyyymmdd> *.?", "<get path i>\";
Hope that helps.
Thanks for the hint, it works fine but I've done something which works better for me:

Code: Select all

   rename b, "<date yyyy-mm-dd> *",; 
This renames the highlighted file using my preferred format which works better than copying it.

Thanks for the help.

ach

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Copy - setting an Autoprefix

Post by serendipity »

acheton wrote:
serendipity wrote: Its possible, but not with drag & drop. Use below script and assign it to keyboard shortcut or toolbar button instead:

Code: Select all

//Copy selected files from active pane, paste into inactive pane and prefix with current date
   copyas "<date yyyymmdd> *.?", "<get path i>\";
Hope that helps.
Thanks for the hint, it works fine but I've done something which works better for me:

Code: Select all

   rename b, "<date yyyy-mm-dd> *",; 
This renames the highlighted file using my preferred format which works better than copying it.

Thanks for the help.

ach
Well its your fault then, your post title says "Copy - .... ". Its clear from your post that you wanted to move/copy files to other pane using D&D. Why did you not mention rename in the first place?

acheton
Posts: 293
Joined: 27 Jul 2010 23:58
Location: XY 64bit, Win 11 at 100%

Re: Copy - setting an Autoprefix

Post by acheton »

serendipity wrote:Well its your fault then, your post title says "Copy - .... ". Its clear from your post that you wanted to move/copy files to other pane using D&D. Why did you not mention rename in the first place?
Hey no offence intended you answered my original query perfectly. I just realised after I'd used it that a rename followed by D&D to copy would work better for me. Thanks for all your help :)

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Copy - setting an Autoprefix

Post by serendipity »

acheton wrote:
serendipity wrote:Well its your fault then, your post title says "Copy - .... ". Its clear from your post that you wanted to move/copy files to other pane using D&D. Why did you not mention rename in the first place?
Hey no offence intended you answered my original query perfectly. I just realised after I'd used it that a rename followed by D&D to copy would work better for me. Thanks for all your help :)
No, I am not offended, just wondered what made you change your original query from copy to rename.

admin
Site Admin
Posts: 66351
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Copy - setting an Autoprefix

Post by admin »

Whatever, I added an improved way to attach dates because of this thread, so it was good for something after all. Aaah, I think I get some Thai massage now...

acheton
Posts: 293
Joined: 27 Jul 2010 23:58
Location: XY 64bit, Win 11 at 100%

Re: Copy - setting an Autoprefix

Post by acheton »

serendipity wrote:No, I am not offended, just wondered what made you change your original query from copy to rename.
Well I realised that by using the button to do the copy and rename in one step it was automatically copying the file to the tab focussed in the other pane. This relied on me having the correct tab focussed in the other pane which is not always the case - hence why a rename works best for my purposes. Hope that helps explain.

Post Reply