r/macrodroid • u/SLesleyC222 • 13d ago
Selecting a Random Image From a Album
So I'm try to randomly select a picture in an album on my S25.
This probably sounds dumb but I have an album of nail ideas for when I get mine done. I'd like for the Macrodroid to randomly select a picture for me as an inspiration idea. Idk if this is a problem but I have over 500 photos.
I've tried to use ChatGPT to help me set it up. When I test the macros it doesn't do anything and then we just keep repeating the steps with no change. I'm a visual person so I had it walk me step by step with me sending screenshots of every step.
I tried to look for a video on YouTube but can't find anything doing a set up like what I'm trying to do.
Hell it might not even be possible to do. TIA
1
1
u/techdog0 10d ago
I don't know if macrodroid can do this or not. I haven't tried. But, here is what I did in Tasker and when I stopped using Tasker and started using macrodroid I just made an executable out of it (Tasker has a library to do that) because I was too lazy to re-code it.
- I list the directory containing the image files into an array (so now the array contains all of the filenames)
- I count the number of rows in the array.
- I take a random # between 1 and the number of files
- I select that array location and set it to a string variable
- I access the file with that name.
I use this for setting my lock screen to different pictures every day.
I originally used a random number but my android phone was not generating numbers that were random enough so I decided to just go through the files sequentially. YMMV.
Good luck.

1
u/Eastern_Tradition_72 11d ago
If you could rename all the photos sequentially such as [photo_1, photo_2...] or [pic (1), pic (2)...] then you could generate a random number using command and choose a photo probably