Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 11-09-2004, 09:21 AM   #1
thorsten.b.
Prospect
 
Join Date: Aug 2004
Location: Solothurn, Switzerland
Posts: 44
Question search for jpeg comments (finder or exif)

Hi,

is there a easy way to search a folder of jpegs for comments (finder comment or the jpeg comment)? can locate or find do that from the terminal, the finder search does not seem to find comments.

Would be great if this is possible in the terminal or finder using applescript without the need for too many new programs.

thanks, t.
thorsten.b. is offline   Reply With Quote
Old 11-09-2004, 01:28 PM   #2
Pedro Estarque
Triple-A Player
 
Join Date: Jul 2003
Posts: 159
Always wanted that too. I think OS 9 did. Nice simple way to add metadata to a catalog
Pedro Estarque is offline   Reply With Quote
Old 11-12-2004, 02:28 PM   #3
mark hunte
MVP
 
Join Date: Apr 2004
Location: Hello London Calling
Posts: 1,787
I saw you're question the other day and thought to myself that would be handy.

In an unrelated task, seeing what new commands I had in my /sw/bin/ after installing a command for text stuff, after reading another request ( found here ).
I found something called rdjpgcom so I checked it out in terminal. man rdjpgcom

This may very well be what you want. I do not know if this is a standard command with 10.3.6 . As one of the reasons I found it was I decided to man all the commands in the /sw/bin/ to see what nuggets it held.

On a side bar, If anyone is like myself that is still learning about unix e.t. I suggest to do this at some stage. Also after installing new command utils.
So they can get a rough idea of the potential of the commands they already have.

also so you are not jumping from ls to man use two terminal windows or as I did ls /sw/bin > FILENAME.txt

open the text file and you get a list of all the files to use as an referance and a list to compare with, after new installations.

Last edited by mark hunte; 11-12-2004 at 02:33 PM.
mark hunte is offline   Reply With Quote
Old 11-12-2004, 07:12 PM   #4
robJ
Major Leaguer
 
Join Date: Aug 2003
Posts: 429
Here's a quickly written AppleScript script that might be close to what you want. It will generate a text file to hold the search results (path to file and contents of comment field). The file, named "Comment Search Results.txt", will be created on the desktop if a file of the same name doesn't exist.

Code:
 set report_file to (path to desktop as Unicode text) & ¬
  "Comment Search Results.txt"

 try
  alias report_file
  set file_exists to true
 on error
  set file_exists to false
 end try

 set target_fol to (choose folder with prompt "Choose a folder to search.")

 set criteria_ to text returned of (display dialog ¬
  "Enter the search criteria for the comments field." default answer "")

 tell application "Finder"
  set commented_files to files of target_fol ¬
   whose comment contains criteria_
  if commented_files is not {} then
   set report_text to "Files who comments includes '" & criteria_ & ¬
    "':" & return & return
   repeat with item_ in commented_files
    set report_text to report_text & ¬
     ((item_ as text) & return & tab & "Comments: " & ¬
      comment of item_ & return & return)
   end repeat
  else
   tell me to return display dialog "No files found."
  end if
 end tell

 if file_exists is true then
  set report_file to (choose file name with prompt ¬
   "Choose a name and location for the report.") as Unicode text
 end if

 try
  try
   close access file report_file
  end try
  set f to (open for access file report_file with write permission)
  set eof of f to 0
  write report_text to f
  close access f
 on error e
  try
   close access f
  end try
  display dialog e
 end try
It might not be perfect but maybe it can be used as a starting point.

-- Rob
robJ is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.