Automator - 'Filter finder items' working really slowly

I've created an app that goes through my Pictures-folder, picks PDF:s and moves them to another folder. This has been working fine, but few times now the app has mysteriously broken and I have been forced to make some changes. This happened again few days ago and now I'm trying to tweak the app to get it working again.


I have a couple of problems with different approaches:


1. 'Find Finder Items' (from Pictures-folder) that are PDF -> has worked before, but now includes subfolders and I don't want that

2. 'Get Specific Finder Items' to chose the Pictures-folder -> 'Get Folder Contents' (ignoring subfolders) -> 'Find Finder Items' that are PDF -> still includes PDF:s from all subfolders

3. 'Get Specific Finder Items' to chose the Pictures-folder -> 'Filter Finder Items' that are PDF -> works as intended, but lasts close to half a minute although 'Get Specific Finder Items' gives only 20 items to filter from


What am I doing wrong? Is 'Filter Finder Items' really that slow?

Posted on Apr 16, 2018 3:15 AM

Reply

Similar questions

1 reply

Apr 16, 2018 5:47 AM in response to Joni-Pekka Luomala

Here is a 3-action Automator workflow that passes the Picture folder into the Ruby application as an argument. Ruby simply gets the text path of every PDF in the main Picture folder, and prints (puts) these as output into the Move Finder Items action. This is tested, and you will find it significantly faster than what you have been doing.

User uploaded file

Here is the Ruby code, which you should copy/paste into a programmer's editor that understands proper indentation (e.g. BBEdit, Sublime Text, etc.). Do not copy and paste this into TextEdit, it will destroy the Ruby indentation.


require 'pathname' # process each passed foldername argument, and output as string (to_s), # the found .pdf paths. # Both recursive and non-recursive (default) solutions are provided ARGV.each do |f| # recursive folder hierarchy of all .pdf # puts Pathname.glob("#{f}/**/*.pdf").select(&:to_s) # Non-recursive first level folder content puts Pathname.glob("#{f}/*.pdf").select(&:to_s) end

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator - 'Filter finder items' working really slowly

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