Created
December 30, 2017 07:22
-
-
Save tjt263/1247bc5fa5258d232c416a81c2464aeb to your computer and use it in GitHub Desktop.
Script for macOS & Canon EOS 650D. Prints the shutter count of the most recent image imported to the Photos.app library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
lastimport() | |
{ | |
find ~/Pictures/Photos\ Library.photoslibrary/Masters -type f -exec | |
stat -f "%m%t%Sm %N" {} + | | |
sort -rn | | |
head -1 | | |
cut -d\ -f5- | |
} | |
lastimport="$(lastimport)" | |
exiftool "$lastimport" | | |
awk '/File Number/ {print $4}' | | |
cut -d\- -f2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script will probably work with other, similar models from the Canon EOS DSLR lineup.
Particularly models that have an APS-C (<full-frame) sensor.
If it doesn't work with your particular model, let me know and I'll fix it ASAP.
I'll just need an example photo taken with your camera to analyze the EXIF metadata.
Cheers.