You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Automator: selecting specific file types

Sequoia 15.1


I have successfully created a folder called "Desktop Stuff" - the only folder located on my desktop, which I have linked to iCloud - and created a Folder Action Automator workflow that moves anything dropped onto my desktop to Desktop Stuff. I turned it into a folder action, and it keeps my desktop tidy, automatically!


Now, I would like to start automatically sorting the files sent to Desktop Stuff into subfolders that hold specific file types. For example, if I drop a photo (of any format) onto the desktop, I want it to first move to Desktop Stuff and then into "pics", a subfolder in Desktop Stuff. Similarly for links, PDFs, etc. Anything that doesn't fit neatly into "pics" or "pdfs" or whatnot can just live in Desktop Stuff.


The Automator workflow for Desktop Stuff is simply "Folder Action receives files and folders added to 'Desktop'", "Move Finder Items" to: "Desktop Stuff". AND THAT'S IT - it takes everything. How do I select for specific file types? For example, I want to move all links (or filetypes .webloc) to a folder called "Links" in Desktop Stuff.

Mac Studio, macOS 15.1

Posted on Nov 18, 2024 6:23 PM

Reply
5 replies

Nov 18, 2024 9:45 PM in response to Niel

try
do shell script "mv ~/Desktop\\ Stuff/*.webloc ~/Desktop/Desktop\\ Stuff/Links"
end try


Sorry, it didn't work. Even if it had worked, it's hyperspecific to an exact file type. My question is about modifying an Automator workflow to be able to select whatever kinds of files I mean to select. I don't know how to filter for file types in Automator. Does it really require a script?


I tried different permutations of your script (did you mistype it?), but no arrangement, rearrangement or respelling of your script moved .webloc links from the "Desktop Stuff" folder to the "Links" folder.


If it helps, I have attached a screenshot of the path in Finder.


Automator: selecting specific file types

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.