Sign in to follow this  
Followers 0
sshrum

How do I pull random filenames from a folder

5 posts in this topic

I killed the original thread due to thinking it may confuse everyone. :D

FYI: I'm building a automatic iPod Shuffle fill app.

Given a specific local path ($source), I want to select certain files (*.mp3,*.aac,*.m4p,*.m4a,*.m4b,*.wav) and then randomly select them to move to a defined path on the iPod ($destination). There'll be a total size quota that will tell the script when it has transfered enough to stop ($quota).

The key here is: random files of specific types until a quote size is met.

I've never dealt with files within AutoIT in this manner before and am not sure if this is the best way to go. Anyone have an idea or can help me with this, please let me know.

In the meantime, I'll keep looking. :)

TIA


Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Share this post


Link to post
Share on other sites



Depending on how many possible files there are, you could give them each a place in an array (there's a filesearch fn or something) (place their path and filename as a string), and pick a random index of the array (there's a random fn). Don't want duplicates? Some more code there.

Let me know if you are still working on this. If so, I could help. It sounds kindof interesting.

J


If I am too verbose, just say so. You don't need to run on and on.

Share this post


Link to post
Share on other sites

Man, your program is the best. Just what I was looking for. Thank you.


“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0