AGSample and its guide were developed for Apple Developer Technical Support by:
guideWorks, LLC
690 Saratoga Ave, Suite 205
San Jose CA 95129
408-556-1135
web - http://www.guideworks.com/
email - powers@guideworks.com
<End Panel>
<Define Panel> "About guide"
The AGSample guide describes Apple Guide integration.
When used with AGSample, the guide also demonstrates the following integration features:
Object Coach
Context Check
AppleScript Coach
Opening a guide file to its default state
Opening a guide file with search
Use of AGFile library
<End Panel>
<Define Panel> "About AGSample 1"
AGSample is an example of basic Apple Guide integration in an application.
<End Panel>
<Define Panel> "About AGSample 2"
When used with the AGSample Guide, AGSample demonstrates the following integration features:
Object Coach
Context Check
AppleScript Coach
Opening a guide file to its default state
Opening a guide file with search
Use of AGFile library
<End Panel>
<Define Panel> "About Apps-To-Go"
The AGSample application was built using AGSampleCode.c, AGSampleCode.h, and version 7.2 of Apps-To-Go.
Apps-To-Go is a collection of tools and libraries that support application prototyping and code development. Apps-To-Go was developed by Apple Developer Technical Support.
<End Panel>
<Define Panel> "IntroObjectCoach"
This sequence demonstrates the use of Object Coach to mark interface objects.
It uses the Object Coach to mark:
the Open guide button and
the checkbox.
The AGSample application should be open and front for this demonstration.
<End Panel>
<Define Panel> "IntroASCoach"
This sequence demonstrates the use of AppleScript Coach to mark interface objects.
It uses the AppleScript Coach to mark:
the Open guide button and
the checkbox.
The AGSample application should be open and front for this demonstration.
<End Panel>
<Define Panel> "IntroContextCheck"
This sequence demonstrates the use of Context Checks to test the state of the application.
It checks for:
a front document,
a front checkbox, and
the state of the checkbox.
The AGSample application should be open for this demonstration.
<End Panel>
<Define Panel> "IntroAppleEvents"
This sequence demonstrates sending Apple events from the guide to the application.
The AGSample application must be open and front for this demonstration.
<End Panel>
<Define Panel> "Open a new document"
Click the button to open a new document.
<Standard Button> "Open a New Document", CENTER, OpenNewDocument()
<End Panel>
<Define Panel> "Close a document"
Click the button to close the front document.
<Standard Button> "Close Front Document", CENTER, CloseDocument()
<End Panel>
<Define Panel> "Coach open guide button"
Coach the Open guide button.
<Coach Mark> "Coach open guide button"
<End Panel>
<Define Panel> "Coach checkbox"
Coach the checkbox.
<Coach Mark> "Coach checkbox"
<End Panel>
<Define Panel> "ASCoach Open guide button"
Coach the Open guide button.
<Coach Mark> "ASCoach open guide button"
<End Panel>
<Define Panel> "ASCoach checkbox"
Coach the checkbox.
<Coach Mark> "ASCoach checkbox"
<End Panel>
<Define Panel> "Open guide button is not front"
Open guide button is not front.
<End Panel>
<Define Panel> "A document is open"
A document is open.
<End Panel>
<Define Panel> "No documents are open"
No documents are open.
<End Panel>
<Define Panel> "Checkbox is not front"
Checkbox is not front.
<End Panel>
<Define Panel> "Checkbox is front"
Checkbox is front.
<End Panel>
<Define Panel> "Checkbox is not checked"
Checkbox is not checked.
<End Panel>
<Define Panel> "Checkbox is checked"
Checkbox is checked.
<End Panel>
<Define Panel> "IntroOpenGuide"
This sequence demonstrates the use of AGOpen to open a guide file in its default state.
It also uses the Object Coach to mark the button.
The AGSample application should be open and front for this demonstration.
<End Panel>
<Define Panel> "Open guide button"
Click the Open guide button to invoke the AGOpen toolbox call.
<Coach Mark> "Coach open guide button"
<End Panel>
<Define Panel> "IntroOpenWithSearch"
This sequence demonstrates the use of AGOpenWithSearch to open a guide file with a keyword search.
It also uses the Object Coach to mark the button.
The AGSample application should be open and front for this demonstration.
<End Panel>
<Define Panel> "Open guide with search button"
Click the Open guide with search button to invoke the AGOpenWithSearch toolbox call.
The sample code passes a search string to AGOpenWithSearch. Apple Guide opens the guide file in the Look-For view, sets the search phrase to the passed string, and performs a search.
<Coach Mark> "Coach open guide with search button"
<End Panel>
<Define Panel> "Component AGFile"
AGFile contains Apple Guide file-access functions. If you use an AGFile function, include the AGFile library.
<End Panel>
<Define Panel> "Component Application intro"
The sample applications are AGSample.68K and AGSample.PPC. They were built using Apps-To-Go v7.2.
The Apple Guide integration portion of AGSample is extracted as AGSampleCode.c and AGSampleCode.h. There are no sample code differences between the 68K and PPC applications.
<End Panel>
<Define Panel> "Component Guide intro"
When used with AGSample, the guide demonstrates Apple Guide integration.
The guide also provides helpful integration information.
<End Panel>
<Define Panel> "Component Guide AGSample"
To demonstrate Apple Guide integration features, place the AGSample Guide in the same folder as the AGSample application.
<End Panel>
<Define Panel> "Component Guide Development"
To assist you in Apple Guide integration, place the AGSample Guide in the same folder as your development application (EG MPW Shell, CodeWarrior IDE, or Symantec Project Manager).
<End Panel>
<Define Panel> "Component Source"
The AGSample source consists of two files:
• AGSampleCode.c
• AGSampleCode.h
These files contain all the sample Apple Guide integration code.
<End Panel>
<Define Panel> "Component Resources intro"
The AGSample resource files are:
• AGSampleASCoach.r
• AGSampleASCoach.rsrc
• AGSampleASCoach.rsrc.make
<End Panel>
<Define Panel> "Component Resources aete"
AGSampleASCoach.rsrc contains the 'aete' resource for the sample AppleScript Coach.
AGSampleASCoach.r and AGSampleASCoach.rsrc.make were used to create AGSampleASCoach.rsrc.
<End Panel>
<Define Panel> "Component Libraries intro"
The AGSample library files are:
• AppleGuideGlueLib.xcoff
• AGFileLib
• AGFileLib.xcoff
<End Panel>
<Define Panel> "Component Libraries Glue"
AppleGuideGlueLib.xcoff is required for PPC applications that access Apple Guide toolbox functions.
An Apple Guide library is not required for 68K applications.
<End Panel>
<Define Panel> "Component Libraries AGFile"
AGFileLib.xcoff is the PPC library for AGFile.
AGFileLib is the 68K library for AGFile.
AGFile contains Apple Guide file-access functions. If you use an AGFile function, include the AGFile library.
<End Panel>
<Define Panel> "Build Guide intro"
The AGSample Guide is built by Guide Maker. The source files are:
• AGSampleGuide.ag - Guide Script
• AGSamplePICT.rsrc - PICT resources for Guide
• AGSSearchPhrases.rsrc - STR# resources for search
• AGSampleASCoach1001 - AppleScript for Coach
• AGSampleASCoach2001 - AppleScript for Coach
Include these 5 files in a single folder.
<End Panel>
<Define Panel> "AGSampleGuide"
AGSampleGuide.ag contains the Guide Script for this guide.
<End Panel>
<Define Panel> "AGSamplePICT"
AGSamplePICT.rsrc contains the PICTs needed for this guide.
<End Panel>
<Define Panel> "AGSSearchPhrases"
AGSSearchPhrases.rsrc is provided as an example of one way to store search phrases.
If you use AGOpenWithSearch in your application and you want to follow the model, you can modify AGSSearchPhrases.rsrc and include it in your build of the guide.
<End Panel>
<Define Panel> "AGSampleASCoach"
AGSampleASCoach1001 and AGSampleASCoach2001 contain AppleScripts for AppleScript Coach.
If you use AppleScript Coach, you can modify and include these scripts for use in your own guide.
<End Panel>
<Define Panel> "Build Guide 1"
<Format> "Tag"
Do This
<Format> "Body"
To build AGSample Guide, startup Guide Maker.
<End Panel>
<Define Panel> "Build Guide 2"
<Format> "Tag"
Do This
<Format> "Body"
Use the Build command in Guide Maker.
Select AGSampleGuide.ag as the source file and create a new guide file.
<End Panel>
<Define Panel> "Build Guide 3"
<Format> "Tag"
Do This
<Format> "Body"
Click the Compile button.
The guide will be compiled. The other guide source files will be included automatically.
<End Panel>
<Define Panel> "Build Guide compile error"
When you build this guide, you will get several warnings about missing external modules.
Ignore the warnings.
Guide Maker expects external modules to be included in the guide file. Since we are using context check handlers in the application, we do not need to provide external modules.
<End Panel>
<Define Panel> "Integrate sample intro"
Integration consists of modifying and building your application with all or part of the Apple Guide sample code.
<End Panel>
<Define Panel> "Integrate sample functions"
<Format> "Tag"
Do This
<Format> "Body"
Select which functions in AGSampleCode.c and AGSampleCode.h that you wish to include in your application.
<End Panel>
<Define Panel> "AppleGuideGlueLib"
<Format> "Tag"
Do This
<Format> "Body"
Add AppleGuideGlueLib.xcoff if you are building a PPC applications.
<End Panel>
<Define Panel> "AGFile"
<Format> "Tag"
Do This
<Format> "Body"
Add the 68K or PPC AGFile library if you are using any of the AGFile functions.
<End Panel>
<Define Panel> "aete"
Use the AppleScript Coach 'aete' resource if you want to make your AppleScript Coach objects publically accessible.
The 'aete' can be added using AGSampleASCoach.r or AGSampleASCoach.rsrc.
<End Panel>
<Define Panel> "Add aete"
<Format> "Tag"
Do This
<Format> "Body"
Add the AppleScript Coach 'aete' resource if you want to make your AppleScript Coach objects publically accessible.
The 'aete' can be added using AGSampleASCoach.r or AGSampleASCoach.rsrc.
<End Panel>
<Define Panel> "You are done"
That's all.
Sample code, some libraries, a resource or two, and you are done.