copy file and append yymmdd

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Techworks
Posts: 27
Joined: 27 Oct 2008 23:15

copy file and append yymmdd

Post by Techworks »

I know there is the Ctrl+Shift+Alt+D that copies Here with Suffix Date Now

I see this will also ass an 01, 02 etc if the copy already exists. Great, but how do I reproduce this in a script that I can call in a PFA so whenever i double click a specific file type (mdb) I get a prompt to open or copy with suffux?

Cheers

Grant

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

Re: copy file and append yymmdd

Post by serendipity »

Just add another script to your existing mdb script.

Code: Select all

"Copy with suffix"
   #165;
#165 is the command ID for "Copy Here with Suffix Date Now". You will find the command IDs for all menu items in menu "Tools| Customize Keyboard Shortcuts...". You will find #165 in the category "File". You can use command IDs in places like catalog, address bar, scripts etc.

Techworks
Posts: 27
Joined: 27 Oct 2008 23:15

Re: copy file and append yymmdd

Post by Techworks »

ok, got that working, but how can I get the script code for #165 so I can make a copy and modify it to only do yymmdd rather than yyyymmdd?

Or is this a hard coded feature rather than script?

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

Re: copy file and append yymmdd

Post by serendipity »

Techworks wrote:ok, got that working, but how can I get the script code for #165 so I can make a copy and modify it to only do yymmdd rather than yyyymmdd?

Or is this a hard coded feature rather than script?
Yes thats the default, but you can definitely have it as yymmdd using some more scripting.
For example this will do it:

Code: Select all

"Copy with suffix"
   $item=<curbase>;
   #164;
   sortby c,d;
   setting HideFoldersInList;
   sel 1;
   rename b, "$item-<date yymmdd>";

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: copy file and append yymmdd

Post by jacky »

Techworks wrote:ok, got that working, but how can I get the script code for #165 so I can make a copy and modify it to only do yymmdd rather than yyyymmdd?

Or is this a hard coded feature rather than script?
hmm.. pretty sure it uses XY's Date suffix template, which you can change to your liking on Configuration - Report
Proud XYplorer Fanatic

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

Re: copy file and append yymmdd

Post by serendipity »

jacky wrote:
Techworks wrote:ok, got that working, but how can I get the script code for #165 so I can make a copy and modify it to only do yymmdd rather than yyyymmdd?

Or is this a hard coded feature rather than script?
hmm.. pretty sure it uses XY's Date suffix template, which you can change to your liking on Configuration - Report
:oops: , I was not aware of this. I always thought that option was for creating reports.

Post Reply