← develop-10 9205 May 1992

develop-10 9205 May 1992

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

develop The Apple Technical Journal DRAWING IN GWORLDS FOR SPEED AND VERSATILITY IN SEARCH OF THE OPTIMAL PALETTE APPLE EVENT OBJECTS AND YOU POSTSCRIPT ENHANCEMENTS FOR THE LASERWRITER FONT UTILITY TOP 10 PRINTING CRIMES MULTIPLE SCREENS REVEALED KON & BAL'S PUZZLE PAGE MACINTOSH Q & A Issue 10 May 1992 Apple Computer, Inc.

A colorful pixelated geometric landscape of tiled diamonds in orange, yellow, blue, teal and pink with translucent pyramid shapes fills the left side, with a stacked list of article titles in bold sans-serif type on the right and the masthead across the top.

Reading notes: Article list is in capitals and set in bold sans-serif; line breaks follow the printed layout. The masthead's large lowercase 'develop' is transcribed as shown; the spacing is stylized.

Printed product names
develop: The Apple Technical Journal
Printed dates
May 1992
Languages
English
PDF page 1

d e v e l o p T h e A p p l e T e c h n i c a l J o u r n a l DRAWING IN GWORLDS FOR SPEED AND VERSATILITY IN SEARCH OF THE OPTIMAL PALETTE APPLE EVENT OBJECTS AND YOU POSTSCRIPT ENHANCEMENTS FOR THE LASERWRITER FONT UTILITY TOP 10 PRINTING CRIMES MULTIPLE SCREENS REVEALED KON & BAL’ S PUZZLE PAGE MACINTOSH Q & A I ssue 10 May 1992 Apple Computer, Inc.

Reading notes: Transcript intentionally left empty because the exact extracted text is preserved separately; other fields were filled from the supplied copy only. Masthead is letter-spaced in the supplied copy as 'd e v e l o p T h e A p p l e T e c h n i c a l J o u r n a l'; spacing and capitalization were not verified against the image. 'KON & BAL’ S' contains a space before the S in the supplied copy and may be a line-break or spacing artifact. The supplied copy lists article titles, not advertised products or prices, so productNames and prices are empty. Reading order of the title list was taken from the supplied copy and not independently confirmed from the layout.

Printed dates
May 1992
Languages
English
PDF page 2

E D I T O R I A L S T A F F Editor-in-Cheek Caroline Rose Technical Buckstopper Dave Johnson Review Board Pete (“Luke”) Alexander, Neil Day, C. K. Haun, Jim Reekes, Bryan K. (“Beaker”) Ressler, Larry Rosenstein, Andy Shebanow, Gregg Williams Managing Editor Monica Meffert Assistant Managing Editor Ana Wilczynski Contributing Editors Lorraine Anderson, Toni Haskell, Judy Helfand, Rebecca Pepper, Rilla Reynolds Indexer Ira Kleinberg Manager, Developer Support Systems and Communications David Krathwohl A R T & P R O D U C T I O N Production Manager Hartley Lesser Art Director Diane Wilcox Technical Illustration Nurit Arbel, Geoff McCormack, Dave Olmos, John Ryan Formatting Forbes Mill Press Printing Wolfer Printing Company, Inc. Film Preparation Aptos Post, Inc. Production PrePress Assembly Photography Sharon Beals Online Production Cassi Carpenter develop, The Apple Technical Journal, is a quarterly publication of the Developer Support Systems and Communications group. Hal Rucker of Rucker Huggins used Adobe Illustrator and Adobe Photoshop to create this cover. The colorful tents illustrate subpixel sampling using a “tent filter,” but we just think they’re beautiful to look at. The Developer CD Series disc for May 1992 or later contains this issue and all back issues of develop along with the code that the articles describe. The contents of this disc, which includes other handy software and documentation, can also be found on AppleLink. See Macintosh Q & A, page 110.

Reading notes: Transcript is intentionally empty because the exact extracted text is preserved separately; other fields were filled only from the supplied copy. No headline is printed as such; the page is a staff credits listing, so headline is null. The page is not an advertisement, so no advertised products or prices were listed; product names mentioned in the body copy (Adobe Illustrator, Adobe Photoshop, Developer CD Series, AppleLink) are references, not advertised items. The layout and cover artwork were not verified from the image itself; the visual description relies on the supplied copy. Single-line-per-entry wording such as 'Editor-in-Cheek' and quoted nicknames like 'Luke' and 'Beaker' are reproduced as supplied in the source.

Printed dates
May 1992
Languages
English
PDF page 3

CONTENTS May 1992 1 © 1992 Apple Computer, Inc. All rights reserved. Apple, the Apple logo, APDA, Apple IIGS, AppleLink, AppleShare, AppleTalk, ImageWriter, LaserWriter, LocalTalk, Macintosh, MPW, and MultiFinder are trademarks of Apple Computer, Inc., registered in the U.S. and other countries. Balloon Help, develop, Finder, Macintosh Quadra, Moof, Powerbook, QuickDraw, QuickTime, Sound Manager, System 7, and TrueType are trademarks of Apple Computer, Inc. PostScript is a registered trademark of Adobe Systems Incorporated. HyperCard and MacPaint are registered trademarks of Claris Corporation. Helvetica is a registered trademark of Linotype Company. NuBus is a trademark of Texas Instruments. UNIX is a registered trademark of UNIX System Laboratories. All other trademarks are the property of their respective owners. Spring hasn’t necessarily sprung. 2 Lots about the CD this time. 4 Apple Event Objects and You by Richard Clark Supporting the Apple event object model isn’t as tough as you might think, and it will guarantee the future scriptability of your application. 8 PostScript Enhancements for the LaserWriter Font Utility by Bryan K. (“Beaker”) Ressler Unbeknownst to many, the LaserWriter Font Utility is extensible, allowing you to add custom functionality. PostScript hackers, rejoice! 37 Drawing in GWorlds for Speed and Versatility by Konstantin Othmer and Mike Reed Custom drawing routines can radically increase graphics performance. Kon and Mike show you how and give you some extremely useful examples. 62 In Search of the Optimal Palette by Dave Good and Konstantin Othmer Choosing the best colors to display an image with is tricky. This article explains how the Picture Utilities methods work and gives you tips on developing your own methods. 90 Print Hints: Top 10 Printing Crimes by Pete (“Luke”) Alexander These ten problems with printing show up again and again, but they’re easily avoided. Luke spells it out for you. 33 Graphical Truffles: Multiple Screens Revealed by Forrest Tanaka and Bill Guschwan The fact that QuickDraw handles multiple screens transparently can seem like magic. Here’s the inside scoop and some tips on how to optimize your drawing quality. 57 The Veteran Neophyte: Yeah, But Is It Art? by Dave Johnson Dave has some fun with image processing and has an enlightening encounter with his encyclopedia. 103 KON & BAL’s Puzzle Page: Sleeping Beauty by Konstantin Othmer and Bruce Leak See if you can figure this one out: a bug that shows up only after several hours of continuous QuickTime movie playing. 118 Macintosh Q & A Answers to your product development questions. 106 122 E D I T O R I A L L E T T E R S A R T I C L E S C O L U M N S Q & A I N D E X

Reading notes: Table of contents page numbers and article titles may not align cleanly in extracted reading order

Printed product names
Apple IIGS · AppleLink · AppleShare · AppleTalk · ImageWriter · LaserWriter · LocalTalk · Macintosh · MPW · MultiFinder · Balloon Help · Finder · Macintosh Quadra · Moof · Powerbook · QuickDraw · QuickTime · Sound Manager · System 7 · TrueType · PostScript · HyperCard · MacPaint · Helvetica · NuBus · UNIX
Printed dates
May 1992 · 1992
Languages
English
PDF page 4

Dear Readers, We’ve made a change to develop that I’d like to draw to your attention for two reasons: (1) observant long-time readers may wonder why we’re reverting to an old, abandoned practice, and (2) we’ve learned a lesson that also applies to the products you’re developing. Issues 1 through 4 of develop were “subtitled” January 1990 through October 1990. Our fifth issue started out 1991 not only with the since-abandoned “Vol. 2” designation, but also with the subtitle “Winter 1991.” When I started this job in February 1991, I learned that the change to seasons was made because of the uncertainty of just when an issue would fall into developers’ hands. But now we’re switching back to months with this, our May 1992 issue. There’s the problem that it’s not real clear which year any given winter belongs to, since that season spans two years. But the worst offense is that winter doesn’t hit all parts of the globe at the same time. So we were confusing and offending some of our Australian developers, for example (see the first letter in the Letters section). Localization is something that’s of course critical to any products you hope to sell in other countries—sometimes even other cities or states. And it applies to both code and documentation. Way back when we were writing the first Macintosh user manual, we were surprised to get feedback that we shouldn’t refer to pizza in our sample text because it was too regional. (Somehow the problem of having only white males in all the photographs was overlooked, but that’s another story.) If you’re thinking that people in other countries never use your software anyway, consider this: In the song “Talkin’ Wheelchair Blues” by folk singer Fred Small, a woman in a wheelchair has extreme difficulty getting into a restaurant. She tells the owner that there are things he can do to make it easier for folks in wheelchairs. The owner replies, “Oh, it’s not necessary. Handicapped never come here anyway.” The moral is that if you essentially shut some potential users out, of course they won’t use your software. Apple can offer some new resources to you in your quest for localization. The Guide to Software Localization will be replaced by a Guide to Macintosh Software Localization , to be published by Addison-Wesley and available by around late July. Besides the d e v e l o p May 1992 CAROLINE ROSE (AppleLink: CROSE) has been writing computer documentation for more than half her life. She harks back to the days when using “you” in a manual was controversial. Caroline hasn’t stood still: she switched from writing and programming (at Tymshare, R.I.P.) to writing and editing ( Inside Macintosh, at Apple) to managing and editing (at NeXT) to editing develop (couldn’t stay away). Besides her job at Apple, Caroline loves almost all kinds of music, dancing, and reading. Her eclectic tastes are typified by the three books she’s involved in at the moment: a history of MAD magazine, an annotated Hamlet, and an Italian language textbook. A New York City transplant, Caroline thinks that nothing compares to the New York Times Book Review or real New York pizza. She’s occasionally nostalgic for knishes.• 2 CAROLINE ROSE

Reading notes: Headline is not clearly identifiable; the masthead 'develop' appears as a repeated running title rather than a primary heading. Reading order of the caption-like author biography and 'Dear Readers' letter is ambiguous.

Printed product names
Macintosh · Guide to Software Localization · Guide to Macintosh Software Localization · Inside Macintosh · MAD magazine · Hamlet
Printed dates
January 1990 · October 1990 · 1991 · Winter 1991 · February 1991 · May 1992 · late July · 1992
Languages
English · Italian
PDF page 5

EDITORIAL May 1992 3 SUBSCRIPTION INFORMATION To subscribe to develop, use the subscription card in the back of this issue. Please address all subscription-related inquiries to develop, Apple Computer, Inc., P.O. Box 531, Mt. Morris, IL 61054 (or AppleLink DEV.SUBS).• BACK ISSUES For information about back issues of develop and how to obtain them, see the last page of this issue. Back issues are also on the Developer CD Series disc.• subtle title change, the difference between these two is that the new book will cover third-party script support as well as script systems directly supported by Apple. And by the time you read this, there should be a new APDA product, called Localization for Japan , that covers the business and technical aspects of getting software into the Japanese market. You’ll of course get all the latest technical details on worldwide software in the forthcoming new, improved Inside Macintosh . Another change starting with this issue is that there’s no longer an Apple II Q & A section. Instead, we’ll pass on those Q & A’s to the Apple II journal A2-Central (published by Resource Central). We think this is a better way of getting the information out to the majority of Apple II developers. All current Apple II development products previously sold through APDA are now sold through Resource Central. For more information, you can phone them at (913)469-6502. Now on to Issue 9’s trivia question. Here it is again: The original hardcover Inside Macintosh Volumes I-III had a running pattern of Macintosh computers across its endpapers . . . what broke this pattern, and why? The first two correct replies came from Tom Bernard of Bersearch Information Services and Bill Lipa of CODAR Ocean Sensors. The answer is that the screen of the last Macintosh in the back of the book contains my favorite character in the Cairo font, a rose, and it represents yours truly, the editor and principal author of that tome. The tricky part of the answer is that the rose was a surprise to me. My boss arranged for it to be put there; I didn’t know about it until he handed me my first hardcover copy, hot off the press, and slyly asked me to lift up the inside end flap. This time I’ve got a puzzle for you font fiddlers out there—a test of just how good your font-observing eye is: What character in develop ’s body font is upside-down (not just one-time-only, but defined that way)? Clue: There are lots of them in this issue, but none in this editorial. Get out those magnifying glasses! Caroline Rose Editor

Reading notes: Headline not clearly identifiable as a primary heading; the page is an editorial with no single printed title.

Printed product names
Inside Macintosh · Localization for Japan · A2-Central · Developer CD Series · develop
Printed dates
May 1992
Languages
English
PDF page 6

PROVINCIALISM I would be pleased if Apple (and APDA, etc.) would cease dating publications by what would seem to be the season in the northern hemisphere (for example, “Winter 1992”). This practice is inconsistent with Apple’s dedication to Worldwide Software and the avoidance of cultural values. In addition to it being ignorant and arrogant, it is both confused and confusing—the seasons in the U.S.A. are not, I believe, simply the opposite of ours. Furthermore, what the heck is “Winter 1992”? Which end of the year is it? Is it sometimes also known as “Winter 1991”? —Dr. Ross L. Richardson, Australia Thanks for the kick in the pants—and for inspiring the theme of this issue’s editorial. The change (back) to using months has been made in this, our May issue. I wish we could have done it for Issue 9 (February, a.k.a. Winter 1992), because I agree that “Winter” is particularly confusing, but the timing was too tricky. In fact, just after hearing from you about this, I received a “Winter 1991” catalog in the mail! —Caroline Rose WHERE’S THE SKB STACK? Wow, a real Developer CD! At first I thought it was one of those errors that are in my favor (a rarity for sure!). But no, I will continue to receive Developer CDs. Last year I would have considered murder to gain access to one of these. Needless to say I’ve been over it as much as possible. There’s one thing that I can’t find. I can’t seem to locate the Search Knowledge Base stack. I was able to select which stacks to search and get the report of all Tech Notes containing what I was looking for. I don’t mind telling you that it saved my butt on a couple of contracts. I’ve looked in the logical places on the CD for it. Where is it? —J. R. Hughson Yes, since Issue 8, subscribers to develop have been getting the entire Developer CD Series disc and not just the Developer Essentials subset. Truly the bargain of the century (tell your friends). We’re glad you didn’t have to resort to foul play to get one. The Search Knowledge Base (SKB) stack was modified slightly and integrated into the Developer Info Assistant (DIA) stack— so it was only hiding, not gone. We apologize for not communicating this change to you. To go directly to the SKB utility, just open the DIA stack (in the Start Here folder) and click the “Search...” button. —Caroline Rose ON LOCATION (MOOF!) It was nice to get more goodies on the CD that came with Issue 8, but the CD has a couple of deficiencies that I think should have been detected/eliminated. 1. Unless something is wrong with my copy of On Location, the On Location index on the CD can’t be used to view the files it references. On Location says that the index is out of date. I don’t know about all files, but this was true of the sample I tried to look at. To rebuild the index on my hard disk will take a big chunk of my limited hard disk space. 2. The time I spent with the CD from develop Issue 7 getting accustomed to d e v e l o p May 1992 PLEASE WRITE! We welcome timely letters to the editors, especially from readers reacting to articles that we publish in develop. Letters should be addressed to Caroline Rose (or, if technical develop-related questions, to Dave Johnson) at Apple Computer, Inc., 20525 Mariani Avenue, M/S 75-2B, Cupertino, CA 95014 (AppleLink: CROSE or JOHNSON.DK). All letters should include your name and company name as well as your address and phone number. Letters may be excerpted or edited for clarity (or to make them say what we wish they did). • 4 LETTERS

Reading notes: Spaced-out letters 'd e v e l o p' and 'd e v e l o p May 1992' may be a layout artifact of the source text. Line breaks mid-sentence (e.g., 'the CD from develop Issue 7') suggest possible reading-order uncertainty.

Printed product names
On Location · Developer CD Series · Developer Essentials · Developer Info Assistant · Search Knowledge Base · Developer CD · develop · AppleLink
Printed dates
Winter 1992 · Winter 1991 · May 1992 · February · Issue 8 · Issue 9 · Issue 7
Languages
English
PDF page 7

the Search Knowledge Base stack was for naught since SKB is not present on the CD that came with Issue 8. The old version does not work on the new CD without substantial modification. I found Issue 7’s SKB very useful. By the way, what does “Moof!” mean? —Pete Roberts The On Location index was indeed broken on the Developer CD Series disc Volume X. Our apologies, and thanks for alerting us. It works fine on later CDs. As for the apparent disappearance of the Search Knowledge Base (SKB) stack, please see the answer to the previous question. Moof is a sacred tradition among Apple’s Developer Technical Support engineers. It means several things. First, it’s the sound that the dogcow makes. (The story of the dogcow is “hidden” in Macintosh Technical Note #31 on the CD; if you can find it, you’ll be considered a Moof initiate.) The dogcow is integrated into our artwork in a number of places. Take a look at the cover card of the Technical Notes stack or Q & A stack, for example. There’s also a guest appearance of the dogcow in this issue of develop (see the Print Hints column). Second, the word is used to indicate any software that’s a hack, something untested and on the edge. Certain folders on the CD are marked Moof, such as “Tools & Apps (Moof!)” and “Development Platforms (Moof!).” This is to let you know that these folders contain software that’s not fully tested or sanctioned by the powers that be. When you open these folders you cross the boundary into hackerland. —Sharon Flowers QUICKTIME MOVIES ON THE CD? I want to thank you and your staff for a truly wonderful publication. I currently hold a dual position as a Macintosh/ Windows developer and as director of a research lab using UNIX® boxes with Motif; of all the trade magazines I get (and let me tell you, I get a zillion of them), develop shines above all the rest. The articles addressed aren’t always the ones I’d have chosen, but with as large an audience as you probably have, you still manage to print more than enough for me to get plenty out of each issue. The CD has also provided me with hours of exploration each time. I would really like to see you include QuickTime movies made by Apple employees and maybe even readers. Keep up the good work—and treat yourselves to pizza on me (send the bill to my mailing address). —Robert H. Zakon Thanks for the glowing comments. You have no idea (or maybe you do) how much these things mean to us. Regarding QuickTime movies on the CD, I agree that would be great, sorta like the old days when we had an audio track on every CD: our chance to get creative and add some entertainment value. Unfortunately, it’s unlikely that it will happen, for a few reasons. The main one is that we’d have to get rid of a lot of useful stuff to make room for the movies (which, as I’m sure you know, tend to be largish). Even though we have 600 MB of space on the disc, it’s always burstingly full. So despite the fun we could all have with movies, the Developer CD is just not the place for them, alas. The QuickTime CD is, LETTERS May 1992 5

Reading notes: Pete Roberts' question about 'Moof!' is quoted from the letters section and not a product name Line breaks within 'Developer Technical Support' and 'Tools & Apps (Moof!)' may be layout artifacts

Printed product names
Search Knowledge Base · Developer CD Series · Technical Note #31 · On Location · Tools & Apps (Moof!) · Development Platforms (Moof!) · Macintosh · UNIX · Motif · QuickTime · Technical Notes · Q & A
Printed dates
May 1992
Languages
English
PDF page 8

of course, chock full of fun movies, if you haven’t seen it yet. It’s available from APDA as part of the QuickTime Developer’s Kit, APDA #R0147LL/A. Thanks again for writing, and if you have ideas for articles you’d like to see (or want to write one yourself!), please don’t hesitate to let us know. —Dave Johnson P.S. The pizza was delicious. All 114 of us thank you heartily. The bill is in the mail. NOT READY FOR PAPERLESS I’m more concerned about the environment than most, but the race to achieve the paperless office, without determining what people’s needs really are, will only end up convincing them that the electronic office has not come of age! Apple isn’t considering that we’ve spent most of our lives looking at the printed page, so the productivity loss now in using on-line electronic media is high. The fact is most people relate more easily and absorb information more quickly from the printed page than from any existing on- line method. A case in point is develop. Scanning Issue 8 on-line took more than 30 minutes, just for a quick scan. An equal amount of information could have been obtained from the printed magazine in less than 1 minute. That’s a factor of 30! I applaud the effort to save trees, but how many trees are being saved when developers merely print the information themselves (single-sided, I might add)? If Apple wants to make an impact in this area of environmental concern I suggest they provide a set of integrated on-line tools that allow retrieval of information in a way that’s more human oriented. Apple held a carrot under our noses at the 1991 Worldwide Developers Conference called BlueNote, but they’ve been unable to deliver. In the meantime we’re expected to make do with the existing (poor) HyperCard® utilities. Come on, Apple—now is the time to make a difference. —Todd Stanley I couldn’t agree with you more that Apple needs to develop an electronic publishing strategy that advances the art of access to information. But Apple is many people and consensus is somewhat of an endangered species! Current strategies, electronic develop included, do make some advances. Regretfully, in some ways they are more difficult to use than the tried-and-true print media. But beyond regret and apologies we actually have some solutions in the works. The “BlueNote” carrot that was dangled before you is in fact now in use on the Developer CD. It’s being used to present chapters from the new, improved Inside Macintosh. Unfortunately, like most solutions to date, it creates as many problems as it solves. So please be patient as we try to come up with a solution that does the electronic medium justice. As a side note: This discussion should send a message to the developer community. There’s clearly a need in the marketplace for generic electronic publishing tools. And where there is a need, there is opportunity. —Corey Vian WHERE’S PRINTED DEVELOP? I’m an Apple Associate and lately I have not been receiving the printed version d e v e l o p May 1992 6

Reading notes: Reading order of the page is unclear because the fragments from separate letters and columns are interleaved in the extracted copy. The word 'develop' appears split across lines and is partly garbled in the extracted copy, so its exact placement is uncertain.

Printed product names
QuickTime Developer's Kit · HyperCard · BlueNote · Inside Macintosh
Printed dates
1991 · May 1992
Languages
English
PDF page 9

of develop magazine. Issue 7 was the last printed one I received. I don’t know why this happened, but I would like to receive the printed version again. The CD-ROM paperless approach is admirable, but it doesn’t work for me because I do all my reading while commuting on CalTrain. —Joe Zuffoletto Letters like yours are all too common. What’s happened is that, starting with Issue 8, printed develop was removed from the mailing to Apple Associates and Partners. In various places (including in the mailing itself), it was announced that developers would have to explicitly subscribe to keep getting develop in printed form—but apparently many developers didn’t see this announcement. Since then we’ve received a lot of less-than-positive feedback about the decision to drop the printed magazine out of the mailing and about the difficulties in trying to read it on the CD (see, for example, the previous letter). The paperless approach isn’t working for a lot of people, as it turns out. For now, you’ll have to subscribe in order to get printed develop . If you don’t want to go through the trouble of finding the subscription form in develop on-line, you can place a phone order at 1-800-877- 5548—or you can subscribe through APDA. As for the future, rest assured that Apple is paying attention to the feedback and has learned a lot from it. I can’t say what will happen, but I know that the more developers tell us what they want, the more likely they are to get it. So thanks for writing to us. —Caroline Rose UP TO HIS EARS IN CDS I agree 105% with your editorial comment in Issue 8 (about preferring to read develop in printed form). I guess I’ll cast my vote by subscribing to develop, but I need another copy of the CD like I need a typewriter. I sometimes wonder whether I should still keep all the old CDs that compete for room in my limited collection space. I want the hard copy develop, but it bothers me to waste that CD that comes with it. —Bruce Radford Apple Associates and Partners who subscribe to develop to get it in hard copy do end up with an extra CD. At one time I was concerned about the extra cost of this as well as the waste. It turns out that the CD doesn’t add much at all to the cost of develop . But as for the waste, I don’t have an answer; maybe some of our readers do? I wouldn’t recommend holding on to the old CDs (which only compounds your disposal problem, but oh well). For the most part they’re cumulative—we’ve only deleted old versions of international system software and a few other things that we had pressing reasons to remove. In particular, the develop code on the CD is kept up-to-date, and any bugs are fixed, with each new CD. —Caroline Rose LETTERS May 1992 7

Reading notes: Page number '7' and header/footer placement near end of source are ambiguous. Reading order of two letters with interleaved editorial replies may be non-linear.

Printed product names
develop
Printed dates
May 1992 · Issue 7 · Issue 8
Languages
English
PDF page 10

APPLE EVENT OBJECTS AND YOU

With Apple events, Apple has opened the door for applications to control each other and work collaboratively. However, before applications can communicate, they have to agree on the commands and data they’ll support. Apple event objects form the basis of such a protocol—the Apple event object model. The object model is powerful, but still a source of confusion for many developers. This article provides an overview of the object model and answers several commonly asked questions, including “What is the Apple event object model?” and “How do I support it?” One of the greatest strengths of the Macintosh—its graphical user interface—is also the basis of one of its greatest weaknesses—the difficulty of automating routine or repetitive tasks. “Give us batch files!” many users cried. The developers responded with macro programs such as QuicKeys and Tempo, which handle many of the routine tasks but can’t always make a program do exactly what the user wants. The problem is that macro programs are generally limited to manipulating an application’s human interface and have limited information about the state of the application. This means that if some setting has been changed or something has been moved, running a particular macro might not have the desired effect. In other words, one Macintosh application cannot control another application reliably through the target application’s human interface. For one application to control another application reliably, all of the following must happen: • The two applications must agree on a protocol for sending commands and data and agree on the specific information to be sent across this connection. • The controlled application needs to provide a rich enough set of commands and sufficient access to its data so that meaningful work can be done. d e v e l o p May 1992 RICHARD CLARK , an instructor and course designer in Apple’s Developer University, is no stranger to projects both large and small. (He claims that both of his recent projects—the new Advanced System 7 class and Daniel Guy Clark—took around nine months and developed a life of their own.) When he’s not playing with his new son, you can find him dancing in local Renaissance Faires, stunt kite flying, searching for the ultimate chocolate recipe, and dreaming up horrible new puns.• 8 RICHARD CLARK APPLE EVENT OBJECTS AND YOU

Reading notes: Reading order of the page-number and author byline fragments near the end is uncertain

Printed product names
QuicKeys · Tempo
Printed dates
May 1992
Languages
English
PDF page 11

• The protocols and command sets should be standardized so that many different applications can work together. On the Macintosh, Apple events and the Apple Event Registry provide the standards that allow applications to control each other reliably. The Apple event, a standard protocol for sending commands and data between applications, was introduced as part of System 7. The Apple Event Registry defines standard Apple event commands and two standard data types— Apple event object and primitive. Apple event objects describe an application’s internal data, and primitive types describe the data that can be sent between applications. In essence, the Registry forms the basis for a standard language that applications can use when sending or receiving Apple events. One of the challenges in creating the Apple Event Registry was to keep the set of commands small while providing an adequate level of control between applications. The Registry does this by allowing the same command to apply to different Apple event objects within an application. The application of Apple events to Apple event objects is commonly referred to as the Apple event object model. This article provides an overview of the object model and then discusses how you can add object model support to your application. The fundamentals of Apple events are given in Inside Macintosh Volume VI. OBJECT MODEL BASICS The Apple Event Registry defines an application’s programmatic interface as a series of Apple event objects, where each object belongs to a particular object class. Each Apple event object is comprised of some data and a set of Apple event commands that operate on that data. In a traditional object-oriented fashion, new classes are defined by taking an existing class and adding new data and/or commands. Related classes are grouped together into suites. The most commonly used objects (and their associated commands) are grouped together into the Apple event core suite. The commands in the core suite, which include Create Element, Delete, Get Data, and Set Data, cover the basic operations for any given object. The Apple event objects defined within the core suite include documents, windows, and the application itself. The core suite also includes some primitive classes such as long and short integers, Boolean values, and text. Every object model–aware application should support the core suite, and all Apple event objects defined within your application should support the core suite events. The data portion of an Apple event object is broken into two parts: the object’s properties and its elements: • The properties of an object contain the attributes of the object—for example, its name and a 4-byte code designating its class. APPLE EVENT OBJECTS AND YOU May 1992 9 Concepts from object-oriented programming (notably inheritance—the process of defining new classes in terms of other classes) are used in defining the Apple event object model, but supporting Apple event objects does not require the use of an object-oriented language or class library. You can use any language or implementation technique you want, as long as your application can understand the Apple events sent to it.•

Reading notes: Page number '9' and running header text appear mid-article, which may affect reading order.

Printed dates
May 1992 · System 7
Languages
English