I think the issue is that the function errors on each file that does not match. In terminal, I can just ignore these errors, but Hazel may not finish the script because of the errors. I tried using "exit 0;" to force the script to run, but that doesn't help. Here is the code I am running and a screenshot of the setup within Hazel.
Any assistance is much appreciated.
- Code: Select all
my $path = $1;
$path =~ s{/\d{4}-\d{2}-\d{2} __ \d{2}.\d{2}.\d{2} __ \w+ __ \w+\.\w{3}$}{};
exec("/usr/local/bin/exiftool --ext jpg -directory=\"%dJPEG Backup\" -srcfile %d%f.jpg \"$path\"");
exit 0;