Jump to content

How can I use Alfred to choose a random selection from a large group of files?

Recommended Posts

I would like to create a workflow that will take a folder of, say, 1000 files and choose a certain number of them at random, which it will then copy into a second folder. Could someone point me in the right direction?


To make things more complicated... what if I wanted to select two different numbers of two different file types? For example, I might want to point Alfred to a folder containing 3,000 files of all different types and have it randomly choose 10 videos and 100 pictures, which it would then copy to another folder.


Is any of this possible?

Link to comment
  • 1 month later...

Hey sr_navarre,


Sorry for my late reply. Just came across your post on /r/Alfred.


Unfortunately, the API I use right now – i. e. the command-line tools mdls and mdfind – are not really designed for this task.

I tried a few ideas to add (at least limited) support for subfolders but got nowhere with that.


Maybe someone more familiar with the Metadata API than me has an idea as to how to implement this quickly? I’ll happily accept pull requests to the alfred-random_file_picker repo.


Link to comment

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
  • Create New...