Mac/Automator - How to ignore subfolders in search?


Recommended Posts

I'd like to setup a workflow to organize my Mac's Downloads folder. I'm starting with moving all the images to the Pictures folder, but I don't want to move the images that are in subfolders, because I download many things that include images with them, and I don't want those images being separated from the folder they belong in.

For example, if I have downloaded a Wordpress theme, I want those images to stay in their theme folder instead of being moved to "Pictures".

So how do I make finder (within automator) only select the immediate images in the downloads folder and ignore subfolders?

I realize it would be easy for me to sort by "kind" and move them all manually. I'm just fooling around with Automator, and maybe I'll set this as a future automatic, periodic task.

I'd like to setup a workflow to organize my Mac's Downloads folder. I'm starting with moving all the images to the Pictures folder, but I don't want to move the images that are in subfolders, because I download many things that include images with them, and I don't want those images being separated from the folder they belong in.

For example, if I have downloaded a Wordpress theme, I want those images to stay in their theme folder instead of being moved to "Pictures".

So how do I make finder (within automator) only select the immediate images in the downloads folder and ignore subfolders?

I realize it would be easy for me to sort by "kind" and move them all manually. I'm just fooling around with Automator, and maybe I'll set this as a future automatic, periodic task.

Try this. This seems to be working.

You run the app, and select a folder. The app looks for jpg in that folder only, and ignores any subfolder. Then it moves the jpf files found to the Pictures folder.

Try this. This seems to be working.

You run the app, and select a folder. The app looks for jpg in that folder only, and ignores any subfolder. Then it moves the jpf files found to the Pictures folder.

Thank you! That works, except in your screenshot it doesn't show to select "folders" in the "Ask for finder items" step. I think this is a huge step in the right direction. Now to find a way to do it that does not involve any interaction from me (selecting the folder every time it runs).

EDIT: I replaced the first rule (Ask for finder items) with the "Find finder items" where the KIND is Folder and the Name is Downloads (searching under my home directory). You got me to that point though. Thanks again!

Yes, sorry. I forgot to mention that you had to change files to folder. I took the screenshot before changing it, and just told myself that I would tell you, but obviously forgot.

Thank you! That works, except in your screenshot it doesn't show to select "folders" in the "Ask for finder items" step. I think this is a huge step in the right direction. Now to find a way to do it that does not involve any interaction from me (selecting the folder every time it runs).

  • 8 months later...

Hi Einsteinbqat,

 

First of all, thanks for the info. This workflow worked well for me. I have one glitch that I'm stuck on & was hoping that you may have some insight.

 

It's the same basic scenario, aside from I'm doing this multiple times with various file types and I'm trying to get a single workflow to accomplish it. As long as I have at least one of each file type, it works great, but if I don't have one, then it stops the script. IE: moving pdf, then jpg, then dwg would stop if there was no pdf to move.

 

I would like to be able to skip the move pdf action if a pdf isn't present to move for example & have the workflow continue.

 

I have a modified applescript that disables the move action, but it's a bit clunky & althopugh it seemed to work from within automator, it glitches when running the app.

 

Any help is greatly appreciated.

 

Thanks,

bhsoundman

 

Sorry for the late reply. I didn't see that you wrote something to me. I'll answer later tonight.

Hi Einsteinbqat,

First of all, thanks for the info. This workflow worked well for me. I have one glitch that I'm stuck on & was hoping that you may have some insight.

It's the same basic scenario, aside from I'm doing this multiple times with various file types and I'm trying to get a single workflow to accomplish it. As long as I have at least one of each file type, it works great, but if I don't have one, then it stops the script. IE: moving pdf, then jpg, then dwg would stop if there was no pdf to move.

I would like to be able to skip the move pdf action if a pdf isn't present to move for example & have the workflow continue.

I have a modified applescript that disables the move action, but it's a bit clunky & althopugh it seemed to work from within automator, it glitches when running the app.

Any help is greatly appreciated.

Thanks,

bhsoundman

You mean that you want to move different filetypes to different folders with one single workflow?

 

The easiest way would be to create multiple workflows (i.e. one for each filetype), and then creating one global workflow to execute the individual workflows.

 

You would not need to use any AppleScript.

This topic is now closed to further replies.
  • Posts

    • iPhone 18 Pro drop-test video and photos leak on the dark web following a data breach by Hamid Ganji iPhone 17 Pro - Image via Apple Apple is seemingly facing one of the biggest data breaches in its history, and just a few months before the official debut of the iPhone 18 Pro series, photos, a drop-test video, a supplier list, and key phone components have reportedly been leaked by hackers. Last week, we reported that Tata Electronics, an Apple supplier and iPhone producer in India, was hit by a data breach. As a result, it was reported that more than 200,000 trade secrets and confidential documents belonging to Apple and Tesla were stolen by the ransomware group World Leaks. According to Reuters, the group has now leaked supplier lists, component details, and photos of the upcoming iPhone 18 Pro models on the dark web. One of the materials leaked by the hackers is a drop-test video of the iPhone 18 Pro, which is due to launch this September. The phone is shown in a gray color and has the same familiar design we saw on last year's iPhone 17 Pro series. The device also appears to be quite durable, though it seems to be thicker than last year's model. One possible explanation is that Apple may be using a larger battery in the iPhone 18 Pro series. Moreover, Reuters says it has seen at least six documents mapping many components in the iPhone 18 Pro models to their respective suppliers, including details on chips on the main circuit board and on battery and camera components. The documents reportedly detail hundreds of parts that will be used in the iPhone 18 Pro models. A person familiar with the matter told the outlet that Apple classifies this data as sensitive and “is concerned about the documents being shared on the dark web as they relate to unreleased models.” Apple is reportedly investigating the issue but has yet to issue an official statement.
    • You do you, I've just said that it first appeared in "home" version before it will be available in "work" one. I use Edge only because it still supports MV2 uBO extension even on Android - I'll switch when they stop.
    • I imagine that was a review or something? My reviews mostly contain a lot of images and galleries, but these are all webp too, but yeah it all adds up on the page load. Would help if you were more helpful with your critique instead of bitching and moaning like a Karen 😂 Because then we might be able to fix it for you.
    • If Valve refused to let them make the case, I wonder if they've already partnered with someone else to do it? The fact that they didn't seek permission/licence before diving straight in is incredible though
  • Recent Achievements

    • First Post
      rosiecharles earned a badge
      First Post
    • Reacting Well
      Juan Dela earned a badge
      Reacting Well
    • Week One Done
      Collagen Project earned a badge
      Week One Done
    • Reacting Well
      Wakeen1966 earned a badge
      Reacting Well
    • Rookie
      Almohandis went up a rank
      Rookie
  • Popular Contributors

    1. 1
      +primortal
      516
    2. 2
      +Edouard
      273
    3. 3
      PsYcHoKiLLa
      142
    4. 4
      Steven P.
      100
    5. 5
      macoman
      54
  • Tell a friend

    Love Neowin? Tell a friend!