Scripting Additions Guide
Table Of Contents
CHAPTER 3
Writing Scripting Additions
94 Sample Scripting Addition
Listing 3-3 Play Sound scripting addition
////////////////////////////////////////////////////////////////////
//
// PlaySnd.c
//
// The Play Sound Scripting Addition
// Copyright ®1993 Apple Computer Inc.
// All rights reserved.
//
// Written by: Donald Olson
//
// To build:
// C -b "PlaySnd.c" -d SystemSevenOrLater
// Rez -a -o "Play Sound" -t osax -c ascr 'PlaySnd.r'
// Link -p -w -t osax -c ascr -rt osax=1000 -m PLAYSNDENTRY -sg ∂
// "AEVTaevtplsn" -ra "AEVTaevtplsn"=resSysHeap,resLocked ∂
// "PlaySnd.c.o" ∂
// "{CLibraries}"StdCLib.o ∂
// "{Libraries}"Runtime.o ∂
// "{Libraries}"Interface.o ∂
// -o "Play Sound"
//
////////////////////////////////////////////////////////////////////
#include <Resources.h>
#include <Sound.h>
#include <AppleEvents.h>
#define kAsync true // asynchronous play
#define kQuietNow true // quiet channel now
#define kSndType 'snd ' // resource type we're
//looking for
#define typeIntlText 'itxt' // defined in AERegistry.r
#define typeStyledText 'STXT' // defined in AERegistry.r