[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Apple Event How-to?



At 17:12 2/11/97, Nikolaos D. Willmore wrote:
>&MacPerl'DoAppleScript(
>'tell application "Mac GS Viewer PPC" to open alias "Hardisk:Desktop
>Folder:Charter.out.ps"'
>);    # Or could have Finder open it, after I set its file type to gsVR.

Hmmm ... Mac GS Viewer PPC (my copy of it, anyway, v. 1.0) is not
scriptable.  So I don't know if this will work.  But it might.

#!perl
use Mac::AppleEvents;
#create file alias object
$filename = 'MkLinux:970207:README';
$fileobj  = "obj{want:type(file), from:null(), form:name, seld:"$filename"}";

$be = AEBuildAppleEvent('aevt','odoc',typeApplSignature,'gsVR',0,0,'')||die $^E;
AEPutParamDesc($be,'----',(AEBuild($fileobj)));
AESend($be, kAEWaitReply) or die $^E;

#NOTE: gsVR should be the correct program type for Mac GS Viewer PPC, but
the app
#should need to be open already
__END__

Good luck ...

#================================================================
The sun got confused about daylight savings time.  It rose twice.
 Everything had two shadows.

        --Steven Wright

Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6