• 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: Embedded keywords
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Embedded keywords


  • Subject: Re: Embedded keywords
  • From: Ron Bishop <email@hidden>
  • Date: Mon, 27 Oct 2003 10:18:46 -0600

There are several PERL modules that can do it. I use the Image::IPTCInfo module. Here's a script that gets the caption from an image file:

-------------------------

property newline : ASCII character 10
property tmpfile : "/tmp/execme"


tell application "Finder"
set theitem to selection as alias
set theFilename to name of theitem
set theFolder to container of theitem as alias
set thePOSIXPath to POSIX path of theFolder
end tell

set theShellScript to "#!/usr/bin/perl" & newline & "use Image::IPTCInfo;" & newline ,
& "chdir('" & thePOSIXPath & "');" & newline & "my @files = ('" & theFilename & ,
"');" & newline & "foreach my $filename (@files)" & newline & "{" & newline & ,
"my $info = new Image::IPTCInfo($filename);" & newline & ,
"my $keywordsRef = $info->Keywords();" & newline & ,
"print\" \". $info->Attribute('caption/abstract') . \"\";" & newline & "}" & newline & ,
"exit;"
do shell script "echo " & quoted form of theShellScript & " > " & tmpfile
do shell script "chmod +x " & tmpfile
set theTextResult to do shell script tmpfile

display dialog theTextResult

-------------------------

Image::IPTCInfo can even create SQL statements for you. For more info-

http://www.multipart-mixed.com/photo/iptc.html
http://search.cpan.org/~jcarter/Image-IPTCInfo-1.7/

iView MultiMedia Pro can also be used to alter files and is scriptable.

Ron Bishop

Macintosh Systems Administrator
The Kansas City Star
1728 Grand Boulevard
Kansas City, MO 64108
816/234-4943



On Monday, October 27, 2003, at 07:00 AM, Elijah Wilcott wrote:

Programs like Photoshop and Extensis Portfolio are able to embed keywords into the files they deal with. (The menu item in Portfolio for doing this is "Export pnot data.") Is there a way to do this with AppleScript independently of any of these applications? I have a script written that renames all our new files, and I want to be able to set both the original filename and other information as keywords accessible to Photoshop and Portfolio. I already have all the information set as variables entered by the user.

Thanks!
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Embedded keywords (From: Elijah Wilcott <email@hidden>)

  • Prev by Date: Re: Embedded keywords
  • Next by Date: File Preferences wasn't found, Panther
  • Previous by thread: Re: Embedded keywords
  • Next by thread: File Preferences wasn't found, Panther
  • Index(es):
    • Date
    • Thread