How to open a random file within a specifed folder?

Dm114

Well-known member
Everything is now ok.

When you launch the macro, how Array variable is populated? It should contains all the file names (without the ".html" extension).
If so now configure the last action: Open file

Manually select the (test) folder and select your browser in the list
 

J1021

Member
If so now configure the last action: Open file

Manually select the (test) folder and select your browser in the list
HALLELUJAH!!!!!!

This macro that is now working is the one that only has a few files on my device's main storage folder.

When I tried it on the main folder on my sdcard, macrodroid froze and stopped working.

I'll keep trying.

Thank you so incredibly much for your help!
I'm so glad you got your success!!
 

Dm114

Well-known member
HALLELUJAH!!!!!!

This macro that is now working is the one that only has a few files on my device's main storage folder.

When I tried it on the main folder on my sdcard, macrodroid froze and stopped working.

I'll keep trying.

Thank you so incredibly much for your help!
I'm so glad you got your success!!
No, I don't think MacroDroid froze but it takes a very l long time to load such huge amount of data and Android askd to continue running or cancelling the faulty app.

Anyway you should shorten file names if possible or split these files in several folders.
 

J1021

Member
No, I don't think MacroDroid froze but it takes a very l long time to load such huge amount of data and Android askd to continue running or cancelling the faulty app.

Anyway you should shorten file names if possible or split these files in several folders.
If I split my files into different folders within the "blog" folder, will it still be able to see the html files contained in the subfolders?

Thank you so so much.
 

Dm114

Well-known member
HALLELUJAH!!!!!!

Thank you so incredibly much for your help!
I'm so glad you got your success!!
You're welcome!
It was (almost) a pleasure 😁😁

Be very careful when writing: any mistake undoubtedly leads to errors (not always easy to find out)...

Good luck!
 

J1021

Member
You're welcome!
It was (almost) a pleasure 😁😁

Be very careful when writing: any mistake undoubtedly leads to errors (not always easy to find out)...

Good luck!
If I split my files into different folders within the "blog" folder, will it still be able to see the html files contained in the subfolders?

Is there any way to award you on this forum?
Just liking your messages? Any other way?

Also, when I run this macro, so far 10 times, 8 of them are the same webpage from the top of the list of html files. The other 2 are the second webpage.
 

Dm114

Well-known member
If I split my files into different folders within the "blog" folder, will it still be able to see the html files contained in the subfolders?

Thank you so so much.
The answer is NO.

But, first of all, you should rename/simplify the path. Do you really need all these subfolders with such weird names?

Suggestion to split: you could create subfolders with a number (e.g. ..../blog/0, .../blog/1 and so on). Then you'll begin the macro with a routine to randomly select the numerical sub-sub-folder. But it's another "masterpiece"! πŸ˜€
 

J1021

Member
The answer is NO.

But, first of all, you should rename/simplify the path. Do you really need all these subfolders with such weird names?

Suggestion to split: you could create subfolders with a number (e.g. ..../blog/0, .../blog/1 and so on). Then you'll begin the macro with a routine to randomly select the numerical sub-sub-folder. But it's another "masterpiece"! πŸ˜€
I'll work on my subfolders and the names of the files.
I'll just do that manually lol

Is there any way to award you on this forum?
Just liking your messages? Any other way?

Also, when I run this macro, so far 10 times, 8 of them are the same webpage from the top of the list of html files. The other 2 are the second webpage.
 

Dm114

Well-known member
If I split my files into different folders within the "blog" folder, will it still be able to see the html files contained in the subfolders?

Is there any way to award you on this forum?
Just liking your messages? Any other way?

Also, when I run this macro, so far 10 times, 8 of them are the same webpage from the top of the list of html files. The other 2 are the second webpage.
My best reward is your satisfaction
(and a few likes if you want). But I don't compete in this forum πŸ˜‰πŸ˜€

According to the random numbers, the widest is the range, the best is the generation. So if you only have a small number of items, the "abnormal" repetition is not surprising... Random function is a system one and the same problem occurs whatever the system in this particular case.
 

J1021

Member
My best reward is your satisfaction
(and a few likes if you want). But I don't compete in this forum πŸ˜‰πŸ˜€

According to the random numbers, the widest is the range, the best is the generation. So if you only have a small number of items, the "abnormal" repetition is not surprising... Random function is a system one and the same problem occurs whatever the system iin this particular case.
That's so kind of you to say! I'll go back and like all of your replies to me!
Every little helps.

The macro that is now showing the same files is the one on my sd card with 16,000 items in the folder.
 

Dm114

Well-known member
That's so kind of you to say! I'll go back and like all of your replies to me!
Every little helps.

The macro that is now showing the same files is the one on my sd card with 16,000 items in the folder.
In fact the random number accuracy depends on the number of items in the variable Array. I don't believe you have populated 16000 items.. πŸ€”
 
Top