This Macro, developed under WebGUI 6.2.9, works like a combination of the ^RandomImage macro and the ^i macro.
It returns the path to a random file that is in a specific collateral folder. It was developed so that background images could be rotated randomly.
To install, copy the file to the /data/WebGUI/lib/WebGUI/Macros folder. Then edit your .conf file in /data/WebGUI/etc to add the new Macro to the list of Macros:
RandomImagePath => RandomImagePath, \
(add the back-slash when adding macros, unless the macro is the last one in the list. I had to figure that out the hard way once upon a time).
Then restart the web server.
Usage: ^RandomImagePath("<collateral folder name>");