• 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: Do Perl Script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do Perl Script?


  • Subject: Re: Do Perl Script?
  • From: Ron Bishop <email@hidden>
  • Date: Fri, 6 Jun 2003 11:28:36 -0500

I had posted this in answer to another question..

....Also if you want, you can use Image::IPTCInfo in PERL to see/write certain formats without opening the file. Wrap it in an Applescript like so..(this checks the caption, but you can do other IPTC).

###############
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 theScript 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 theScript & " > " & tmpfile
do shell script "chmod +x " & tmpfile
set theTextResult to do shell script tmpfile

display dialog theTextResult
###############

This can be cleaned up or modified... (there's no check to see if the caption exists) and run from the script menu, iKey, Big Cat...

It creates a temporary file then runs it.

Ron Bishop
On Friday, June 6, 2003, at 10:38 AM, Gnarlodious wrote:

Can someone post a "Do shell script (perl)) to get my jumpstarted?
Thanks

--http://www.Gnarlodious.com/iTunes.html
Gnarlodious iTunes Music
_______________________________________________
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.
_______________________________________________
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: 
 >Do Perl Script? (From: Gnarlodious <email@hidden>)

  • Prev by Date: Move File
  • Next by Date: Re: If exists logic
  • Previous by thread: Do Perl Script?
  • Next by thread: Re: Do Perl Script?
  • Index(es):
    • Date
    • Thread