Created
September 12, 2017 22:57
-
-
Save duanemoody/658fcbb925d75c73abd877c9e6f396d2 to your computer and use it in GitHub Desktop.
correct protocol for Automator loop recursing through subfolders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use Pass input: "to stdin", NOT "as arguments" | |
while read f ## NOT "for f in $@" | |
do | |
# file processing code goes here | |
done | |
# Explanation: Apple doesn't document this, but "Pass input: as arguments" has a hard limit of 999 files/folders above which Automator | |
# throws a "Run Shell Script" error; stdin does not have this limit but alters the way the passed array is referenced. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment