At 10:38 +0200 2000.09.13, Axel Rose wrote: >Um 17:42 Uhr -0400 12.09.2000, schrieb Chris Nandor: >>At 23:19 +0200 2000.09.12, Axel Rose wrote: >>>OTH you may have to struggle with AppleScript or AppleEvents. >>>It's hard, I know, but is supported and quite fast. >> >>Well, Mac::Glue isn't hard (for the most part). >>... >> >> my $finder = new Mac::Glue 'Finder'; >> my $fm = new Mac::Glue 'FileMaker Pro'; >> >> $finder->open($finder->obj(file => $file)); >> my $db = $fm->obj(database => 1); >> my @fields = $fm->get( $fm->prop(name => fields => $db) ); >> my @data = $fm->get( $fm->obj(records => $db) ); >> for my $record (@data) { >> print join(", ", @$record), "\n"; >> } > >Only speaking for myself: >It's hard for me. I have to find out which object methods there >are (obj, get, prop), prop() is the exact same as obj(), but prop() is a shortcut for when the first item is a property. These are the same: obj(property => name => $foo) prop(name => $foo) get() and data() are for returning data from an object. You will almost never use these with Mac::Glue (though they are used a lot for Mac::AppleEvents::Simple), since Mac::Glue returns actual data, instead of descriptors, except when the return value is an Apple event object descriptor record (such as what you might compose using obj()). >when to use them and which various parameters >(name=>fields=>$db, records=>$db, ...) they require. This is described by the glue's POD, and mirrors almost exactly how it would appear in AppleScript. If you don't know AppleScript, it certainly can be harder. Let's say I want to open a file in the Finder, as above. Well, the Finder glue's POD says open() takes an 'obj'. So that means I need to use obj() (or prop()) to pass to open(). So what do I pass it? Well, it can be many things. It could be alias, file, item, etc. That is sometimes the hard part, but this is the same problem AppleScript users have. If you can figure out how to do it in AppleScript, chances are it will be the same in Mac::Glue. That is the hard part, and you need help from the author of the program or other users of the program, either through example AppleScripts or AppleScript / Apple event documentation. The main flaw in Mac::Glue seems to be that you can only "tell" an application, and not an object. But this is not a fatal flaw, as there is always a way around it, that I can see. It does make some AppleScripts harder to translate, though. >This process takes some time even after reading the good documentation. >Learning get's even harder if you have e.g. a Cumulus database where >you must experiment. Well, yeah, and you have to experiment even with AppleScript. I remember working with Cumulus with you, and it took me awhile to even get my AppleScripts to work properly! Of course, the best thing we can do to make Mac::Glue easier is to make more sample scripts available. I have one for FileMaker; perhaps it could be expanded. Perhaps you could make some available for Cumulus. We could even make them available on SourceForge, on the anonymous FTP server. A Mac::Glue scripts repository would certainly help a lot of people in using it, I think. >>I am about ready to release Mac::Glue 1.0.0 > >Great news! >I like the new scheme putting modules on sourceforge.net. Yeah, I have many projects on SourceForge now (MP3::Info, File::Sort, Mac::Glue, Mac::AppleEvents::Simple, Mac::OSA::Simple, Slash). I like it. Matthias has also put MacPerl and GUSI on SourceForge, so you can check out whatever progess may be being made over there, and get the latest available source from the public CVS! :D -- Chris Nandor pudge@pobox.com http://pudge.net/ Open Source Development Network pudge@osdn.com http://osdn.com/ # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org