Too complex button?

i'm discovering the commands in Opus and after looking
at faq's and forums, i ain't found the solution.
Here's my question:

is it possible in the same command to have set and select (in different lines) ?

for instance, when i'm in an active folder, i'd like to firt
have a flatview, and then select the files i want in the
flatview list. and all of that by clicking only one button.

I have no problem to make it in 2 buttons.
but in 1 ?

What are the commands you're using in the 2 buttons?

In the first one i have
Set FLATVIEW=On,MixedNoFolders

And in the second
Select *.exe HIDEUNSEL

I can't unchain the 2 commands in one button,
except if i left click between the 2. and i neet
to automatize all that

Being a relative DOpus newbie myself, I can't quite help you out with getting your button to work. However, I have come up with a workaround. Your button only works for me in folders where there isn't a lot of stuff, i.e. when switching to flat mode view is pretty instantaneous. If I do it on a folder where there's lots of subfolders, etc, and flat mode takes a while to display, your button doesn't do the trick. However, even on those big folders, if you click your button, wait for flat view to display properly, then click your button again, it accomplishes what you're looking for.

Not a perfect solution, but it gets the job done.

--chriscrutch

This set of commands work for me in one button:

Set FLATVIEW=MixedNoFolders
Select PATTERN=*.exe
dopusrt /cmd Select HIDEUNSEL NOPATTERN

[quote]
JohnZeman wrote:
This set of commands work for me in one button:

Set FLATVIEW=MixedNoFolders
Select PATTERN=*.exe
dopusrt /cmd Select HIDEUNSEL NOPATTERN[/quote]

Didn't do the trick for me. At least, not on larger folders with a bunch of sub-folders and stuff. But it does work if I click it twice, like Flytox's button did.

Flytox, does this new button setup work for you?

sorry, no, it does'nt work.
I'm still searching the solution, and i'm looking
for a solution that works for any size of folders.

When we try to group multiple commands together, and they don't work as expected, quite often the problem is the timing of the commands (as you've noted).

I haven't tried these commands on a huge folder of files but they work fine for me on a medium sized folder. You might give this revised set of commands a try and see if they do any better.

sync:dopusrt /cmd Set FLATVIEW=MixedNoFolders
sync:dopusrt /cmd Select PATTERN=*.exe
sync:dopusrt /cmd Select HIDEUNSEL NOPATTERN

I should also make note that to reset the button (whenever you get it to work) to show all the files again in the primary flattened folder you might need another separate button command something like

Select SHOWHIDDEN NOPATTERN

This may not matter if you change folders to reset the flat view and then come back again.

[quote]
I haven't tried these commands on a huge folder of files but they work fine for me on a medium sized folder. You might give this revised set of commands a try and see if they do any better.

sync:dopusrt /cmd Set FLATVIEW=MixedNoFolders
sync:dopusrt /cmd Select PATTERN=*.exe
sync:dopusrt /cmd Select HIDEUNSEL NOPATTERN[/quote]

Small and medium folders, it works great. On larger folders I still need to click it, let flat view kick in totally, then click it again to get it to work.

I started a topic on this board a while ago ("Pausing in a multi-function button") that also dealt with timing of multiple commands on one button. We never could figure out how to get the timing to work right, so Porcupine and Steje were kind enough to write programs to avoid using DOpus commands. There has got to be some way, somehow, to get Opus buttons to run a function, wait for it to actually complete, then run the next function. Isn't there? At least for me, the "sync:" and "sync:dopusrt /cmd" options have never produced what I thought they would. I thought it was just because I had always been mixing internal DOpus commands and external program calls, but this example doesn't seem to work, either, and this one involves only internal commands.

--chriscrutch

Other than sync: I know of no DOpus way to pause, so I'd run the commands from an external script which will allow you to insert pauses. Try the following batch file (save it as a text file that ends in .cmd or .bat then double click it to run) which inserts a 2 second delay between each DOpus command. You can change the DELAY variable value to a larger or lower number as you wish until it works right. If it does the trick simply assign the script to a button, and change the RUN parameter to HIDE and it'll appear to work as a totally DOpus function.

@echo off rem SET DELAY BETWEEN COMMANDS IN SECONDS set DELAY=2

set /a DELAY += 1
dopusrt /cmd Set FLATVIEW=MixedNoFolders
ping.exe -n %DELAY% 127.0.0.1 >nul
dopusrt /cmd Select PATTERN=.htm
ping.exe -n %DELAY% 127.0.0.1 >nul
dopusrt /cmd Select HIDEUNSEL NOPATTERN

first thanks a lot for your help. your solution sure works, but the problem is that if i need to check a full
hard disk for instance , the delay has to be of 20 seconds, or more , according to the size of the HD.
and if i need to check a single folder whith, say, 200 or 400 folders, i don't want to wait for 20 seconds between the dopus command.

anyway i'll use your solution for other situations and i think i'm going to keep the solution with 2 clicks.

You could also run a script like what John proposed with a variable delay time that you could prompt yourself for from within Dopus with something like:

"script.bat {dlgstring|Enter delay time...}"

This would pass whatever you type in to the dialog to the batch file which you'd reference as %1 in the batch file to set the delay time. But I guess the point is that either way you'd need to do more than just 'click a button once' sort of maneuver :frowning:.

i could but 2 clicks are less complicated and more efficient. i cant make mistakes like that : when i see that
it's ready, i do the second click. it's like answering a prompt , but without the prompt.