I've run into a problem trying to script NetNewsWire with Mac::Glue, I'm sure it's just a little thing that I'm missing, but I can't seem to find it. I've boiled the problem I'm having to the following script:

#!/usr/local/bin/perl

use strict;
use warnings;
use Mac::Glue;

my $News = Mac::Glue->new('NetNewsWire');

foreach my $sub ($News->prop('subscriptions')->get) {
        print $sub->prop('givenName')->get, "\n";
}

__END__

This fails with "Can't call method "prop" without a package or object reference at /Users/ctriv/bin/headlines line 10, <DATA> line 1."

The applescript equivalent seems to work fine:

set s to ""

tell application "NetNewsWire"
        repeat with thisSubscription in subscriptions
                set s to s & (display name of thisSubscription) & return
        end repeat
end tell

tell application "TextEdit"
        activate
        make new document at the beginning of documents
        set the text of the front document to s
end tell

I'm at a loss...

--
Chris Reinhardt -- [EMAIL PROTECTED] -- http://www.dyndns.org/
But Hitler killed people next door.... stupid man.
            --Eddie Izzard



Reply via email to