What is the maximum amount of file arguments I can pass to a command? If I do this in OS X, what is the maximum amount of files I can test?

Or is there a maximum length for this string?

do shell script "md5 -q 'path/to/file1.txt' 'path/to/file2.txt'"
getconf ARG_MAX, or currently 262144 bytes.

If you get an argument list too long eror, try using find:

find . -type f -exec md5 -q {} \+


-exec md5 {} \+ and -print0 | xargs -0 md5 pass multiple arguments to md5, so they are usually faster than -exec md5 {} \;.