I am using Catalina. I want to create an application using Applescript which which will remove metadata from dropped image files (onto its icon) using the unix utility exiftool.

I tried the following application in Automator but the AppleScript doesn't work (doesn't remove the metadata):

on open myFiles
    set bash_path_file to the POSIX path of myFiles
    do shell script "/usr/local/bin/exiftool -all= " & quoted form of bash_path_file
end open

I've researched many applescripts using google search and over here but none seem to work. So I'm doing something wrong. Any help would be appreciated.

  • Great question. Solution from @user3439894 works perfectly too. – FiddleDeDee Nov 20 '19 at 13:52

To make an ApplesScript droplet app, save the following example AppleScript code in Script Editor as an application:

on open droppedItems
    repeat with droppedItem in droppedItems
        do shell script "/usr/local/bin/exiftool -all= " & ¬
            quoted form of POSIX path of droppedItem
    end repeat
end open

Now drag and drop the target file(s) onto the app's icon to process the file(s).

Note: The example AppleScript code is just that and does not contain any error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors.

| improve this answer | |
  • Thanks I’ll try it – sd100 Nov 20 '19 at 10:48
  • This works perfectly. I've learned something! – FiddleDeDee Nov 20 '19 at 13:52
  • So why isn't the script above not working with two options in the exiftool: do shell script "/usr/local/bin/exiftool -overwrite_original -all=" – sd100 Dec 2 '19 at 0:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .