Ok thanks -- and that "1.2 Apple Events" link you sent is promising on its own as well!
Yes - thanks. I sew this but I don't know enough to be able to turn that into a proper setup for an AppleEvent call. For example what keywords to use.. do I have to add a parameter to specify the file location etc. etc. etc.Applications that support AEs via AppleScript are supposed to be self-documenting.
Open the AppleScript “Script Editor” application. Go to File/“Open Dictionary…”. Go to your System Folder and open the Finder. You’ll then be able to see everything supported by the Finder via AppleEvents from AppleScript, including this: View attachment 12267
thx for these - but I've already been looking through them and haven't found any sort of Finder apple events details - just lots of general how to set up apple events stuff.Those books are part of the Inside Macintosh series by Apple circa 1992-1993 that covers AEs in System 7.
Inside Macintosh: Interapplication Communication
Inside Macintosh: Macintosh Toolbox Essentials
Yes, check out the ‘aete’ resource in the Finder (or any application) for the details. The presence of these resources is what tells Mac OS an application is scriptable and what sort of AppleEvents it responds to, as well as telling the Script Editor how to display its dictionary. For example, in Finder 7.5.5 as seen through Resourcerer:Yes - thanks. I sew this but I don't know enough to be able to turn that into a proper setup for an AppleEvent call. For example what keywords to use.. do I have to add a parameter to specify the file location etc. etc. etc.
Is it possible to determine all of those nuances of setting up an Apple Event by way of the dictionary?
That’s a great book, it has the best published (that I have seen) material on how to write trap-patching INITs outside of MacTutor. I have a physical copy in my bedroom closet!A decent book. Ultimate Mac Programming (1994) had IMHO a better quick intro to apple events than Inside Macintosh's interprocess comm. chapters. I'm noting it here in case others want an alternate resource in the future.
Ah yes -- Resourcerer!! Link included because took me a minute to find it and then a second to find it for 68k.
A decent book. Ultimate Mac Programming (1994) had IMHO a better quick intro to apple events than Inside Macintosh's interprocess comm. chapters. I'm noting it here in case others want an alternate resource in the future. In fact - it also suggests Resorcerer to view aete resources.
/** Trial function to use AppleEvents to open a file
** Later will be modified to open the parent directory of an app (e.g.)
**/
void OpenApp(){
OSErr err;
AEDesc aeDesc = {typeNull, NULL};
long appSig, aliasKW;
AppleEvent appleEvent, reply;
AliasHandle myAlias;
AEDescList myList, aliasDesc;
Str63 aliasInfo;
appSig = 'MACS';
err = AECreateDesc(typeApplSignature, (Ptr)(&appSig),
(Size)sizeof(appSig), &aeDesc);
if(err != noErr) {SysBeep(10); ExitToShell();}
err = AECreateAppleEvent('FNDR', 'sope',
&aeDesc,
kAutoGenerateReturnID, 1L,
&appleEvent);
if(err != noErr) {SysBeep(10); ExitToShell();}
err = NewAlias(nil,&(gFSSpec_arr[1]), &myAlias);
if(err != noErr) {SysBeep(10); ExitToShell();}
err = GetAliasInfo(myAlias, asiVolumeName, aliasInfo);
err = GetAliasInfo(myAlias, asiParentName, aliasInfo);
err = GetAliasInfo(myAlias, asiAliasName, aliasInfo);
// NOTE the above 3 AliasInfo responses all check out good
err = AECreateList(nil, 0, false, &myList);
if(err != noErr) {SysBeep(10); ExitToShell();}
err = AECreateDesc(typeAlias, (Ptr)(&myAlias), (Size)sizeof(myAlias), &aliasDesc);
if(err != noErr) {SysBeep(10); ExitToShell();}
err = AEPutDesc(&myList, 1, &aliasDesc);
if(err != noErr) {SysBeep(10); ExitToShell();}
err = AEPutParamDesc(&appleEvent,'fsel',(&myList));
if(err != noErr) {SysBeep(10); ExitToShell();}
err = AESend( &appleEvent, &reply,
kAENoReply+kAECanInteract+kAECanSwitchLayer,
kAENormalPriority,
kAEDefaultTimeout,
nil, nil);
if(err != noErr) {SysBeep(10); ExitToShell();}
AEDisposeDesc(&aeDesc);
AEDisposeDesc(&aliasDesc);
}
Thanks will do!I don’t personally know as I’ve never used AEs for this - you might want to try asking over on 68kmla where there are a few more experienced 68k devs lurking around I think. (Hope that’s OK to suggest)