Extended the script to use native Automator script in a Mac.