Develop-23 9509 September 1995.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
develop E D I T O R I A L S T A F F T H I N G S T O K N O W C O N T A C T I N G U S Editor-in-Cheek Caroline Rose develop, The Apple Technical Feedback. Send editorial suggestions Managing Editor Toni Moccia Journal, a quarterly publication of or comments to Caroline Rose at Technical Buckstopper Dave Johnson Apple Computer’s Developer Press AppleLink CROSE, Internet group, is published in March, June, [email protected], or fax Bookmark CD Leader Alex Dosher September, and December. develop (408)974-6395. Send technical Able Assistant Meredith Best articles and code have been reviewed questions about develop to Dave Our Boss Mark Bloomquist for robustness by Apple engineers. Johnson at AppleLink JOHNSON.DK, His Boss Dennis Matthews Internet [email protected], CompuServe This issue’s CD. Subscription issues Review Board Brian Bechtel, Dave Radcliffe, 75300,715, or fax (408)974-6395. Or of develop are accompanied by the Jim Reekes, Bryan K. “Beaker” Ressler, write to Caroline or Dave at Apple develop Bookmark CD. This CD contains Larry Rosenstein, Andy Shebanow, Nick Computer, Inc., 1 Infinite Loop, a subset of the materials on the monthly Thompson, Gregg Williams Cupertino, CA 95014. Developer CD Series, available from Contributing Editors Lorraine Anderson, APDA. Included on the CD are this Article submissions. Ask for our Patria Brown, Steve Chernicoff, Toni issue and all back issues of develop along Author’s Guidelines and a submission Haskell, Judy Helfand, Cheryl Potter, with the code that the articles describe. form at AppleLink DEVELOP, Joan Stigliani (The code is updated periodically, so Internet [email protected], Indexer Marc Savage always use the most recent CD.) The or fax (408)974-6395. Or write to CD also contains Technical Notes, Caroline Rose at the above address. A R T & P R O D U C T I O N sample code, and other documentation Subscriptions and back issues. Production Lisa Ferdinandsen, Diane Wilcox and tools (these contents are subject to change). Items referred to as being on You can subscribe to develop through Art Direction Paul Luiso “this issue’s CD” are located on either APDA (see ordering information Technical Illustration Mary Prusmack Ching, the Bookmark CD or the Reference below) or use the subscription card in John Ryan, Laurie Wigham Library or Tool Chest edition of the this issue. You can also order printed Formatting Forbes Mill Press Developer CD Series. The develop issues back issues from APDA. For all Photography Sharon Beals and code are also available in the subscription changes or queries, Cover Illustration Graham Metcalfe of Developer Services areas on AppleLink contact APDA and be sure to include your Metcalfe/Shuhert Design and eWorld and at ftp.info.apple.com. name, address, and account number as it Selected articles are on the World appears on your mailing label. Wide Web at http://www.apple.com, ISSN #1047-0735. © 1995 Apple Computer, Inc. The one-year U.S. subscription price is in the Developer Services area. All rights reserved. Apple, the Apple logo, APDA, $30 (for 4 issues and 4 develop Bookmark AppleLink, AppleScript, AppleShare, AppleTalk, CDs), or U.S. $50 in other countries. ColorSync, EtherTalk, HyperCard, HyperTalk, Macintosh Technical Notes. Back issues are $13 each. These prices LaserWriter, LocalTalk, Mac, MacApp, Macintosh, A designation like “(QT 4)” after a include shipping and handling. For MacTCP, MPW, MultiFinder, Newton, NewtonMail, reference to a Macintosh Technical OpenDoc, PowerBook, Power Macintosh, QuickTime, Note in develop indicates the category Canadian orders, the subscription price and TrueType are trademarks of Apple Computer, Inc., and number of the Note on this issue’s includes GST (R100236199). registered in the U.S. and other countries. A/ROSE, CD. (QT is the QuickTime category.) develop, Dylan, eWorld, Finder, NewtonScript, APDA. To order products from APDA PowerTalk, QuickDraw, Sound Manager, and E-mail addresses. Most e-mail or receive the Apple Developer Tools ToolServer are trademarks of Apple Computer, Inc. addresses mentioned in develop are Catalog of all the products available Adobe, Acrobat,and PostScript are trademarks of either AppleLink or eWorld addresses. from APDA, call 1-800-282-2732 in Adobe Systems Incorporated or its subsidiaries and We’re currently in transition: a given the U.S., 1-800-637-0029 in Canada, may be registered in certain jurisdictions. PowerPC AppleLink address may no longer work (716)871-6555 internationally, or is a trademark of International Business Machines by the time this issue is published. (716)871-6511 for fax. Order Corporation, used under license therefrom. UNIX is If that happens, try the equivalent electronically at AppleLink APDA, a registered trademark of Novell, Inc. in the United Internet [email protected], States and other countries, licensed exclusively through eWorld address. On the Internet, CompuServe 76666,2405, or America X/Open Company, Ltd. All other trademarks are the AppleLink address XXX translates to Online APDAorder. Or write APDA, property of their respective owners. [email protected], eWorld addresss XXX to [email protected], Apple Computer, Inc., P.O. Box 319, and NewtonMail address XXX to Buffalo, NY 14207-0319. Printed on recycled paper [email protected]. Issue 24 December 1995 A R T I C L E S 6 Speeding Up whose Clause Resolution in Your Scriptable Application by Greg Anderson Although the Object Support Library will resolve complex AppleScript clauses for you, if you take on some of the work yourself the performance gains can be dramatic. 30 Getting Started With OpenDoc Storage by Vincent Lo OpenDoc storage is a departure from what you’re used to: it needs to support storing different kinds of data, written by different part editors, in the same file or container. 45 Sound Secrets by Kip Olson These less obvious features of the Sound Manager will help improve your application’s use of sound. 59 Guidelines for Effective Alerts by Paige K. Parsons This article elaborates and expands on the guidelines for the consistent and correct usage of alerts. 72 Printing Images Faster With Data Compression by David Gelphman PostScript Level 2 printers can accept JPEG-compressed image data directly, which can greatly improve printing speed. Here’s what you need to know to take advantage of this ability. 84 The New Device Drivers: Memory Matters by Martin Minow Using PrepareMemoryForIO to set up memory for data transfers to or from other devices is a complex — but very important — process. This walkthrough points out traps and pitfalls along the way. C O L U M N S 27 ACCORDING TO SCRIPT 100 MACINTOSH Q & A Steps to Scriptability Apple’s Developer Support Center answers by Cal Simone queries about Macintosh product development. A clear, step-by-step method for developing your particular scripting implementation. 110 THE VETERAN NEOPHYTE The Right Tool for the Job 42 GRAPHICAL TRUFFLES by Dave Johnson Making the Most of QuickDraw 3D Dynamic languages are the future of by Nick Thompson and Pablo Fernicola programming. Or at least they ought to be. A few tips for QuickDraw 3D that might make your life a little easier. 112 NEWTON Q & A: ASK THE LLAMA Answers to Newton-related development queries. 56 BALANCE OF POWER Advanced Performance Profiling 117 KON & BAL’S PUZZLE PAGE by Dave Evans Zoning Out Some new and useful performance profiling by Konstantin Othmer and Bruce Leak features of the PowerPC 604 processor. The original Puzzlers return with another merry romp through the guts of the machine. 69 MPW TIPS AND TRICKS ToolServer Caveats and Carping by Tim Maroney 2 EDITOR’S NOTE All about ToolServer, a small, scriptable 3 LETTERS application that can run MPW commands. 123 INDEX CONTENTS 1 EDITOR’S NOTE I was visiting my friends Helen and John one night when Helen started telling me how excited about the World Wide Web John had become. He said, “Ask me anything at all, and I can find the answer for you.” I asked what the new U.S. postal rate for international air mail was, knowing it had recently gone up from $.50. He delighted over finding a Web page for the Postal Service, and quickly found the rate: $.50. Wrong. Later John showed me a spiffy magazine called NewMedia, and in it an article by longtime hypertext proponent Ted Nelson. Nelson expressed his joy that, with HTML and the Web, hypertext’s time has finally come; we can now leave the insanity of “paper simulation” behind and write in a way that lets information take on its truer, interconnected form. CAROLINE ROSE I found the article, and John’s enthusiasm over the Web, a bit disconcerting. The Web is indeed a boon to humankind, but I don’t see it entirely replacing what came before. The world’s love affair with the Web reminds me of the early days of TV (so I’m told), when many people were sure that radio was dead. Out with the old, in with the new. But in fact the old still had its place in the world. The virtues of the Web don’t mean we no longer need to get information from flesh and blood people sometimes, or from books and other media that we can hold in our hands. This may seem obvious, but from the near hysteria surrounding the Web these days, I’m not sure it is. A few days after my visit with Helen and John, with John still smarting from his failed demonstration of the wonderfulness of the Web, Helen called and mentioned that she needed the lyrics to “House of the Rising Sun.” I could hear John in the background, tapping away as he searched for them online.