Home Forums XMetaL Tips and Tricks Script Example: Custom Special Characters Form (XFT) Reply To: Script Example: Custom Special Characters Form (XFT)

mag3737

Reply to: Script Example: Custom Special Characters Form (XFT)

Hi Leora,

I find that using “interleaved arrays” often confuses me (and the code) when I'm writing script code.  I'm afraid I don't have time to try this out myself, but I would suggest using two arrays in the script (say “charArray” and “charInsertArray”) and two corresponding lines of characters in the config file.  The first array/configtext will be used *only* for the characters to be shown on the buttons, and the second one is for the corresponding chars to be inserted into the document.

Changes to Derek's original script would be (hopefully I'm not missing something):

1. Add code to General Declarations section:
  a. Declare new array charInsertArray (defined outside all the functions so that it is globally visible to all objects in the form)
  b. Read second line of text from config file and construct the charInsertArray using the second line of text (the characters to be inserted into the doc)

2. Modify OnClick for every button XXX to typeChar(charInsertArray[XXX])

mag

Reply

Products
Downloads
Support