In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Stephan Heuel) wrote:

> Now I want to access the current iPhoto selections in a Perl script. I
> tried several things, but did not succeed in getting properties like
> the comment. The closest I could get was:
> 
> use Mac::Glue;
> 
> my $iPhoto = Mac::Glue->new('iPhoto');
> my $sel = $iPhoto->prop("selection");
> my $count = $sel->count('each' => 'item');
> 
> foreach my $i ( 0.. $count) {
>    my $prop = $iPhoto->prop(comment => item => $i, $sel);

I don't know if you can get item $i of selection:

   tell application "iPhoto"
      get item 1 of selection
   end tell

That fails in AppleScript for me.  Is there a way to do this in AppleScript?  
If so, I can tell you how to do it in Mac::Glue.  :-)


>    defined $prop or die "prop not defined";        # this works well
>    my $comment = $prop->get;
> 
>    defined $comment or die "comment not defined";  # this does not :-(

Note that the first defined works just means construction of the object 
specifier record succeeded; it doesn't mean the application will give you a 
value for it.

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to