Jump to content
sr_navarre

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?

Share this post


Link to post

It's all possible, but it doesn't have a whole lot to do with Alfred.

 

You can use Alfred to select the folder/enter the numbers and filetypes, but you'll have to write a script to do 99% of it.

 

Share this post


Link to post

Hey claui,

 

This is fantastic. Thanks so much for tackling this. This stuff is obviously way over my head, but I think this will be a very useful workflow.

 

Is there a way to make it work with subfolders? 

 

Thanks again for the work.

Share this post


Link to post

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.

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...