This may be a trivial question, but I have not been able to figure this out.
I have a VBScript that accepts a numeric input and decodes this into a path to the associated files. Initially, I created this as a script to invoke Directory Opus and it works fine in that mode. It prompts for the number, determines the drive and directory and opens Directory Opus with that path.
I realized that I could create a button to invoke a script and wanted to invoke a similar routine to provide a new path to the "Go" command so that I could switch directories to a different path rather than just opening more and more listers. I am sure there is an easy way, to pass this new directory back up so that it is accessible to the "Go" command in the button script.
I tried writing the directory to a file, but could not figure out how to read it in. I tried sending it to the clipboard but could not figure out how to use the Set command to assign the clipboard data to a variable or any other way to marry the clipboard data to the "Go" command. I tried setting a system variable but ran into a problem where Directory Opus seems to be one change behind. If I change from Path A to B, it works. If I then change to C, it stays on B. If I change to D, it goes to C. Changign to E results in D. And so on. I do not know how to force it to exit and re-open the command shell to get the latest environment variable value.
Right now, I have returned to the original script with invokes a new lister with the next step of the button script simply closing the current (i.e., old) lister. This is fine since it accomplishes the job, but I have to believe there is some other way to have the VBScript tell Directory Opus what it computed as the next path so that I don't have to close and open listers each time.
Although I've used Directory Opus for years, you may realize from the above that I am new to customizing it and only a few minutes further advanced at VBS Script building. Anything you can do to push me in the right direction would be appreciated.
Rather than attempt to call a script to pass a variable back to Directory Opus or to call a batch file to pipe a script back to Directory Opus or set a variable that may or may not be able to be read anywhere else or attempt to refresh the environment through multiple scripts or shell comannds, I need to try to use Directory Opus the way it would prefer to be used (which is very straightforward if you know that beforehand, which I am just starting on this long learning curve).
The error I made was in how I invoked Directory Opus initially. I was calling Directory Opus directly and passing a fully qualified directory name.
Apparently, this can be accomplished a number of ways. I can call explorer.exe with the directory structure (assuming I installed Directory Opus as a replacement) or I can call Directory Opus with the directory structure. Either of these will open a new lister. Another way to invoke Directory Opus is with the dopusrt.exe program using either the /cmd or /acmd switch with the "Go" ccommand. Using this will open a new lister when none is open but use the source or active lister in other circumstances.
I have modified my VBScript to construct the command:
If you want to do this entirely in Opus - then I think you're VASTLY over-complicating things with all this scripting... though we can still go down that path if you like, since you might apply whatever you learn to ~other things. That said - you didn't really explain what exactly you want to do, so much as explained HOW you've tried to do what you want.
It seems to me that you have assigned certain directory paths to "numbers"? So I guess you have a group of directory paths that you remember you've associated with numbers 1 -> whatever? If so, I think you have a few options available to you that you can use to vastly simplify things.
1: Folder Aliases...
Opus allows you to define folder aliases... meaning that you could create an alias called simply "1", and assign that to some folder path. You could then simply type the slash character (/) followed by the alias (1) and hit enter and Opus will take you to the path you defined for the alias (1).
2: Dlgchoose function...
Opus let's you create a button/hotkey that will prompt you to make a selection, then DO something based on that selection. Here's an example... put these commands into a button and try it out to see what it does:
Go "{dlgchoose|Select a folder path code to go to...|1=C:\+2=C:\Program Files+3=C:\Users+4=C:\Windows}"
...hopefully, aftre running this button to see what it does, the arguments to the Dlgchoose function are evident. It's also documented - naturally. Does this help simplify what you're trying to accomplish? If it's totally off the mark, maybe you can explain in more simple terms what you want to do?