You might need to go into the Security and Privacy system preference and give Automator full disk access.