We make software for humans. Custom Mac, Windows, iOS and Android solutions in HyperCard, MetaCard, and RunRev LiveCode
Uncomment the idle handler, and remove the notation parameters from the play command, leaving only the command itself:
If you forget to comment out other incompatible commands in your own imported stacks (such as calls to XCMDs,) LiveCode offers an extensive Find and Replace option under the Edit menu that will allow you to search the scripts of the entire stack and replace those calls with commented-out versions of the line. There are also Suppress Errors and Suppress Messages options under the Development menu that will turn off LiveCode's error dialogs until you turn them on again. This can save you some aggravation while you are making changes to incompatible scripts.on idle play "Tick.rev" pass idle end idle
To save the script, hit the Enter key or click the Compile button at the top of the editor.
This would be a good time to choose "Save" from the File menu and save the stack to disk. Unlike HyperCard, LiveCode does not save your work for you automatically; it works more like conventional applications. If anything should go wrong before you have saved the converted stack, all your work would be lost, so save frequently. Another advantage to saving immediately after importing is that the "Revert to Saved..." menu command will work if you later need to go back to a previously-saved version. Until the stack is saved to disk, there is nothing to revert to.
To add a title, choose "Stack Inspector" from the Object menu and type a title into the Label field. We used "Tech Support TimeSaver" as the stack label, and changed the stack name to "TSTS". That gives us a short name to refer to in scripts while leaving the more descriptive name in the stack's title bar. If you prefer, it is okay to use the same name for both.
To set the properties and return to the stack, click the close box in the Stack Properties window.
LiveCode allows a script to set the idleRate property, which determines how often an idle message is sent. The number indicates a delay in milliseconds between idle messages and can be anything between 0 and 65535. We will use 800 to give us an even beat. Note that LiveCode supports the idle message for compatibility with HyperCard, but does not recommend its use. We will modify this script later in the Optimizing for LiveCode section of the tutorial, but for now, we will simply modify the idle handler to accomodate.
We will set the idleRate on openCard and set it back to default on closeCard. Open the script of the first card by pressing Cmd-Shift-C. Change the openCard handler and the closeCard handler to look like this (changes are marked in red):
on openCard global gShowDialog set the idleRate to 800 if gShowDialog is "Yes" then put "No" into gShowDialog -- play "Bell" answer "This program is $5 shareware." & return & return & \ "NOTICE: Do not distribute this stack except in its original," \ && "unaltered form as a HyperCard file. See the About card" && \ "for details." with "More Info" or "OK" if it is "More Info" then visual effect dissolve fast go next card end if end if pass openCard end openCard on idle play "Tick.rev" pass idle end idle on closeCard play stop set the idlerate to 60000 pass closeCard end closeCard
You may notice that we have also commented out the play "Bell" command in the openCard handler. LiveCode has faithfully imported this sound along with the others, but it was probably saved originally in an incompatible format, most likely as a Mac-specific compressed sound. We have commented it out to prevent the noise that occurs when LiveCode tries to reproduce it. The fix is to delete the sound from LiveCode, re-sample the original in a sound editing program, save it in ".au" format (which is the most fully cross-platform, though you can use other formats if you like) and re-import it back into LiveCode via the "Import As Control" item under the File menu. For our purposes, we will leave this play command commented out.
If you leave the card and return, you will hear a steady ticking sound. If not, be sure the browse tool is selected. LiveCode does not send normal messages while the edit tool is active.
Due to the way HyperCard stores some of its graphic information, the normally opaque graphic on this card has imported with some of its white space transparent. We will fix that by using the paint tools to re-fill the white area that is missing.
Choose "Paint Palette" from the Tools menu and click on the bucket tool in the resulting palette. Click the Color button on the tool bar and choose white from the color palette that appears. Click the point of the bucket tool in the main area of the graphic which should be white, and click again in the tiny, thin area between the two black borders. Use the rectangle tool to redraw the border lines if necessary. Since the default pen color is black, there's no need to choose a color for this tool. Close the Paint and Color Palettes.
The shadow button in LiveCode is drawn somewhat differently than it is in HyperCard. Since shadow is not a common button style on most platforms, let's change this button to standard style. The standard button style takes on the colors and appearance of the current operating system automatically. On Macs, a standard button will look like a round-cornered Macintosh button with Appearance Manager colors and properties. On Windows, a standard button will take on the user-selected color scheme and will be drawn as a rectangle with a focus border, according to Windows guidelines. You do not need to manage the button's appearance between platforms if you use standard buttons; LiveCode will do it for you.
To set the button style, choose the edit tool from the Tools palette. Double-click the "OK" button on the About card. In the properties dialog that appears, click on the Button tab. Use the popup button to choose standard style. Close the button properties dialog and choose the browse tool from the Tools palette.
Save the stack to disk. The About card is done now, though we will return to it later in the Optimizing for LiveCode section of the tutorial.
It's time to move on to the main record-keeping section of the stack.