Button tutorials?

I've been looking at the extensive documentation, tutorials and examples, and still am not sure how to construct complex buttons. I'd like to know how to tie commands together, or if there is a way of knowing what commands will conflict with each other. I was attempting what I thought would be a simple button to practice: zip selected files, move just the zip to a transfer folder ( if I figured that out was going to try and put the zip in a time stamped folder inside the transfer folder ) the best result I got was moving the selected files and the zip to the transfer folder.

I tend to pick stuff up after seeing examples of it in action, and am having a bit of sluggish time muddling through this semi-randomly seeing what fits and what dosn't. Is there a resource already out there for button scripting that I've missed, or mabye some kind soul could steer me in the right direction?

I used to try to create complex multi command buttons, but I always ran into similar problems like you are running into. The bottom line was I was trying to use DOpus commands like a scripting language, and while that sounds like it may be coming in the future, for now it's not really much of an option.

I just now went through all my toolbar buttons looking for one with more than one line of commands. I only found one. It's part of a three button button, that when left clicked on, resizes the current DOpus window to approximately one half of the maximized size. The three commands I use to do that are below:

Set LISTERCMD=Restore
Set LISTERSIZE 1400,500
Play QUIET "C:\Sounds\Click-2.wav"

The first takes the lister out of the maximized mode.

The second resizes the lister to 1400px wide by 500px tall, which is about one half of my screen.

And the third command merely plays a little click sound to snazz it up a bit.

In situations where I have a more complicated task to perform, I write a 4NT script (like a batch file only more powerful) and launch it with DOpus and the two work together marvelously. You may want to consider something like that for your more complicated tasks.

John

John - could you kindly tell us how you would launch a batch file w/ a button in dopus?

TIA,
Rick

The same way you can other programs in DOpus. Navigate to the folder where your batch file is, put DOpus into customize mode, then just drag and drop the batch file to any toolbar or menu.

Depending on what you are wanting to do, you may want to further customize the newly created DOpus button to run the batch file. For example if you know the batch file has been debugged and problem free, you might want to hide the console window that always pops up when you run a batch file. You can do that by (with DOpus still in customize mode) by double clicking on the toolbar button to run the batch file, switching to advanced mode, changing the function from "Standard function (Opus or external)" to "MS-DOS Batch Function" and making the very first DOpus command RUNMODE HIDE

For example, the DOpus button below runs one of my batch files that calculates the sunrise and sunset times.

[DOpus.ButtonInfo]
Name=Calculate Sunrise and Sunset times
Icon=139,139
Flags=2a,0,1
Color=0,a0a0a0
Tooltip=Shows Sunrise and Sunset times
Func1=runmode hide
Func2=C:\Mine\cmd\suntimes.cmd

By hiding the batch file console window it appears that DOpus itself is calculating the sunrise and sunset times.

John

Thanks, that's excellent. I also downloaded the doptest.exe from Downloads/Tools on this site, and created a button with that to test out the paths and such. Now I just need to be able to pass the right parameters to the batch file.

Cool.

Regards
Rick

For what its worth, regarding the batch files I launch with DOpus that require parms, I generally use %1 or %* to have DOpus pass what's selected to the batch file.

John