Before Importing: Changes to make in HyperCard
Let's start. Make a copy of Tech Support TimeSaver for safekeeping, and then open the stack in HyperCard. Take a look around to become familiar with the stack and what it does. Look at the various scripts to see how it works.
Removing menus: The first thing we will do is remove or comment out those script segments which are incompatible with MetaCard. Removing these items before the conversion will prevent MetaCard from putting up multiple error messages while trying to compile these scripts.
As mentioned in the General Conversion Guidelines, menu references are one of the things we need to address. Open the stack script in the script editor and note the many references to creating and managing menus, and the use of a doMenu handler. We will change these. Comment out the items that are marked in red below, and add the makeIndexMenu stub as noted:
The makeIndexMenu stub is just a trap that does nothing. Because the real makeIndexMenu handler will error in MetaCard, we do not want it active. However, many scripts elsewhere in the stack make calls to makeIndexHandler. Rather than track down and comment out all those calls, we will just add this stub temporarily in order to catch them.on openStack global gTimerOpenOrClosed,gShowDialog put "Closed" into gTimerOpenOrClosed put "Yes" into gShowDialog hide message -- if there is no menu "Index" then create menu "Index" makeIndexMenu pass openStack end openStack
At the end of the stack script are three handlers that manage menus when the stack is suspended, resumed, and closed. In HyperCard these are necessary in order to clean up the menu bar when the stack's active status changes. Because MetaCard's menus are permanent objects (they are actually buttons,) they manage themselves automatically. No additional scripting is required to show or maintain a stack's custom menu bar, so these HyperCard handlers are not needed. Completely delete from the script the suspendStack, resumeStack, and closeStack handlers.
The newCardHandler and deleteCardHandler pair also contain doMenu references. We will be changing these handlers when we move them into MetaCard menus later. You can comment them out for now.
There are a few other menu references in button scripts scattered around the stack, but they will not error unless their buttons are clicked, so we will change those after the import. Close the script editor.
The background scripts are all fine. No changes are necessary.
That's it. We are ready to move the stack into MetaCard.
A note about externals: If you have AddColor scripts or other calls to XCMDs or XFCNs in your own stacks, this would be the time to comment out those lines. Our sample stack has no externals, so we can skip this step. Most stacks will need additional commenting at this point in the process.
All contents copyright (C) 1996, HyperActive Software. All rights reserved.
Revised: December 3, 2001