SuperCard icon ᄅ Solutions Etcetera - used with permission
SuperCard icon ᄅ Solutions Etcetera - used with permission Reference
SuperCard icon ᄅ Solutions Etcetera - used with permission
SuperCard icon ᄅ Solutions Etcetera - used with permission buttons & names IF and SWITCH read & write data variables
SuperCard icon ᄅ Solutions Etcetera - used with permission

SuperCard: the easiest, most flexible way to make stuff for your Mac

Lesson 2 - more about object names

Here's a little more about identifying objects. In the previous page we made a card button. As the Button Info window showed, it was unnamed, button number 1, and ID 100:

We then named the card button manually, and followed this up with a script which changed the button's name whenever it was clicked. So it should be clear that object names can be changed pretty easily. Object numbers can also be changed, but not directly. The number of an object is determined by what position it is in, in the stacking order. The first button is automatically number 1, the second (which sits on top of number one in the stacking order) is number 2, and so on. It however the second button is selected and 'sent to the back' of the stacking order (just like in any drawing or DTP application) it becomes button number 1.

Object ID numbers are different. There is no way to change the ID number of an object. This is therefore a foolproof way of specifying a specific object in cases where both the name and the stacking order position could be changed. The ID number starts at 100 and goes up in ones. If an item is copied and pasted the newly created item is assigned a new ID, gets the next number in the stacking order, but keeps the name of the object it was copied from.

The number and ID of an object is determined according to the other objects of the same type already in the same place. Having half a dozen card buttons on a card doesn't mean that the first card field you make will be number 7 or ID 106. (That’s why we refer to objects by type in script, as in ‘card button ID 100’ and ‘card field ID 100’.)

 

Reference buttons & names read & write data IF and SWITCH variables read & write data