Hided alias to the automator actions I'm using
Fixed encoding problems
(Now file paths provided by Automator will be converted to UTF-8)

Changed from ARGF to ARGV and added a line that makes it easier to debug outside Automator