• 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: Christopher Stone <email@hidden>
  • Date: Thu, 13 Oct 2011 16:49:55 -0500

On Oct 12, 2011, at 10:57, Jan Erik Moström wrote:
On Tuesday, October 11, 2011 at 21:15 , Christopher Stone wrote:
If you're willing to go to an osax why not use ExifTool? And for that matter what's wrong with 'mdls'? It works, and it's built in to the system. It is a little tedious to parse out the data, but it's not hard.

I'm going to blame not being a native English speaker for coming across wrong :)
______________________________________________________________________

Hey Jan,

I certainly didn't intend to come across as short-tempered; I was simply asking questions.

And there's a big difference between wrong and unclear.

I have nothing against 'mdls' at all, it's actually on the top of my list. With ExifTool as my second choice.

I think ExifTool is easier to parse, but 'mdls' is built-in and has the additional faculty of producing a null result when named items are called.

I just want to see what different alternatives I have before actually sitting down to do anything

Not unreasonable.  :)

For my own use I'd employ the Satimage.osax
This is exactly what I've considered using.

Okay.  I've gotten around to writing it using the Satimage.osax:

-ccs

------------------------------------------------------------------------------------------------
# » cng() : Change - Satimage.osax                                   MODIFIED 2011-08-31 : 20:16
------------------------------------------------------------------------------------------------
on cng(findText, changeText, srcData)
change findText into changeText in srcData with regexp without case sensitive
end cng
------------------------------------------------------------------------------------------------
try
tell application "Finder"
set sel to selection as alias list
if sel ≠ {} then
set fSel to first item of sel
end if
end tell


set posixPath to POSIX path of fSel


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


set infoReco to do shell script cmd
set infoReco to cng("\\(null\\)", "null", infoReco)
set infoReco to cng("(\\()\\r *", "\\1", infoReco)
set infoReco to cng("\\r(\\))", "\\1", infoReco)
set infoReco to cng("\\r {4}", "", infoReco)
set infoReco to cng("[(]", "{", infoReco)
set infoReco to cng("[)]", "}", infoReco)
set infoReco to cng("=", ":", infoReco)
set infoReco to cng("\\A", "{", infoReco)
set infoReco to cng("\\Z", "}", infoReco)
set infoReco to cng("(\\d{4}-\\d{2}-\\d{2}.+)", "\"\\1\"", infoReco)


set infoReco to cng("\\r", ", ", infoReco)
set infoReco to run script infoReco


on error errMsg number errNum
set {cr, sep} to {return, "------------------------------------------"}
set e to sep & cr & "Error: " & errMsg & cr & sep & cr & "Error Number: " & errNum & cr & sep
beep
display dialog e
end try
------------------------------------------------------------------------------------------------

 _______________________________________________
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

  • Follow-Ups:
    • Re: Reading IPTC and EXIF information from photos
      • From: Christopher Stone <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>)
 >Re: Reading IPTC and EXIF information from photos (From: Jan Erik Moström <email@hidden>)

  • Prev by Date: Re: How short can I make it
  • Next by Date: Re: Reading IPTC and EXIF information from photos
  • 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