2

I want to sort my Downloads folder and want to use Automator for it. The Files & Folders library gives me plenty of options, however I was not able to find an action which let me filter files by their source.

I want to sort files by the URL I downloaded them from. Is there an Automator action I am missing? Or do I have to use Apple Script for that?

The Filter Finder Files gives me the options for filtering by name, date etc., but not by source. How can I accomplish this task?

2
  • What is the real end goal here? Jan 29, 2018 at 19:22
  • @user3439894 I want to say "PDFs downloaded from URL contains "bankname" move to folder "banking""
    – ohboy21
    Jan 30, 2018 at 6:34

1 Answer 1

1

Based on your comment, 'I want to say "PDFs downloaded from URL contains "bank name" move to folder "banking"', here is how I'd do it in Automator:

In Automator, create a new Workflow, adding the following Actions:

Find Finder Items, with settings:

  • Search [Downloads]
  • [All] of the following are true
  • [Kind] [is] [PDF]

Run Shell Script, with settings:

  • Shell [/bin/bash]
  • Pass input [as arguments]
  • Replace the default code with the example code below.

    for f in "$@"; do
        [[ $(mdls -name kMDItemWhereFroms "$f") == *bankname* ]] && echo "$f"
    done
    
  • Note: In the code above, replace "bankname" in *bankname* with the actual bank name in the URL.

Move Finder Items, with settings:

  • To [Banking]   [] Replacing existing files
    • Check Replacing existing files if appropriate.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .