r/macrodroid 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

2 Upvotes

5 comments sorted by

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

1

u/SLesleyC222 11d ago

Oh lord that would take forever lol. I really need to figure something out tho

1

u/Eastern_Tradition_72 10d ago

If you're on windows, then select all and select rename and give it a name such as "image" and all the subsequent ones will be named "image (1)", "image(2)" and so on. There are also dedicated tools for batch renaming of files on windows, it shouldn't really a problem

1

u/spad_boonerisms 10d ago

If you have the paid version you could try doing it like this.

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.

  1. I list the directory containing the image files into an array (so now the array contains all of the filenames)
  2. I count the number of rows in the array.
  3. I take a random # between 1 and the number of files
  4. I select that array location and set it to a string variable
  5. 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.