Select every nth files in a lister

I will have a different increment each time i will have to select..

So i need to use Select Range but i still need to calculate the increment myself...

I need an automatic thing .. Ex i input the number 6 and then every 6th frames will be selected

Euh where is the select range command?

thanks :slight_smile:

If you type > into a lister you get a command field where you can run one-off commands directly.

Or you can put the command on a toolbar or menu button, or a hotkey, or run it from an external script using "dopusrt.exe /cmd". Depends how you want to run it.

You can also do range selection by turning on the Index column and then typing # into the lister and a similar range to what the command accepts (except the numbers start at 1 instead of 0):

Ok Thanks i see it is working very well.

I added a button, now i have to find how to generate a range based on nth number..

But thanks a lot is this helping me a lot.

Here's a cmd file that will select a range of files based on number you choose.

rangeselect.cmd:[code]@echo off
set inc=%1
set cnt=0
set num=1
for /d %%? in () do set/a num+=1
set rng=%num%
for %%? in (
.*) do ( set/a cnt+=1&call :compare )
start dopusrt.exe /cmd select range %rng%
goto :eof

:range
set/a num+=%inc%
set rng=%rng%,%num%
set cnt=0

:compare
if %cnt% equ %inc% call :range
[/code]

Place it /dopusdata\scripts and then use it with a button popping up a dialog to enter that is passed to the file.
Button: cd {sourcepath} @runmode:min /dopusdata\scripts\rangeselect.cmd {dlgchoose|Select a value|1+2+3+4+5+6+7+8+9+10}

You should probably run dopusrt.exe normally without "start", unless there's a reason it was needed. Running too many in parallel can cause them to start being ignored.

Well, dopusrt.exe is only run once That is the end of the batch file, next line is 'goto :eof' which does just that, goes to the End Of File :wink:

Ah, fair enough. I thought it was looping but didn't look closely enough. In that case "start" is not needed but also harmless.

Thanks,

But i cannot find where is that folder structure.. /dopusdata\scripts
The only similar folder i find is under C:\ProgramData\GPSoftware\Directory Opus\Global Data
Do i have to create these folder under that? C:\Program Files\GPSoftware\Directory Opus
it is that folder?

i think i understand well, i will have to copy the script code into a notepad and then rename my document as rangeselect.cmd and put that file in the dopusdata\script folder

I think i found it under C:Users

C:\Users\username\AppData\Roaming\GPSoftware\Directory Opus\Scripts

I will put my script here and try :wink:

In that code where is the sourcepath? or do i have to enter my own source path where i put the folder dopusdata\scripts ?

cd {sourcepath}
@runmode:min
/dopusdata\scripts\rangeselect.cmd {dlgchoose|Select a value|1+2+3+4+5+6+7+8+9+10}

Well,

i searched and find how to locate /dopusdata folder so everything is at the good place.

1- I've put the rangeselect.cmd in C:\Users\martin\AppData\Roaming\GPSoftware\Directory Opus\Scripts
2- open my folder with the image sequence
3- click on the button with that code inside:
cd {sourcepath}
@runmode:min
4-I always get this error: "Windows cannot find '@runmode:min' Make sure you typed the name correctly, and then try again.

Ok now something new.

I succed to get the Select a value menu and i choose 6 for example then i get this error message:

"Windows cannot find 'dopusrt.exe'. Make sure you typed the name correctly, and then try again."

In the .cmd file, change dopusrt.exe to the full path (usually "C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" including the quotes).

I would remove the "start" from the line as well, as the start command does silly things with quoted arguments and, since it isn't needed, the easiest thing to do is remove "start" and run dopusrt.exe directly.

(I also changed /cmd to /acmd so it works on the active window and not the source window, although they are usually the same.)

[code]@echo off
set inc=%1
set cnt=0
set num=1
for /d %%? in () do set/a num+=1
set rng=%num%
for %%? in (
.*) do ( set/a cnt+=1&call :compare )
"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe" /acmd select range %rng%
goto :eof

:range
set/a num+=%inc%
set rng=%rng%,%num%
set cnt=0

:compare
if %cnt% equ %inc% call :range[/code]

Whohoo now it is working perfectly!

Thanks a lot!!! :smiley: :thumbsup:

There is a new script command "SelectEx" that features n-th selection as well. Find it here: Command: SelectEx (extended Select command)

To select every 5th item, create a button and run this:

SelectEx NTH=5

Oh yes, i will check this as soon i can :slight_smile:
Cheers!

This is definitely my preferred method. Here's my button if it helps...

<?xml version="1.0"?> <button backcol="none" display="both" separate="yes" textcol="none"> <label>Select every &amp;nth file</label> <tip>Selects every nth files from the current selection</tip> <icon1>#default:selectwild</icon1> <function type="normal"> <instruction>SelectEx NTH={dlgchoose|Select Nth File:|2=2+3=30+4=4+5=5+6=6+7=7+8=8+9=9+10=10}</instruction> </function> </button>
Thanks tbone.

Slight error in the previous version...

<?xml version="1.0"?> <button backcol="none" display="both" separate="yes" textcol="none"> <label>Select every &amp;nth file...</label> <tip>Selects every nth file from the current lister</tip> <icon1>#default:selectwild</icon1> <function type="normal"> <instruction>SelectEx NTH={dlgchoose|Select Nth File:|2+3+4+5+6+7+8+9+10}</instruction> </function> </button>

Glad to see you make use of it! o)
Credits go to Leo, I basically just transformed his batch-code into nowadays scripting format.