PreFab...Player...Documentation...Frontier...User's Guide...

Appendix 3, Advanced Topics


Changing the Balloon Hotkey

To change the "hotkey" that displays Player's balloon help, you need ResEdit, Resorcerer or another tool for editing resources. Edit a copy of PreFab Player (as follows), put it in the Extensions folder, and restart. Change 'STR ' 128 to the decimal sum of the desired modifier value: cmd: 256, shift: 512, capsLock: 1024, opt: 2048, ctrl: 4096 (e.g. the default ctrl-opt is 6144), and 'STR ' 129 to the keycode of the desired key (as defined in Inside Macintosh), below:

A 0
B 11
C 8
D 2
E 14
F 3
G 5
H 4
I 34
J 38
K 40
L 37
M 46
N 45
O 31
P 35
Q 12
R 15
S 1
T 17
U 32
V 9
W 13
X 7
Y 16
Z 6
1 18
2 19
3 20
4 21
5 23
6 22
7 26
8 28
9 25
0 29
- 27
= 24
[ 33
] 30
\ 42
; 41
' 39
, 43
. 47
/ 44
` 50
space 49
tab 48
return 36
enter 76
delete 51
escape 53
left arrow 123
right arrow 124
up arrow 126
down arrow 125
help 114
forward delete 117
home 115
end 119
page up 116
page down 121
F1 122
F2 120
F3 99
F4 118
F5 96
F6 97
F7 98
F8 100
F9 101
F10 109
F11 103
F12 111
F13 105
F14 107
F15 113
clear 71
keypad0 82
keypad1 83
keypad2 84
keypad3 85
keypad4 86
keypad5 87
keypad6 88
keypad7 89
keypad8 91
keypad9 92
keypad decimal 65
keypad divide 75
keypad equals 81
keypad minus 78
keypad plus 69
keypad times 67

Creating "glue scripts"

(i.e. an "app table" or "install file")
In Frontier, a table of verbs acts as the interface between your script and an application. Many scriptable applications include this table of "glue scripts" as an "install file" that ships with the product. Other install files are included with Frontier; many more are available online.

If you would like to script an application that lacks an install file, we suggest that you create one. (It is not actually required, but makes scripts easier to understand and share with others.) Here's how: select Commercial Developers from the Suites menu (in the UserLand submenu in Frontier 4.1). Enter a name for the application (with no spaces or punctuation), then load the 'aete' info. The suite will create a few standard verbs, plus verbs for any Apple events that are described in the 'aete' (Apple event terminology) resource.

If the application supports Apple events but lacks an 'aete' (and therefore has no AppleScript dictionary), you can add verbs to the app table by hand -- as long as you have documentation for the 4-character "string4" codes for the events and their parameters.

Player includes an example install file for SimpleText. To review it, just Cmd-Jump to "SimpleText", or look in system.verbs.apps.SimpleText.

Creating Player-based "glue scripts"

If you regularly use Player to control one or more applications, we recommend creating a table of glue scripts that hide the direct calls to Player behind a set of verbs designed specifically for the application. For example, you may find out from experimentation that in some applications it is best to call "cut" with Player's chooseMenu verb, but in others it is best to use typeCombination. You could create a "cut" verb in your Player-based install file that hid this detail. Then, every script that you write that controls this application can simply call "myAppPlayer.cut" instead of directly calling Player.

Although it is not required, we suggest ending the name of the app table with "Player" to clearly identify that Player is required. That will also help avoid confusion as developers begin to release their own install files -- though often with less functionality than a comprehensive one built with Player!

As an example, we include the MOREPlayer install file, to drive Symantec's MORE outliner. It is certainly not complete, but provides a good starting point. We also include NavPlayer, a preliminary install file for CompuServe Navigator that we use in-house (including for "e-mail merge").

A Player-based install file is especially useful if key items can't be controlled by name. All ID numbers or XY coordinates can be put in tables of constants. For example, the format pop-up in a Save As dialog could be stored in myAppPlayer.dialogItems.saveAs.format. Although the table name may look long, most scripts will use Frontier's "with" construct:

on saveAs(path, type)     « part of a Player-based install file
   with Player, myAppPlayer, dialogItems
      chooseMenu("File", "Save As")
      choosePopup(saveAs.format, type)
      « etc.

We would be happy to help you create an install file for an application that you use regularly -- especially if the results will be made available as shareware or Pioneerware (i.e. free to Frontier scripters -- term courtesy of Peter Dako). If you have access to the Internet or an online service, check to see what has already been developed.

| Top |


Appendix 2, Verb Parameters| Prev | Home | Next |Appendix 4, Technical Support

Updated on 1/26/97 by Scott S. Lawton (ssl@prefab.com)

Copyright 1993-99, PreFab Software, Inc. All Rights Reserved.

This site built and maintained using Stage Three, a set of custom Frontier scripts.