Aspect ratio of 16×9

please i have folder in the macintosh hd in mojave os
that call "HIDE PHOTOS DETA A"
inside there is a clips

please i want to make a macro that
delete every clip that is not in the aspect ratio of 16×9

Scanning the folder and deleting files is easy (For Each action, Folder Contents collection, Trash a File action).

The tricky part is determining the aspect ratio. I'm afraid I don't know how to do that, perhaps someone else has some ideas.

Hi! We need to know what kind of clips you want to delete. Avi? RM? RMVB? MP4? M4V? MOV? MKV?
From the internet? Or rendered by Video Processing Application?
In h264? h265? or in professional codec like ProRes, DNxHD?
I see PHOTO in your folder name. Videos or pictures, or both? JPG? TIFF? PNG? JPEG? PSD? EXR?
More information, more possible people can help.

ProRes , MP4

Hi. Let's see:
Step 1, you need to tell KM which folder you want to work with. (setup in "For Each Path In Folder" macro)
Step 2, you do things on files in this folder one file by one file. (also achieve in "For Each Path In Folder" macro)
Step 3, check if the file is MP4. (use "Split Path" macro to extract file extension; use "If then" macro to check if it's MP4.
Step 4, check if the file's aspect ratio is 16x9. (
4a, you can use FFprobe to extract video resolution, the command is "ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 -i /path/to/video.mp4"
4b, you can use AppleScript to run this shell command.(use "execute an applescript" macro)
4c, you can use "Search Using Regular Expression" macro to extract videoWidth and videoHeight.
4d, you can use "Set Variable to Calculatation" to calculate the aspect ratio of the video.
Step 5, check if the aspect ration is 1.778(16/9), (Use "If then" macro), if yes, do nothing, if no, put this video file to trash.
Hope this can give you some ideas!