Defining new default folder

Features wanted...
Post Reply
Peter28
Posts: 9
Joined: 14 Jun 2018 09:57

Defining new default folder

Post by Peter28 »

Hi

I'd like to define my own new default folder (starting with "YY_MM_DD_").
Today (right mouse click\New\...) only the options "New Folder "YYYYMMDD" or "YYYY-MM-DD" are available. This doesn't work for me. I need "YY_MM_DD_".

How can I implement this option in the right mouseclick\New menu or EVEN better, with a shortcut?

Please advice.

Looking forward to hearing from you.

Kind regards,

Reto

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Defining new default folder

Post by bdeshi »

paste the following code in the addressbar, then press ENTER. XYplorer will restart, and then you'll find the expected item in Right-click > New:

Code: Select all

setkey "YY_MM_DD_", "Folder3", "NewTemplates"; exit 'nr';
OR, if you want a shortcut, do the following.
  1. open main menu > User > Manage Commands.
  2. select "Run Script" from the category list at the left, then click the "New..." button at topright.
  3. Then at the bottom half of the window, fill up the textboxes like below:
    • Caption: New Folder ("YY_MM_DD_")
    • Script:
          
      new(now("YY_MM_DD_"), "dir",, "r");
  4. Now click the large "Assign Keyboard Shortcut..." button, set your desired keyboard shortcut.
  5. Check "On KeyUp" and OK out of the window.
[ed.]
Actually if you want to modify defaults, then you can use "Folder2" instead of "Folder3" in the setkey command above, then a shortcut can be assigned to the commandID directly from Tools > Customize Keyboard Shortcuts.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Defining new default folder

Post by admin »

SammaySarkar wrote: 03 Nov 2019 08:17 paste the following code in the addressbar, then press ENTER. XYplorer will restart, and then you'll find the expected item in Right-click > New:

Code: Select all

setkey "YY_MM_DD_", "Folder3", "NewTemplates"
Really? I think there is something missing in that code...

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Defining new default folder

Post by bdeshi »

Where? I don't see anything missing... :ghost:
:whistle:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Defining new default folder

Post by admin »

:)

"XYplorer will restart." ?? Not with this script... :ninja:

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Defining new default folder

Post by bdeshi »

gah! that was embarrassing. (thanks!) :oops:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Peter28
Posts: 9
Joined: 14 Jun 2018 09:57

Re: Defining new default folder

Post by Peter28 »

Works! Big help. Many thanks!

Peter28
Posts: 9
Joined: 14 Jun 2018 09:57

Re: Defining new default folder

Post by Peter28 »

Hi,
I also want to shotcut create a folder with the name "99_OLD".
If I use your script however. The "99_OLD"-Folder cones out as a "99_OL20"-Folder.
Please advise,
Thanks

Peter28
Posts: 9
Joined: 14 Jun 2018 09:57

Re: Defining new default folder

Post by Peter28 »

How do I delete a no longer needed folder template ("Folder3)?

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

Re: Defining new default folder

Post by admin »

Go down into the XYplorer.ini file using any editor and delete it there. Then restart XY without saving (File | Restart without Saving).

Peter28
Posts: 9
Joined: 14 Jun 2018 09:57

Re: Defining new default folder

Post by Peter28 »

Hi,
I also want to shotcut create a folder with the name "99_OLD".
If I use your script however. The "99_OLD"-Folder cones out as a "99_OL20"-Folder.
Please advise,
Thanks

jupe
Posts: 3462
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Defining new default folder

Post by jupe »

You need to escape the string, so for example modify the template as such:

\9\9\_\O\L\D

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

Re: Defining new default folder

Post by admin »

That's because a date pattern is expected by default, where e.g. an unescaped "D" stands for "day number".

Post Reply