I've just discovered Directory Opus. I was wondering if this "custom search then open a directory" idea of mine is possible with a script.
All our projects are in our "P" drive. We associate our project numbers with the year (last 2 digits) we started the project and the order it was started (3 digits).
Examples:
19001 means P:\2019\001
21007 means P:\2021\007
Is it possible for a script to..
Open a dialogue box.
If I type five characters like “22015”.
Lister will browse/open/jump to P:\2022\015.
If an opus script can do this it would save me a lot of time. I just need a quick answer before I start on my journey of learning how to write a script. (Even with no programming experience).
But I feel a little embarrassed. I’m really new with Opus Directory.
I’m not sure what to do next. If you don’t mind, can you please post
a link for instructions. Or which part of the help manual I start looking.
I have it open now.
I'm on a trial version. This search method is almost exactly how my office is setup. I have no coding experience. Can somebody please post a script that has one dialog box. I really would appreciate it..
We'll make the dialog for you if you pay for the software and our time. Doing something in one dialog or two seems like a strange thing to decide whether to purchase a piece of software or not.
When you say "almost exactly how my office is setup", that suggests there are some differences. If you have no coding experience then it'd be better to explain exactly what you want first, before any code is written, else we'll post a script that won't work for you and you won't be able to change it yourself, meaning we have to. Those differences may also mean a different approach makes more sense, depending on what they are.
The script would not cost anything (as long as we're just talking about something that prompts for a couple of numbers and inserts them into a path/command).
Although Lxp's suggestion may mean you don't need it. Depends how much padding/formatting you need on the numbers, e.g. if you don't want to type the extra zeros.
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 to P:\2012\345
Typing 1234 will take you to P:\2012\034
Typing 123 will take you to P:\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.
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 + '"');
}