• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reading IPTC and EXIF information from photos
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading IPTC and EXIF information from photos


  • Subject: Re: Reading IPTC and EXIF information from photos
  • From: wayne melrose <email@hidden>
  • Date: Tue, 11 Oct 2011 22:17:51 +0200


On Oct 11, 2011, at 9:15 PM, Christopher Stone wrote:

  set cmd to "mdls \\
  -name kMDItemDescription \\
  -name kMDItemFSCreationDate \\
  -name kMDItemHeadline \\
  -name kMDItemPixelHeight \\
  -name kMDItemPixelWidth \\
  -name kMDItemTitle " & posixPath

  



If you're only using these few items, you can control the output of the script that I supplied very easily, and even simplify what I supplied.




on getMDLSDetails(strFilePath)


set strCommandResult to do shell script "mdls   -name kMDItemDescription   -name kMDItemFSCreationDate   -name kMDItemHeadline   -name kMDItemPixelHeight   -name kMDItemPixelWidth   -name kMDItemTitle " & (quoted form of strFilePath)


set lstItems to paragraphs of strCommandResult
set lstScriptItems to {}
repeat with strLine in lstItems
set strLine to replaceText(strLine, "=", "=\"") & "\""


set strLine to replaceText(strLine, "=", ":")
set lstScriptItems to lstScriptItems & strLine
end repeat
set AppleScript's text item delimiters to ", "


set strScript to lstScriptItems as string
set AppleScript's text item delimiters to ""
set strScript to "{" & strScript & "}"


return run script strScript


end getMDLSDetails

on replaceText(strText, strCharactersToReplace, strReplacementCharacters)
set AppleScript's text item delimiters to strCharactersToReplace
set lstOriginalTextItems to text items of strText
set AppleScript's text item delimiters to strReplacementCharacters
set strResult to lstOriginalTextItems as string
set AppleScript's text item delimiters to ""
return strResult as Unicode text
end replaceText 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Reading IPTC and EXIF information from photos (From: Jan Erik Moström <email@hidden>)
 >Re: Reading IPTC and EXIF information from photos (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Reading IPTC and EXIF information from photos
  • Next by Date: Re: Filter a text string
  • Previous by thread: Re: Reading IPTC and EXIF information from photos
  • Next by thread: Re: Reading IPTC and EXIF information from photos
  • Index(es):
    • Date
    • Thread