I have created a dialog box in ResEdit, it consists of username and password text fields and a series of checkboxes. The dialog box is called by an AppleScript via the Scripting Addition "DialogRunner".
In ResEdit I want to change the Font used in the password field so that all characters display as bullets. I have found a custom FONT resource from another application which uses a password field in one of its dialogs, so I can copy this resource into my ResEdit dialog. But I dont know what to do next. Any Help?????
Who is Participating?
boonstraConnect With a Mentor Commented:
To change the font of a dialog item, you need to add an Item Color Table Resource ('ictb').  ResEdit, unfortunately, can create/edit these resources only in hex.  If you have Resorcer, it can create them via a GUI.  Assuming you have only ResEdit, you'll need to go to Mac Toolbox Essentials to get the ictb format.  You can get this at <>.  The ictb resource is described in the Dialog Manager chapter on page 6-158.  The format is too difficult to describe here, but here is what it looks like for a DLOG / DITL resource pair (128) with a single edit text item.  The ictb resource has the same resource ID as the DITL.  To change the edit text item font to Times 10, the ictb looks like:

0000: 8007  Item data, change font, typeface, font size
0002: 0004  Item offset to text style table
            (start of text style table)
0004: 0018  typeface offset
0006: 0000  font style 0
0008: 000A  font size 0x0A
000A: 0000  red text color component
000C: 0000  green text color component
000E: 0000  blue text color component
0010: FFFF  red text bkgd component
0012: FFFF  green text bkgd component
0014: FFFF  blue text bkgd component
0016: 0000  text mode (1==srcOr, etc.)
0018: 0554  "\pTimes"
001A: 696D
001C: 6573

If bit 15 of the item data is not set, then the typeface field contains the number of a font family instead of an offset to a typeface name.  This is what I would recommend for you, although that means you need to create a FOND resource as well
gormenghastAuthor Commented:
I am afraid this is beginning to look a bit too complicated for me. I am not familiar with Hex. I checked out the dialog manager chapter you mention, but need a bit more elementary guidance.
Is it possible to change the font information for individual edit text items rather than all. If so how do you specify each one, is this something to do with item offsets. I am probably asking a bit too much here but I was hoping this was going to be something easy to acheive as it appears so often in application dialogs.
I have looked at other applications which use password fields etc in ResEdit but it has not helped much. From one application I found a FONT resource containing a diamond shaped bitmap font.
The resource is as follows:

3200      0 Font Family: .Pwd
3212      200 .Pwd 12

There was however no corresponding FOND resource.
Also in this particular app there is no DITL for the main dialog which uses the password field.

I have not got resorceror, are there any other GUI editors available? I have searched the internet and downloaded some documentation (

The other option I have is to take all my scripting into Facespan and build a dialog here, then I can catch the keystrokes in the text field etc. I really dont want to do this however as it will run much slower than it does with a ResEdit dialog.

Hope you can help some more.
First, most applications that protect passwords by using bullets do so programmatically, by intercepting keyDown events and substituting a bullet character.  This has many advantages, including the fact that someone who Cuts the password and Pastes it into a text editor will not be able to see the password, whereas they would if all you do is change the font.

Your limitation is that you are not writing a program, and thus are limited to the features AppleScript gives you.  Nevertheless, it is possible to do what you want using the technique described above.  The app you describe almost certainly creates the DITL programmatically, on the fly, which is why you don't see it in a resource file.

It is possible to change the font on an item-by-item basis, either programmatically, or by the 'ictb' resource described in the original answer.

I'm not aware of any other resource editors besides ResEdit and Resorcerer.

I think we need to actually exchange files in order for me to be more helpful.  If you post your email address, I'll contact you privately.
gormenghastAuthor Commented:
Hi boonstra
Thanks again for being so helpful, I realise I am being a pest and a bit out of my depth. I will play around with the ictb resource and see if I can get my head round it.
I do understand the security concept you mention (cut & paste), but this is not a problem.
My email address is

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.