Hello! Thanks for such a great tool. First time using it, and first time posting.
I had already posted this on the Mac Community forum, but since the existing Automator script requires ExifTool to be installed, I wondered if someone here might be able to help.
First, I am thrilled to have found an Automator script written and posted by VikingOSX here:
Script to rename pictures with date and t... - Apple Community (https://discussions.apple.com/thread/253095576?answerId=255805183022#255805183022)
....Which totally works... in renaming HEIC, JPEG, and PNG images to their EXIF date and time data.
However, I also need to rename .MOV files too.
Now, VikingOSX's instructions were excellent. However, in order to get his automator script (app) to work, I had to do one more step. When VikingOSX wrote:
QuoteThen one drags and drops the following actions from their respective Library (in order) to the larger workflow window:
1. Files & Folders > Ask for Finder Items
2. Utilities > Run AppleScript
On that first one, I had to change the "Type" from "Files" to "Folders" as shown:
Before:
(https://discussions.apple.com/content/attachment/84cb834a-6347-4598-bb81-815cc4754aa2)
Choosing:
(https://discussions.apple.com/content/attachment/fc7557a3-3f05-478f-b9e1-2027125847fb)
After:
(https://discussions.apple.com/content/attachment/543eaf26-9889-4bc4-a7f2-992d1589f9b6)
Would anyone here be able to advise me on how to revise the script to also rename .MOV files?
Here's the original script:
property imageKind : {"HEIF Image", "JPEG image"}
property app_icon : "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/MultipleItemsIcon.icns"property imageCnt : (0 as integer)
on run {input, parameters}
set parentdir to input
set EXIFTOOL to (do shell script "PATH=\"/usr/local/bin:/opt/homebrew/bin:$PATH\";/usr/bin/which exiftool")
tell application "Finder"
set img_list to (every item in entire contents of folder parentdir whose kind is in imageKind) as alias list
if img_list = {} then
display alert "No images found" return
end if
repeat with anImage in img_list
set EXT to "." & anImage's name extension
set DTO_string to (do shell script EXIFTOOL & " -s3 -d \"%F %H-%M-%S\" -DateTimeOriginal " & (POSIX path of anImage)'s quoted form)
if not DTO_string = "" then
set outFile to ((parentdir as text) & DTO_string & EXT) as text
set basename to (do shell script "basename " & (outFile's quoted form)'s POSIX path)
set name of anImage to basename
set imageCnt to imageCnt + (1 as integer)
else
log "NO-OP"
end if
end repeat
end tell
display dialog "Processed image count: " & (imageCnt as text) with title "Processing complete" with icon POSIX file app_icon as alias
returnend run