At 02:08 +0900 2002.04.04, [EMAIL PROTECTED] wrote: >1] the legacy version of Claris 4I have, is a Mac classic app, which >will produce a glue dictionary when dropped on the requisite droplet, >but it doesn't have any of the XTND filters, so it can only save in >..cwd format and it can't open any other kind of file.
I don't know the specifics of the app, but if AppleScript can get those filters for specifying, then they should be available to the glue, too. I don't know about ClarisWorks, but AppleWorks allows you to use "open myFile as document type myType", where myType is an XTND translator. It also allows "save file using translator myTranslator" with XTND. These work with Mac::Glue too, of course. (See below.) >2] AppleWorks can translate the .cwd files, but it's a carbon app and >therefor doesn't have a classic Mac res fork, meaning MacGlue can't >get at it's applescript dictionary which will be in a ._res file >somewhere. Three things: 1. "Carbon" does not mean that it doesn't have a Mac resource fork, or that it is even a Mac OS X "package". A Carbon app can look just like a regular Mac OS 9 application and work with gluemac and everything. However, they *can* be in packages. If they are in packages, it will still usually have a resource fork, but it will be elsewhere. On top of that, Cocoa apps will be in packages and won't have resource forks or anything that we can parse manually. 2. All Carbon and Cocoa apps will respond to the Apple event to get the aete "resource", which is primarily how gluemac works to begin with. However, Mac::Glue needs some modifications to work with many "packages", whether Cocoa or Carbon. I've gotten it to work, but I still need to do more on it and then release the updates. 3. However, in the case of AppleWorks 6 (if that is what you are using), all you need to do is "Show Package Contents" for the package, and drop the file ":AppleWorks 6.app:Contents:AppleWorks" on gluemac. It works! That's because many Carbon apps, similarly to in (1) above, are just regular Mac apps inside a package. Some Carbon apps in packages cannot be glued this way, and eventually I'll make it so you can just drop the package on gluemac. So here is a script that works with the Carbon AppleWorks 6: #!perl -w use Mac::Glue ':all'; my $path = 'Bourque:Desktop Folder:untitled.cwk'; my $aw = Mac::Glue->new("AppleWorks"); $aw->activate; my $file = $aw->obj(file => $path); $aw->open $file); $aw->save( $file, in => $aw->obj(file => "$path.txt"), using_translator => 'TEXT' ); $aw->close($file); At first I tried "as_file_type => 'TEXT'", but it wasn't working; for some reason, it thinks "TEXT" is "HTML", as Andrew noted. D'oh. But "using_translator" worked just great to get regular plain text. Anyway, using the above should work fine on MacPerl, with Carbon AppleWorks 6, under Mac OS 9 or Mac OS X. Happy glue'ing, -- Chris Nandor [EMAIL PROTECTED] http://pudge.net/ Open Source Development Network [EMAIL PROTECTED] http://osdn.com/