# Image Viewer - Random Image on command

**URL:** <https://resource.dopus.com/t/image-viewer-random-image-on-command/35497>\
**Category:** Help & Support\
**Created:** [May 10, 2020, 8:42pm UTC](https://resource.dopus.com/t/image-viewer-random-image-on-command/35497 "2020-05-10T20:42:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaptorFeathers](https://resource.dopus.com/user_avatar/resource.dopus.com/raptorfeathers/32/32344_2.png) [@RaptorFeathers](https://resource.dopus.com/u/RaptorFeathers)\
**Post date:** [May 10, 2020, 8:42pm UTC](https://resource.dopus.com/t/image-viewer-random-image-on-command/35497/1 "2020-05-10T20:42:47Z")

</div>

I like how the integrated image viewer has an easy time running a slideshow of all the images in it's given directory.  
I like how this slideshow can be set for random image order instead of sequential order.

I would like to know how I can manually go to a random image in the current directory without going into the slideshow, setting it to randomize, and then waiting a few seconds for the slideshow to go.  
I would like to be able to easily go to the first or last image in the directory, too.

Is this already in the program and I just haven't been able to find it, or is there an existing plugin I can install to use it, or do I need to write up my own button to make this happen?

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [May 10, 2020, 9:08pm UTC](https://resource.dopus.com/t/image-viewer-random-image-on-command/35497/2 "2020-05-10T21:08:37Z")

</div>

You could do it using a script that selects a random file and opens it in the viewer pretty easily.

Or you could use one of the existing scripts which randomises the file order or selects a random file and then push return to open it:

> [@Button: Random Shuffle](https://resource.dopus.com/t/button-random-shuffle/23261):
>
> Requires Directory Opus 12 or above. Overview: This script-button shuffles the files and folders in the tab into a random order each time you click it. Files and folders are mixed together. Right-clicking the button resets things back to normal. Y…

> [@Command: SelectRandom (randomly select files/folders)](https://resource.dopus.com/t/command-selectrandom-randomly-select-files-folders/19289):
>
> SelectRandom - a script command which allows you to randomly select items by type, count, size, total-size or some other filters. Results can be selected, dumped to console, copied to file collections or returned in env/tab-variables. "SelectRandom…

---

<div class="post-metadata">

**Author:** ![RaptorFeathers](https://resource.dopus.com/user_avatar/resource.dopus.com/raptorfeathers/32/32344_2.png) [@RaptorFeathers](https://resource.dopus.com/u/RaptorFeathers)\
**Post date:** [December 11, 2020, 5:44am UTC](https://resource.dopus.com/t/image-viewer-random-image-on-command/35497/3 "2020-12-11T05:44:15Z")

</div>

Of the suggested tools, the Random Shuffle button is the closest to what I was looking for. I tinkered with the updated version of the command you linked to and found that it doesn't seem to work the way I want when I run the command button inside the image viewer.

My goal is to get a button on the image viewer that will let me go to a random image inside the directory I'm in, similar to the "previous/next image" buttons. I also want each new image I randomize to to be brought into focus on the file lister.

I have folders of images I downloaded from the internet, and sometimes they're part of a set, like different panes of a short comic, or different versions of a character. If an image is part of a set, then I'd want to be able to notice and look at them in order.
