Here's a script that lets you type 5 digits without worrying about the backslash:
If the last number is less than 100, you don't need to pad it; the script will take care of that for you.
Examples:
- Typing
12345
will take you toP:\2012\345
- Typing
1234
will take you toP:\2012\034
- Typing
123
will take you toP:\2012\003
(Typing less than 3 characters will do nothing, and it won't let you type more than 5.)
It doesn't currently verify that everything typed is a number, but that'd be easy to add if it's needed. (Nothing bad will happen on invalid inputs; it'll just try to go to a folder that doesn't exist and show an error message.)
You could also have a dialog with two separate string fields for the YY and MMM parts, but I figured that would require more typing, not less, so I went with this approach.
The script code is fairly simple, so if you want to change the text in the prompt, that's easy to do. ("MMM" is probably wrong here, since those aren't months, but I wasn't sure what to use instead.) The path near the bottom can also be adjusted if you need to.
DCF format, for easier adding to a toolbar:
Script code for reference (this is contained in the .dcf file above):
function OnClick(clickData)
{
var dlg = clickData.func.dlg;
dlg.title = 'Go to date';
dlg.message = 'Enter YYMMM:';
dlg.buttons = 'OK|Cancel';
dlg.max = 5; // Max 5 characters
if (dlg.Show() != 1)
return;
var s = dlg.input;
if (s.length < 3) // Min 3 characters
return;
// Split YY from MMM.
var y = s.substr(0,2);
var n = s.substr(2);
// Pad MMM to 3 digits.
while(n.length < 3)
n = '0' + n;
// Path in format: P:\20YY\MMM
// (Backslashes must be doubled due to JScript.)
var p = 'P:\\20' + y + '\\' + n;
var cmd = clickData.func.command;
cmd.RunCommand('Go PATH="' + p + '"');
}