# Background Changer V1.2

**URL:** <https://resource.dopus.com/t/background-changer-v1-2/52091>\
**Category:** Buttons/Scripts\
**Created:** [August 2, 2024, 4:39am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091 "2024-08-02T04:39:25Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [August 2, 2024, 4:39am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/1 "2024-08-02T04:39:25Z")

</div>

# BACKGROUND CHANGER

see [How to use Buttons and Scripts](https://resource.dopus.com/t/how-to-use-buttons-and-scripts-from-this-forum/3546)

**V1.22**  
Does single images now. Set by adding full path to image to the command. e.g.  
`BackgroundChanger PATH="C:\path to image\image.png"`, can also be set from a `FOLDERCONTENT` menu (see example button below) - what makes this different to the inbuilt `SET BACKGROUNDIMAGE` is it is possible to adjust individual or global opacity settings much easier through the script config settings.

- added enhanced button tooltip, example below
- added `RENAME` argument - for renaming currently displayed image
- added progress dialog for slideshow lists bigger than 1000 images
- removed `RESET` command - basically the same as the `TIDYUP` command
- min Directory Opus version now 13.19
- minor fixes and improvements

**V1.22**  
Script:  
[Background Changer.opusscriptinstall](https://resource.dopus.com/uploads/short-url/gdKRG9WwSo6NOAcXeyzdWHW8nTZ.opusscript) (20.2 KB)  
Sample menu button (paths will need changing):  
[Background Changer.dcf](https://resource.dopus.com/uploads/short-url/rSFoVLy2QMTpPrbjXQRL0QSuCvq.dcf) (21.6 KB)  
Updated Clear Background button:  
[Clear Background Image.dcf](https://resource.dopus.com/uploads/short-url/jMrNxgT9oFsWxm2u94Y0RSuWSOW.dcf) (366 Bytes)

**V1.21**  
(commented out the start/stop slideshow (if on) when display sleeps - as those occasions when slideshow is set to a long duration, say 24 hours, then the Periodic timer will keep resetting to 24 hours every time the display wakes from sleep. There is no way to pause the timer and resume it.)

- Global opacity setting
- new Event Trigger, Change backgreound when display wakes
- Switched from hidden dialog timer to OnPeriodicTimer
- Static or Dynamic lists
- COPY argument
- DELETE argument
- OPEN & NEWTAB arguments
- CLIP argument
- SHOW\_IN\_VIEWER argument
- SLIDESHOW\_IN\_VIEWER argument

**V1.21**  
Script and example menu button (paths will need changing):  
[Background Changer.opusscriptinstall](https://resource.dopus.com/uploads/short-url/ehnGyXiqBSLYiXKdfzDiyS8svSN.opusscript) (15.2 KB)  
[Backgrounds.dcf](https://resource.dopus.com/uploads/short-url/t4zy4yB99gg1HiiG0c7fQkK2f0S.dcf) (9.0 KB)

**V1.1**  
Script and example menu button (paths will need changing):  
[Background Changer.opusscriptinstall](https://resource.dopus.com/uploads/short-url/xYYJZwnACcAQr0GcMraUK6Y86gC.opusscript) (11.5 KB)  
[Backgrounds.dcf](https://resource.dopus.com/uploads/short-url/w8sSfNbaCCIFP5j5mHAcE7rZZoi.dcf) (2.9 KB)

## Usage
- This script is for changing the background using a **shared** image across all 7 UI elements.
- This script will do nothing by default when installed - until it is configured in the script preferences.

##### There are two ways of using this script. Event trigger mode or Slideshow mode. Use one or the other, although there are no blocks on using both modes at the same time.

## 1️⃣ Event Trigger mode

 ![Event Triggers](https://resource.dopus.com/uploads/default/original/3X/f/f/ffed828f17d90e21ea3c28ba286149c0f108f282.jpeg)

Four events are available:

- Folder Changes
- Tab Switching
- When Display wakes
- Double-Clicking on a file or folder

Turn on one or more of them and set a Path to a folder that contains two or more images.

## 2️⃣ Slideshow mode

Activated using the command `BackgroundChanger`

Commands are used in buttons but can be called from other places.  
see [How to use Buttons and Scripts](https://resource.dopus.com/t/how-to-use-buttons-and-scripts-from-this-forum/3546)

##### The main commands are

- Start/Stop the Slideshow  
`BackgroundChanger`

- Start/Stop a Slideshow of a folder of images  
`BackgroundChanger PATH="C:\My Latest Photo Shoot"`

##### These are all the arguments that can be used:

#### 

| **Argument** | **Type** | **Values** | **Description** |
| --- | --- | --- | --- |
| PATH | /K | Path | Path enclosed in quotes _PATH="C:\My Latest Photo Shoot"_ |
| RESET | /S | - | Resets the path to the default path set in script configuration |
| TIDYUP | /S | - | Deletes all persistant variables |
| RECURSIVE | /O | true/false | Overides the recursive path setting in script configuration. _PATH="C:\My Latest Photo Shoot" RECURSIVE=true_ |
| COPY | /S | - | copies current background image to the folder set in script config/prefs |
| DELETE | /O | - | deletes current background image file and rebuilds the list |
| OPEN | /O | - | opens folder of the background in current lister |
| NEWTAB | /O | - | opens folder of the background in a new tab |
| CLIP | /K | fullpath, path, fullname, name, image | copies path and/or name, or the image to clipboard |
| SHOW\_IN\_VIEWER | /O | - | show current image in standalone viewer |
| SLIDESHOW\_IN\_VIEWER | /O | - | slideshow of current image (and any images in same folder) in standalone viewer |

##### Notes:

- The Recursive overide is useful when the config/prefs recusive mode is off but you have a folder of folders that you would like to see all the images of (Photo shoot folders for instance)
- The basic start/stop command will use the last path used (as set by using the command with the PATH argument). This behaviour can be changed in the script config/prefs.
- Can be used in a [dynamic button](https://docs.dopus.com/doku.php?id=customize:creating_your_own_buttons:editing_the_toolbar:dynamic_buttons) using **FOLDERCONTENT** , as shown in the video, see below for an example.
- Random Mode 2 relies on reducing a seperate list of indexes of the images, this means if adding or removing images from the folder being used, that blank backgrounds might be displayed or new images not displayed - until the list is rebuilt, which happens either when the original list reduces to zero or the path is changed to another one and then back.
- Script config/pref changes are applied when slideshow is on or off.
- Static and Dynamic modes are for internal compilation of the image list. Dynamic mode reads the image folder(s) before every background change - this allows for adding/deleting/renaming images. Static mode reads the folder(s) one time and the background changes will not reflect any additions/deletions/renames of images in the folder(s).
- Using the **OnPeriodicTimer()** method for slideshow duration means the script is not always running.

##### Example commands

- TO START/STOP SLIDESHOW  
`BackgroundChanger`

- TO START SLIDESHOW OF A FOLDER  
`BackgroundChanger PATH="C:\My Latest Photo Shoot"`

- TO START SLIDESHOW OF A FOLDER - RECURSIVE OVERIDE  
`BackgroundChanger PATH="C:\My Latest Photo Shoot" RECURSIVE=true`  
or  
`BackgroundChanger PATH="C:\My Latest Photo Shoot" RECURSIVE`

- THIS MIGHT BE USEFUL IF SCRIPT CONFIG RECURSIVE IS ALWAYS ON AND YOU DONT WANT A SPECIFIC FOLDER TO BE RECURSIVE  
`BackgroundChanger PATH="C:\My Latest Photo Shoot" RECURSIVE=false`

- PUT THIS AS FIRST BUTTON INSIDE A MENU BUTTON WILL LIST ALL FOLDERS, CLICKING ONE WILL START THE SLIDESHOW

```auto
GO "C:\My Photos" FOLDERCONTENT=embeddedcmddirs,nofiles
[BackgroundChanger PATH={f!|noext}]

```

- TO RESET THE PATH TO THE DEFAULT PATH  
`BackgroundChanger RESET`

- TO DELETE PERSISTANT AND SESSION VARIABLES (IF YOU WANT TO DELETE OR DISABLE THE SCRIPT)  
`BackgroundChanger TIDYUP`

- TO COPY THE CURRENT IMAGE TO PATH SET IN PREFS  
`BackgroundChanger COPY`

- TO OPEN THE IMAGE IN CURRENT LISTER  
`BackgroundChanger OPEN`

- TO OPEN THE IMAGE IN A NEW TAB  
`BackgroundChanger NEWTAB`

- TO COPY THE CURRENT IMAGES 'FULL PATHNAME' TO CLIPBOARD   
`BackgroundChanger CLIP=fullpath`

- TO COPY THE CURRENT IMAGES 'PATH ONLY' TO CLIPBOARD  
`BackgroundChanger CLIP=path`

- TO COPY THE CURRENT IMAGES 'FULL NAME' TO CLIPBOARD  
`BackgroundChanger CLIP=fullname`

- TO COPY THE CURRENT IMAGES 'NAME ONLY' TO CLIPBOARD  
`BackgroundChanger CLIP=name`

- TO COPY THE CURRENT IMAGE TO CLIPBOARD  
`BackgroundChanger CLIP=image`

- TO OPEN THE CURRENT IMAGE IN THE STANDALONE VIEWER  
`BackgroundChanger SHOW_IN_VIEWER`

- TO OPEN THE CURRENT IMAGE IN THE STANDALONE VIEWER AS SLIDESHOW  
`BackgroundChanger SLIDESHOW_IN_VIEWER`

- TO DELETE THE CURRENT BACKGROUND IMAGE FILE  
`BackgroundChanger DELETE`

##### ⚠ Warning

Use at own risk.  
This script can produce strange visual effects in the lister when -  
scrolling **and** when fade transition is on **and** delay is short.

##### Uninstalling or Disabling

Before deleting or disabling the script, run the command  
`BackgroundChanger TIDYUP`  
Not neccessary but keeps things tidy 🙂

Enjoy 🙂

---

<div class="post-metadata">

**Author:** ![Micky](https://resource.dopus.com/user_avatar/resource.dopus.com/micky/32/33090_2.png) [@Micky](https://resource.dopus.com/u/Micky)\
**Post date:** [August 2, 2024, 10:36am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/2 "2024-08-02T10:36:39Z")

</div>

WOW - impressed! 👌👌

Although not of real usage for me at the moment

---

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [August 3, 2024, 7:19am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/3 "2024-08-03T07:19:20Z")

</div>

Version 1.1 posted above.  
bugfix: default path double backslashes for JScript paths  
bugfix: RESET path wasn't resetting index

---

<div class="post-metadata">

**Author:** ![Lagers](https://resource.dopus.com/user_avatar/resource.dopus.com/lagers/32/39455_2.png) [@Lagers](https://resource.dopus.com/u/Lagers)\
**Post date:** [August 3, 2024, 9:49am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/4 "2024-08-03T09:49:00Z")

</div>

What an interesting script you have made. 😃

Come up with an idea but maybe the script can already do it? (Haven't installed it yet):

When you select an image file, he changes the background to that image and when you deselect it becomes the default background. In this way, there will be a built-in image viewer in the lister. Maybe takes some CPU power when you select whether to run the script to see if it's an image.

Unfortunately, I can't program the script myself, but maybe someone can solve it.

---

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [August 3, 2024, 2:41pm UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/5 "2024-08-03T14:41:27Z")

</div>

Good idea, unfortunately there is no way to retrieve the default image name or the the options which have been set for it ☹

(some time later .....)  
Thinking about it some more, there are also problems with no events being triggered when an item(s) is selected in a lister.

as for setting the currently selected image as the background I already have a button set up for that 🙂  
here you go : (update: try this one) [Set Selected Image as Background.dcf](https://resource.dopus.com/uploads/short-url/n5s8p2toYPcgqk9zyBCeXWcjbOm.dcf) (1.2 KB)

Opacity levels might need changing. Easy enough to duplicate the button and set up a 'default' background button.

---

<div class="post-metadata">

**Author:** ![Lagers](https://resource.dopus.com/user_avatar/resource.dopus.com/lagers/32/39455_2.png) [@Lagers](https://resource.dopus.com/u/Lagers)\
**Post date:** [August 3, 2024, 7:11pm UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/6 "2024-08-03T19:11:07Z")

</div>

Too bad there are no events when you select a file. Would be a nice feature otherwise to be able to use the background for a preview of images.  
Maybe something for @Leo , @jon could add in the future?

Thanks for the button, will try it.

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [August 3, 2024, 7:20pm UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/7 "2024-08-03T19:20:47Z")

</div>

[Dialog](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_objects:dialog).WatchTab()

---

<div class="post-metadata">

**Author:** ![Zion](https://resource.dopus.com/user_avatar/resource.dopus.com/zion/32/44060_2.png) [@Zion](https://resource.dopus.com/u/Zion)\
**Post date:** [August 5, 2024, 4:46pm UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/8 "2024-08-05T16:46:33Z")

</div>

Slick Script, now I have animated backgrounds. Opus is crazy!

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [August 9, 2024, 11:51pm UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/9 "2024-08-09T23:51:31Z")

</div>

You might want to consider switching to use the new [OnPeriodicTimer](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_events:onperiodictimer) event in 13.9.4. It lets your script get called at regular intervals without it having to sit in the background running all the time.

---

<div class="post-metadata">

**Author:** ![Zion](https://resource.dopus.com/user_avatar/resource.dopus.com/zion/32/44060_2.png) [@Zion](https://resource.dopus.com/u/Zion)\
**Post date:** [August 11, 2024, 5:30am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/10 "2024-08-11T05:30:57Z")

</div>

> [@Jon](#):
>
> You might want to consider switching to use the new [OnPeriodicTimer](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_events:onperiodictimer) event in 13.9.4.

Any example scripts of this OnPeriodicTimer?

---

<div class="post-metadata">

**Author:** ![jfour18](https://resource.dopus.com/user_avatar/resource.dopus.com/jfour18/32/66032_2.png) [@jfour18](https://resource.dopus.com/u/jfour18)\
**Post date:** [July 29, 2025, 12:59am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/11 "2025-07-29T00:59:40Z")

</div>

Awesome script.

I love 'Bing Wallpapers' but have noticed that I am never actually on the desktop to see the images.

I have created two quality of life changes:

1. Rather than pointing the script at the Bing Wallpapers folder, I created a button which copies the wallpapers to a separate folder, so that I have previous images as well as the current rotation. I pointed your script at this folder.
2. I also created a script which copies the images to my chosen folder periodically (I cannot recall which of these I actually use).
3. Finally, I created a button that I have linked to [space,space] which changes the current wallpaper (useful when it has poor contrast with what I am doing at that moment).

Will need to adjust paths.

 ![Wallpaper](https://resource.dopus.com/uploads/default/original/3X/f/8/f80fb8782f32758e01720932b2606d1ebaaa6385.jpeg)

[Sync Wallpapers.dcf](https://resource.dopus.com/uploads/short-url/uj800bs08vsu3EfUOsCxn7nMz3N.dcf) (2.9 KB)

[Change Background.dcf](https://resource.dopus.com/uploads/short-url/wszrHBVFrdCuwGTRHkm7tYyGhLy.dcf) (393 Bytes)

[copy\_bingwallpaper\_share.opusscriptinstall](https://resource.dopus.com/uploads/short-url/xeNVrChu74cbnPON4WGdLNeC74S.opusscript) (1.2 KB)

---

<div class="post-metadata">

**Author:** ![Ms3o](https://resource.dopus.com/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@Ms3o](https://resource.dopus.com/u/Ms3o)\
**Post date:** [July 29, 2025, 1:06am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/12 "2025-07-29T01:06:54Z")

</div>

First of, thank you!!!!  
Second, is there a chance you can make chose a picture with gradient color and only change the gradient or the color?

---

<div class="post-metadata">

**Author:** ![jfour18](https://resource.dopus.com/user_avatar/resource.dopus.com/jfour18/32/66032_2.png) [@jfour18](https://resource.dopus.com/u/jfour18)\
**Post date:** [July 29, 2025, 1:15am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/13 "2025-07-29T01:15:01Z")

</div>

I think if you just fill the target folder with various images (with slight variations in gradient/color) it should work as intended.

Otherwise, I think the original script also allows animated wallpapers, so if you had a video of a naturally changing wallpaper, that should work as well.

---

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [July 29, 2025, 2:18am UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/14 "2025-07-29T02:18:21Z")

</div>

No animated wallpapers or videos, though an excellent idea, can always put a feature request in, in the Help forum.  
As for changing gradients that is also not possible, the workaround suggested by @jfour18 is best solution - fill a folder with gradients you like and use that for the background slideshow.

---

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [July 8, 2026, 7:39pm UTC](https://resource.dopus.com/t/background-changer-v1-2/52091/15 "2026-07-08T19:39:06Z")

</div>

8-7-2026  
v13.24.1  
re-download, plus updated `Clear background` button.

- Fixed issue with new SVG backgrounds not clearing properly.
