Error -128 can't be used in El Capitan
For years, I was using this simple Applescript in my Automator applications to silently end workflow if the folder is empty:
on run {input, parameters}
if input is {} then error -128 -- cancel on empty input list
return input
end run
After updating my mac to El Capitan, instead of silently ending the process if folder is empty and proceeding to other task, the process throws out a message "error -128" and stops.
The same automator workflow that includes this script still works ok on my other mac which is on Yosemite. So I guess they changed the way this error is dealt with in El Capitan.
Does anyone knows if there is a workaround or another way how to silently stop an applescript without throwing an error message?
Thank you.
Automator-OTHER, OS X El Capitan (10.11.1)