Need help making a script / macro for selecting for image to video

I have a button used for this as well but my filenames are named slightly different and I'd recommend doing the same to help avoid conflicts. Example:

video.jpg
video.mp4
video.mkv

2 videos named the same with different extensions but only 1 index, which video does the index associate with? Instead, I use:

video.mp4
video.mp4.jpg
video.mkv
video.mkv.jpg

That way each video, no matter the extension, has it's own index.


I'm guessing these buttons will only work if you change your naming convention.

I use a Button labeled Play on the Standalone Viewer which runs:

@hideif:=!Exists(RegEx(selpath, "(.*)\..*?", "\1"))
"C:\Program Files\DAUM\PotPlayer\PotPlayerMini64.exe" {filepath$|noext}

Change the path to the player of your choice.

The @hideif hides this Play button when an image you are viewing does not have an assoicated video file (Thanks lxp for that).

I also having a button called Play (close), which closes the currently opened image (Standalone Viewer) and plays the video:

@hideif:=!Exists(RegEx(selpath, "(.*)\..*?", "\1"))
Select DESELECTNOMATCH SETFOCUS EXACT PATTERN="{allfile|noext}"
Show VIEWERCMD=close
@nodeselect 
"C:\Program Files\DAUM\PotPlayer\PotPlayerMini64.exe" {filepath$|noext} 

I also have 2 Delete buttons. The first Delete button acts like a normal delete and deletes whatever is being viewed. The second Delete (w/ Vid) deletes the image and it's associated video. Only 1 Delete button shows up at a time depending on whats being viewed.

Delete:

@hideif:=Exists(RegEx(selpath, "(.*)\..*?", "\1"))
Show VIEWERCMD=delete

Delete (w/ Vid):

@hideif:=!Exists(RegEx(selpath, "(.*)\..*?", "\1"))
Delete {file$|noext}
Show VIEWERCMD=delete

I'm pretty sure you need DOpus 13.12 or higher to use these buttons that auto hide. Or it's something higher than 13.7 because they stopped working when I went back to 13.7 for testing something else. Don't remember.

lxp also changed the hide code slightly for DOpus 13.12.1 and higher:

1 Like