Move PDF Files From Downloads Folder to Destination Folder


I have been using the program for a very long time and am very satisfied.

Now I get stuck with a new action. The problem: I often get several PDFs in my downloads folder that I then want to move to another folder.

Unfortunately, I have not yet figured out what needs to be entered to move all .pdf.

If I enter a file exactly as it is called, it works. Which character do I have to prefix to move all .pdf?

I hope I have expressed myself comprehensibly.

Can you help me?


Hey Helmut,

You can't prefix anything with Keyboard Maestro's Move or Rename a File action.

It doesn't support wildards.

Which route do you want to take?


Hello, thank you for your answer, but I can't cope with that, it's too complicated for me. Then I have to forget this action, too bad. Merry Christmas, Helmut

The simplest method is to use a Terminal command

mv ~/Downloads/*.pdf ~/Documents/someFolder

You could put this command into a Keyboard Maestro - Run Shell Script action for easy recall

1 Like

With Keyboard Maestro native Actions you are probably almost there.

You could add an If Then Action to test whether the filename ends with ".pdf"
If the filename ends with ".pdf" the file gets moved, otherwise it is ignored.

Bear in mind that this will move all PDFs in the folder. That's the reason I set it up first with a test folder rather than my actual Downloads folder.

(In the Example below, you would replace the first highlighted path with the path to your Downloads folder and the second highlighted path with folder you want to move all PDFs to.)

EXAMPLE Move PDF files from one folder to another.kmmacros (3.6 KB)

But for this sort of task (if you want to do it all the time) I would highly recommend using the App Hazel. You could easily set up a Hazel rule to watch the Downloads folder and move any PDFs to a folder of your choice.


You can do this with Keyboard Maestro as well – it's just a little more fiddly.

You can't cope with answering my question?  :sunglasses:

@alby916 has provided a pure shell script solution.

  • You want to run that from an Execute a Shell Script action.
  • @Zabobon has provided you with a canonical Keyboard Maestro solution.
  • I have provided you with an AppleScripted solution.
    • I prefer AppleScript for this kind of job, because I can Undo it in the Finder if I screw up.
    • Personally I prefer not to run this sort of job automatically. I want to know what I did and when I did it.

Move Files with a Given File Extension to a New Folder (AppleScript) v1.00.kmmacros (13 KB)


1 Like