Skip to main content
added 194 characters in body
Source Link
adayzdone
  • 1.9k
  • 11
  • 11

Exiftool is a great tool to extract metadata. http://www.sno.phy.queensu.ca/~phil/exiftool/ This script should point you in the right direction.

set thePath to POSIX path of (path to documents folder) & "exifdata"
do shell script "mkdir -p " & quoted form of POSIX path of thePath

tell application "Finder" to set theSelection to selection
repeat with anItem in theSelection
    set theLocation to POSIX path of (anItem as text)
    set {name:fileName, name extension:nameExtension} to anItem
    set baseName to text 1 thru ((get offset of "." & nameExtension in fileName) - 1) of fileName
    set destLocation to quoted form of (thePath & "/" & baseName & ".txt")
    do shell script "exiftool -a " & quoted form of theLocation & " >" & destLocation
    do shell script "open " & destLocation
end repeat

Or another approach is :

set myFile to quoted form of (POSIX path of (path to desktop as text) & "movie.mp4")

set xxx to every paragraph of (do shell script "mdls " & myFile)

Exiftool is a great tool to extract metadata. http://www.sno.phy.queensu.ca/~phil/exiftool/ This script should point you in the right direction.

set thePath to POSIX path of (path to documents folder) & "exifdata"
do shell script "mkdir -p " & quoted form of POSIX path of thePath

tell application "Finder" to set theSelection to selection
repeat with anItem in theSelection
    set theLocation to POSIX path of (anItem as text)
    set {name:fileName, name extension:nameExtension} to anItem
    set baseName to text 1 thru ((get offset of "." & nameExtension in fileName) - 1) of fileName
    set destLocation to quoted form of (thePath & "/" & baseName & ".txt")
    do shell script "exiftool -a " & quoted form of theLocation & " >" & destLocation
    do shell script "open " & destLocation
end repeat

Exiftool is a great tool to extract metadata. http://www.sno.phy.queensu.ca/~phil/exiftool/ This script should point you in the right direction.

set thePath to POSIX path of (path to documents folder) & "exifdata"
do shell script "mkdir -p " & quoted form of POSIX path of thePath

tell application "Finder" to set theSelection to selection
repeat with anItem in theSelection
    set theLocation to POSIX path of (anItem as text)
    set {name:fileName, name extension:nameExtension} to anItem
    set baseName to text 1 thru ((get offset of "." & nameExtension in fileName) - 1) of fileName
    set destLocation to quoted form of (thePath & "/" & baseName & ".txt")
    do shell script "exiftool -a " & quoted form of theLocation & " >" & destLocation
    do shell script "open " & destLocation
end repeat

Or another approach is :

set myFile to quoted form of (POSIX path of (path to desktop as text) & "movie.mp4")

set xxx to every paragraph of (do shell script "mdls " & myFile)
Source Link
adayzdone
  • 1.9k
  • 11
  • 11

Exiftool is a great tool to extract metadata. http://www.sno.phy.queensu.ca/~phil/exiftool/ This script should point you in the right direction.

set thePath to POSIX path of (path to documents folder) & "exifdata"
do shell script "mkdir -p " & quoted form of POSIX path of thePath

tell application "Finder" to set theSelection to selection
repeat with anItem in theSelection
    set theLocation to POSIX path of (anItem as text)
    set {name:fileName, name extension:nameExtension} to anItem
    set baseName to text 1 thru ((get offset of "." & nameExtension in fileName) - 1) of fileName
    set destLocation to quoted form of (thePath & "/" & baseName & ".txt")
    do shell script "exiftool -a " & quoted form of theLocation & " >" & destLocation
    do shell script "open " & destLocation
end repeat