How Can We Help?
< All Topics

Is there a way to select a random file from a folder

Such as selecting a random wallpaper?

There is not an automatic way to do this. You would need to build a macro to randomly select a file, such as a wallpaper image. To do this you would use the Variable Set Integer command and select the Set a Random Value option. You can set the variable to N1 and then set your random maximum value. If you set this value to 15, then a random number between 0 and 15 would be chosen during macro playback.

In the wallpaper example you would then set up a number of If statements. If N1 = 0, Set Desktop Wallpaper ABC. If N1 = 1, Set Desktop Wallpaper DEF, and so on. When the macro plays, Macro Express will select a random number. The wallpaper that matches the variable, based on the If statements, will then be loaded in.

Using the Duplicate button in the Scripting Editor, this macro could be set up quite rapidly.

– Applies to: Macro Express and Macro Express Pro