1. Product plug (sorry Merlyn) - OmniGraffle is by far the best development-planning tool I've ever seen. Love it.

2. I'm trying to perl + Mac::Glue it, but after reading through the OmniGraffle.pod and Mac::Glue I'm still lost.

The following applescript works:

tell front document of application "OmniGraffl"
tell page 1
make new shape at beginning of graphics with properties {text:{alignment:left, text:field}, origin:{20, ypos}, size:{150, 20}, magnets:{{-1, 0}, {1, 0}}}
end tell
end tell


However, I can't work out the Mac::Glue for the same. I've tried many variation on the following but I'm still lost. I've also looked through the archives for an example of a $obj->make but all the examples appear to be aimed at retrieving data rather than creating 'things'.


use Mac::Glue; my $OmniGraffle = new Mac::Glue 'OmniGraffle'; my $chart = $OmniGraffle->obj(document => 1, page => 1);

$chart->make(
new => 'shape', # $chart->obj('shape'))
at => Mac::Glue::location(before => $chart->obj('graphics')),
with_properties => {
origin => [20,20],
size => [150, 20],
text => {
text=> 'Square'
}
},
ERRORS => \&error_handler, # error handler from the perl website article
);
__END__


unfortunately, the error message isn't that helpful .. OSA's fault I figure: they never make any sense!

OmniGraffle->make(DOBJ, Mac::AEObjDesc=HASH(0xaf398c), new, shape, with_properties, HASH(0xaf3878), at, AEDesc=SCALAR(0xaf39bc)) event failed:
dsLineFErr (10)
line 1111 trap error





Reply via email to