sr_navarre Posted March 22, 2018 Share Posted March 22, 2018 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
deanishe Posted March 22, 2018 Share Posted March 22, 2018 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. Link to comment
claui Posted March 24, 2018 Share Posted March 24, 2018 I found the task interesting enough that I actually made that workflow. sr_navarre 1 Link to comment
sr_navarre Posted March 25, 2018 Author Share Posted March 25, 2018 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. Link to comment
claui Posted May 15, 2018 Share Posted May 15, 2018 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now