TweetFollow Us on Twitter

HyperCard 1.2
Volume Number:4
Issue Number:6
Column Tag:

New HyperCard 1.2 Features

By Fred Stauder, HyperCard Editor, Zurich, Switzerland

They are listening!!

Last month I told you to be patient with your wish lists. Well the good folks at Apple have answered some of your wishes. Hypercard 1.2 will have announced by the time you read this issue. The main emphasis of this issue will be the new Hypercard features in 1.2, also Don Koscheka joins us in bringing you XCMD Cookbook.

New Features in Hypercard 1.2

First of all Hypercard 1.2 is not the final version of Hypercard, it is however an indication from Apple that they are committed to the evolution of the Hypercard paradigm. If you expected all the bells and whistles in this release you will be dissapointed. However Hypercard 1.2 does address lots of important points.

HyperCard stacks can be write-protected

This is a very important feature that allows you to get some performance improvements where they are criticle, such as a terminal stack. You can, for example, open it locked and have a save button that unlocks the stack and saves the field to another card.

You can recognize a write-protected stack by a padlock icon appearing to the right of the menu bar. When a stack is write-protected, you can’t type into any fields (even if they’re not locked) and you can’t use certain menu items (they’re dimmed).

You might be able to make temporary changes to a card if the userModify property is set to true. But as soon as you leave the card, the changes will disappear.

A stack is considered write-protected under the following circumstances:

• The stack is locked

• Can’t Modify Stack is checked in the stack’s Protect Stack dialog box.

• The cantModify property is set to TRUE.

When the stack is locked, HyperCard automatically puts a check into the Can’t Modify Stack option; you can’t uncheck it.

Stacks on File Servers and CD-ROM

HyperCard 1.2 allows more than one user to browse stacks on file servers. Any number of users have access to a stack when the stack is locked (but no one can make changes to it); only a single user has access to a stack on a file server when the stack is unlocked.

A stack is considered locked if any one of the following conditions are true:

• The stack is on a CD-ROM.

• The stack is on a file server in a folder whose access privileges are set to Read Only.

• The Locked box is checked in the stack’s Get Info box in the Finder.

• The stack is on a locked 3.5-inch disk.

Note: A locked stack is considered write-protected (see next card), but checking Can’t Modify Stack in a stack’s Protect Stack dialog box does not lock it (even though it does write-protect the stack). Only locked stacks support browsing by more than one user.

Auto Tabbing in Fields

The Auto Tab option lets the Return key move the insertion point to the next field on the card when in the last line of a non-scrolling field. Auto Tab is a property of card and background fields. When Auto Tab is checked in the Field Info dialog box of a non-scrolling field, pressing Return with the insertion point in the last line of that field moves the insertion point to the next field on that card. Normal tabbing order is followed. Remember field order can be set by bringing the field closer or further, the order can be checked by the field number in the field info box.

Setting up form type cards is now much easier where entry can be done entierly via the keyboard.

Choosing Button and Field Tools

The shortcut for the browse tool is command-tab. Two new tool choices have been added. To choose the Button tool command-tab-tab, and to choose the field tool command-tab-tab-tab. See --ScriptTips AutoScriptEdit-II for an alternative.

Line Spacing Shortcuts

In earlier versions of HyperCard you could press Command-Option > and Command-Option < to increase or decrease the space between lines of text (the textHeight property of a field or of paint text).

In version 1.2, you must add the Shift key to the formula: The main reason for this is to be compatible with international keyboards.

First, select the field whose line spacing you want to change. Then press

Command-Shift-Option > to increase the spacing between lines

Command-Shift-Option < to decrease the spacing between lines

Each shortcut increments or decrements the line spacing by 1 (for example, from 16 to 17 or from 17 to 16).

New Hypertalk Commands

Find Command

Find Whole and Find String are two new options for the Find Command. Find Whole (or Shift-Command-F) lets you search for a specific word or phrase (including spaces). It searches for characters at the beginnings of words. Find String lets you search for a specific string of characters (including spaces), but it ignores word boundaries.

Hide Picture Command

Hide Picture hides the picture of a specified card or background. Hide Card Picture and Hide Background Picture hide the picture of the current card or background. This is very useful as an extra graphic layer.

Lock and Unlock Screen Command

Lock Screen has the same effect as setting the property lockScreen to true: it prevents HyperCard from updating the screen. Unlock Screen has the same effect as setting the property lockScreen to false: it allows HyperCard to update the screen. Unlock optionally allows a single visual effect.

Select Command

The Select command lets you select buttons, fields, or text in a field. Select Text and Select with a chunk expression let you (a) highlight text in a field or (b) position the insertion point in a field.

Show Picture Command

Show Picture shows the picture of a specified card or background. Show Card Picture or Show Background Picture shows the graphics of the current card or background.

clickH and clickV Function

The clickH returns an integer equal to the number of horizontal pixels from the left side of the card window to the place the mouse was last clicked

(item 1 of the clickLoc). The clickV returns an integer equal to the number of vertical pixels from the top of the card window to the place the mouse was last clicked (item 2 of the clickLoc).

foundChunk Function

The foundChunk returns a chunk expression that indicates where the most recent Find command located its argument. Its result has the form:

char <number> to <number> of <card | bkgnd> field <number>. If nothing was found, it returns the empty string.

foundField Function

The foundField returns a field expression for the field in which the most recent Find command located its argument. Its result has the form: <card | bkgnd> field <number>. If nothing was found, it returns the empty string.

foundLine Function

The foundLine returns a line expression for the line of a field where the most recent Find command located its argument. Its result has the form: line <number> of <card | bkgnd> field <number>. If nothing was found, it returns the empty string.

foundText Function

The foundText returns the characters enclosed in the box after the most recent Find command has located its argument. If nothing was found, it returns the empty string.

Number Function

The “number of card of <background>” is a new option for the function Number. It returns the number of cards in the specified background.

selectedChunk Function

The selectedChunk returns a chunk expression that indicates the range of characters currently highlighted. If nothing is selected, it returns the empty string.

selectedField Function

The selectedField returns a field expression for the range of characters that is currently highlighted. If nothing is selected, it returns the empty string.

selectedLine Function

The selectedLine returns a line expression for the range of characters that is currently highlighted. If nothing is selected, it returns the empty string.

selectedText Function

This function returns the text that is currently highlighted. It yields the same result as “the selection.” Note, however, that “the selection” is a container (for example, you can put text into it); the selectedText is only a function. If nothing is selected, the selectedText returns the empty string.

autoTab Property

When autoTab is set to true, pressing the Return key with the insertion point in the last visible line of a field advances the insertion point to the next field on the card. Setting the autoTab property is the same as checking Auto Tab in the Field Info dialog box of a specific field.

cantDelete Property

The cantDelete property controls whether a user can delete the specified object. This property checks or unchecks the appropriate option on the Info dialog box of the object in question.

cantModify Property

The cantModify property lets you control whether a stack can be changed in any way. This property sets both the Can’t Modify Stack option and the Can’t Delete Stack option in the Protect Stack dialog box. When cantModify is true, the padlock symbol appears on the menu bar.

Cursor Property

The Cursor property has four new synonyms and four new options. Setting the cursor to iBeam, plus, cross, or watch is the same as setting the cursor to 1, 2, 3, or 4. The others are new cursors. (Note: “None” removes the cursor from the screen. This is very useful for animation you don’t get the flickering browse tool which was very distracting. “Busy” brings up the beach ball. Each time you set it, the ball rotates an eighth of a turn.)

showPict Property

The showPict property makes the background or the card picture visible (when set to true) or invisible (when set to false).

userModify Property

userModify is a global property that allows the user to type in fields and use the Paint tools in a stack that has been write-protected. Changes made by the user (or a script) are discarded upon leaving the card. This property is set to false when the user changes stacks or quits HyperCard. userModify has no effect on an unlocked stack.

New Synonyms in Hypertalk

abbr, abbrev, abbreviated

bg [new], bkgnd, background

bgs [new], bkgnds, backgrounds

btn [new], button

btns [new], buttons

cd [new], card

cds [new], cards

char, character

chars, characters

fld [new], field

flds [new], fields

grey [new], gray

loc, location

mid, middle

msg, message

pict [new], picture

poly, polygon

prev, previous

rect, rectangle

reg, regular

Script Peeking Shortcuts

HyperCard 1.2 has several shortcuts for peeking at scripts. The user level must be set to Scripting (userLevel = 5) to peek at scripts.

While using the Browse tool:

Command-Option: Peek at all visible buttons; click one to see its script.

Shift-Command-Option: Peek at all visible buttons and fields; click one to see its script.

While using the Field tool:

Command-Option: Peek at all visible and invisible fields; click a visible field to see its script.

While using the Button tool:

Command-Option: Peek at all visible and invisible buttons; click a visible button to see its script.

While using any tool:

Command-Option-C: Peek at the script of the current card

Command-Option-B: Peek at the script of the current background

Command-Option-S: Peek at the script of the current stack.

To put any script away quickly once you are in the script editor, press Command-Option again and either (a) click once or (b) press any key.

I hope we can all remember these key combinations; does it remind you of IBM function key nightmares? How about having them in hieracial menus for the times we forget and the not so power users and developers that would like to use them. If I remember my human interface guidelines correctly command keys should be a supplement to menus.

The New “Me” and “Target”

put the target -- still puts the name of the object that last received a message

put target into myVar -- puts contents of a field into a variable

put “Fred” into target -- puts “Fred” into the field

Note: “put value of the target” is equivalent to “put target.”

The above changes affect only operations on fields, not operations on buttons, cards, backgrounds, or stacks.

returnInField System Message

If the returnInField message is not intercepted by a handler, HyperCard checks to see if the autoTab property of the current field is true. If it is and the insertion point is on the last line of the field, HyperCard sends the tabKey message to the current field. Then if the tabKey message is not intercepted by a handler, the cursor moves to the next field on the card.

enterInField System Message

If the enterInField message is not intercepted by a handler and the contents of the current field have changed, HyperCard sends the closeField message to the current field.

Rects

You can now access parts of the rectangle of a specified object and test whether a point is contained within a rectangular region.

In the following descriptions, the symbol <rect> means any expression that yields a rect. A rect consists of four integers, separated by commas, that specify the top-left corner and bottom-right corner of a rectangle as offset in pixels from the top-left corner of the card window. The order of the integers in a rect is Left, Top, Right, Bottom.

For example, the following are examples of expressions that yield a rect:

    rect of card field 1
    rect of first btn
    rect of tool window
    rect of pattern window
    rect of msg box
    rect of card window

• There is a new function, the screenRect, that returns the rect of the entire screen in which the HyperCard window resides. Since it is a function, you cannot use it with Set.

    get the screenRect

• Using <rect>, the following new properties can be defined:

left of <rect>

is equal to item 1 of <rect>

top of <rect>

is equal to item 2 of <rect>

right of <rect>

is equal to item 3 of <rect>

bottom of <rect>

is equal to item 4 of <rect>

topLeft of <rect>

is equal to item 1, item 2 of <rect> (or the top-left corner point)

bottomRight of <rect> or botRight of <rect>

is equal to item 3, item 4 of rect (or the bottom-right corner point)

width of <rect>

is equal to (item 3 of <rect> - item 1 of <rect>)

height of <rect>

is equal to (item 4 of <rect> - item 2 of <rect>)

• You can use Set with left, top, right, bottom, topLeft, and bottomRight to move the specified object. For example, “set left of background button 3 to 25.” Note: You cannot Set the screenRect. It is a pity you could do some interesting things with it.

• You can use Set with width and height to resize buttons and fields.For example, “set width of background button 3 to 25.” Note: You cannot resize the message box, the tool window, the pattern window, the card window, or the screenRect. When changing the width or height, HyperCard maintains the location or loc (center coordinate) of the object, expanding or shrinking it on both sides evenly. If either property is changed by an odd amount, then HyperCard adds the odd pixel either on the right (with width) or on the bottom (with height).

• HyperCard Version 1.2 has a new operator, Within, that allows you to ask if a point is contained in the region defined by a rect. It returns a boolean value (true or false) and is used as follows:

<point> is within <rect>

<point> is not within <rect>

For example:

“12,34” is within “45,45,100,100”

the clickLoc is within the rect of button 3

the mouseLoc is not within the rect of me

Consistent with the Macintosh’s rules about rects, the top left point of a rect is within the rect; the bottom right point of a rect is not within the rect.

As you can see there are many new features in Hypercard 1.2 take the time to explore them fully, there is a lot more power in these changes than is obvious at first. Next month I will show you some example stacks that take advantage of the new features. Some of this information was obtained from the vesion 1.2 release notes from Apple Computer.

ScriptTips

The response to AutoScriptEdit was so intense that I decided I had to expand it and make an even more powerful version. AutoScriptEdit-II will get the script of an unlocked field as well as locked fields. I thought what are some of the frustrating things that can be improved upon. The answer I came up with was locking and unlocking fields. Now if you hold down the enter key and mouse button the field will toggle between locked and unlocked. I am using mouseStillDown because it is used much less than mouseDown. Another feature that I have added, to demonstrate how one key can serve two purposes, is showing the tool window at the mouseLoc using option-click. This is much more useful than the standard option-tab because it pops up where you want it. I have used AutoScriptEdit to demonstrate the power of gestural commands, i.e. holding the mouse down and moving off the top of the card to get the stack script.

---- AutoScriptEdit-II by Fred Stauder  May 1988 ----

-- Put this Script into your Home Stack
-- To use keep mouse btn down over Button or Field and   move --mouse 
up
-- To edit Bkgnd Script keep mouse btn down move mouse   to --left of 
card
-- Card Script - move right
-- Stack Script - move up
-- Now works with unlocked fields
-- To lock and unlock fields option click in them
-- To show tools at cursor hold option click on non-     field areas

on mouseStillDown
  if the optionkey is down then
    if the target contains “field” then set locktext of target to false
    else show tool window at the mouseloc
  end if
  put char 6 of the target into C6
  if C6 is quote then AutoScriptEdit
  if C6 is “i” then AutoScriptEdit
  if C6 is quote then exit mousestilldown
  if C6 is “i” then exit mousestilldown
  if the mouseV <item 2 of rect of target then edit script of target
  pass mouseStillDown
end mouseStillDown

on AutoScriptEdit
  if the mouseH < 2   then edit script of this bkgnd
  if the mouseH > 510 then edit script of this card
  if the mouseV < 2   then edit script of this stack
end AutoScriptEdit

on openfield
  if the mouseV <item 2 of rect of target then edit script of target
  if the optionkey is down then set locktext of target to true
  pass openfield
end openfield

Non-Comercial use only - All Rights Reserved
Fred Stauder, Hypercard Editor, (HyperChat) MacTutor

SpeedTips

To get more performence out of your stacks especially with graphics you can “Preload” cards by setting lockscreen and going to those cards. This is particularly important if you are doing animations.

Another speed tip is to use the link button to get the id of a card rather than a name, it is a good idea to put the name in comments so that people reading your scripts have a better idea what is going on.

The last SpeedTip for this month is put commonly used information in globals rather than having to go to a card to get the info from a field.

Send your Articles, ScriptTips, SpeedTips, etc. to:

Fred Stauder
Ecofin Reseach and Consulting
Lavaterstrasse 45
Zurich 8002
Switzerland
or
Applelink D0280
or
To the MacTutor Office, PO Box 400, Placentia, CA 92670
 
AAPL
$119.00
Apple Inc.
+1.40
MSFT
$47.75
Microsoft Corpora
+0.28
GOOG
$540.37
Google Inc.
-0.71

MacTech Search:
Community Search:

Software Updates via MacUpdate

Skype 7.2.0.412 - Voice-over-internet ph...
Skype allows you to talk to friends, family and co-workers across the Internet without the inconvenience of long distance telephone charges. Using peer-to-peer data transmission technology, Skype... Read more
HoudahSpot 3.9.6 - Advanced file search...
HoudahSpot is a powerful file search tool built upon MacOS X Spotlight. Spotlight unleashed Create detailed queries to locate the exact file you need Narrow down searches. Zero in on files Save... Read more
RapidWeaver 6.0.3 - Create template-base...
RapidWeaver is a next-generation Web design application to help you easily create professional-looking Web sites in minutes. No knowledge of complex code is required, RapidWeaver will take care of... Read more
iPhoto Library Manager 4.1.10 - Manage m...
iPhoto Library Manager lets you organize your photos into multiple iPhoto libraries. Separate your high school and college photos from your latest summer vacation pictures. Or keep some photo... Read more
iExplorer 3.5.1.9 - View and transfer al...
iExplorer is an iPhone browser for Mac lets you view the files on your iOS device. By using a drag and drop interface, you can quickly copy files and folders between your Mac and your iPhone or... Read more
MacUpdate Desktop 6.0.3 - Discover and i...
MacUpdate Desktop 6 brings seamless 1-click installs and version updates to your Mac. With a free MacUpdate account and MacUpdate Desktop 6, Mac users can now install almost any Mac app on macupdate.... Read more
SteerMouse 4.2.2 - Powerful third-party...
SteerMouse is an advanced driver for USB and Bluetooth mice. It also supports Apple Mighty Mouse very well. SteerMouse can assign various functions to buttons that Apple's software does not allow,... Read more
iMazing 1.1 - Complete iOS device manage...
iMazing (was DiskAid) is the ultimate iOS device manager with capabilities far beyond what iTunes offers. With iMazing and your iOS device (iPhone, iPad, or iPod), you can: Copy music to and from... Read more
PopChar X 7.0 - Floating window shows av...
PopChar X helps you get the most out of your font collection. With its crystal-clear interface, PopChar X provides a frustration-free way to access any font's special characters. Expanded... Read more
OneNote 15.4 - Free digital notebook fro...
OneNote is your very own digital notebook. With OneNote, you can capture that flash of genius, that moment of inspiration, or that list of errands that's too important to forget. Whether you're at... Read more

Latest Forum Discussions

See All

Raby (Games)
Raby 1.0.3 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0.3 (iTunes) Description: ***WARNING - Raby runs on: iPhone 5, iPhone 5C, iPhone 5S, iPhone 6, iPhone 6 Plus, iPad Mini Retina, iPad Mini 3, iPad 4, iPad Air,... | Read more »
Oddworld: Stranger's Wrath (Games)
Oddworld: Stranger's Wrath 1.0 Device: iOS Universal Category: Games Price: $5.99, Version: 1.0 (iTunes) Description: ** PLEASE NOTE: Oddworld Stranger's Wrath requires at least an iPhone 4S, iPad 2, iPad Mini or iPod Touch 5th gen... | Read more »
Bounce On Back (Games)
Bounce On Back 1.0 Device: iOS Universal Category: Games Price: $2.99, Version: 1.0 (iTunes) Description: | Read more »
Dwelp (Games)
Dwelp 1.0 Device: iOS Universal Category: Games Price: $.99, Version: 1.0 (iTunes) Description: === 50% off for a limited time, to celebrate release === Dwelp is an elegant little puzzler with a brand new game mechanic. To complete a... | Read more »
Make Way for Fat Chicken, from the Maker...
Make Way for Fat Chicken, from the Makers of Scrap Squad Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Relevant Games has announced they will be releasing their reverse tower defense game, | Read more »
Tripnary Review
Tripnary Review By Jennifer Allen on November 26th, 2014 Our Rating: :: TRAVEL BUCKET LISTiPhone App - Designed for the iPhone, compatible with the iPad Want to create a travel bucket list? Tripnary is a fun way to do exactly that... | Read more »
Ossian Studios’ RPG, The Shadow Sun, is...
Ossian Studios’ RPG, The Shadow Sun, is Now Available for $4.99 Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Mmmm, Tasty – Having the Angry Birds for...
The very first Angry Birds debuted on iOS back in 2009. When you sit back and tally up the number of Angry Birds games out there and the impact they’ve had on pop culture as a whole, you just need to ask yourself: “How would the birds taste... | Read more »
Rescue Quest Review
Rescue Quest Review By Jennifer Allen on November 26th, 2014 Our Rating: :: PATH BASED MATCH-3Universal App - Designed for iPhone and iPad Guide a wizard to safety by matching gems. Rescue Quest might not be an entirely original... | Read more »
You Can Play the Final Chapter of Lone W...
You Can Play the Final Chapter of Lone Wolf: Dawn Over V’taag Right Now Posted by Jessica Fisher on November 26th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »

Price Scanner via MacPrices.net

Black Friday: $300 off 15-inch Retina MacBook...
 B&H Photo has the new 2014 15″ Retina MacBook Pros on sale for $300 off MSRP as part of their Black Friday sale. Shipping is free, and B&H charges NY sales tax only: - 15″ 2.2GHz Retina... Read more
2014 1.4GHz Mac mini on sale for $449, save $...
 B&H Photo has the new 1.4GHz Mac mini on sale for $449.99 including free shipping plus NY tax only. Their price is $50 off MSRP, and it’s the lowest price available for this new model. Adorama... Read more
Early Black Friday pricing on 27-inch 5K iMac...
 B&H Photo continues to offer Black Friday sale prices on the 27″ 3.5GHz 5K iMac, in stock today and on sale for $2299 including free shipping plus NY sales tax only. Their price is $200 off MSRP... Read more
Early Black Friday sale prices on iPad Air 2,...
 MacMall is discounting iPad Air 2s by up to $75 off MSRP as part of their Black Friday sale. Shipping is free: - 16GB iPad Air WiFi: $459 $40 off - 64GB iPad Air WiFi: $559 $40 off - 128GB iPad Air... Read more
Early Black Friday MacBook Air sale prices, $...
 MacMall has posted early Black Friday MacBook Air sale prices. Save $101 on all models for a limited time: - 11″ 1.4GHz/128GB MacBook Air: $798 - 11″ 1.4GHz/256GB MacBook Air: $998 - 13″ 1.4GHz/... Read more
Why iPhone 6 Tablet/Laptop Cannibalization Is...
247wallst.com blogger Douglas A. McIntyre noted last week that according to research posted on the Applovin blog site the iPhone 6 is outselling the iPhone 6 Plus by a wide margin . Hardly a surprise... Read more
Worldwide Tablet Growth Expected to Slow to 7...
The global tablet market is expected to record massive deceleration in 2014 with year-over-year growth slowing to 7.2%, down from 52.5% in 2013, according to a new forecast from International Data... Read more
Touchscreen Glove Company Announces New Produ...
Surrey, United Kingdom based TouchAbility specializes in design and manufacture of a wide variety of products compatible with touchscreen devices including smartphones, tablets and computers. Their... Read more
OtterBox Alpha Glass Screen Protectors for iP...
To complement the bigger, sharper displays on the latest Apple devices, OtterBox has introduced Alpha Glass screen protectors to the iPhone 6 and iPhone 6 Plus. The fortified glass screen protectors... Read more
Early Black Friday Mac Pro sale, 6-Core 3.5GH...
 B&H Photo has the 6-Core 3.5GHz Mac Pro on sale today for $3499 including free shipping plus NY sales tax. Their price is $500 off MSRP, and it’s the lowest price available for this model from... Read more

Jobs Board

*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.