I am using DTP to show a list of checkboxes in an enhanced window. The checkboxes have titles which form into columns. The dialog has headings which should line up with the columns in the checkboxes. I am using a single create label
for the headings.
In all these controls, I am trying to use tab characters to position the text into columns. This works but only until the controls are about 400 wide. Then, the text wraps to another line. If I replace the tabs with space characters, there is no wrapping but that makes column positioning unpredictable. If I turn off multiline, the text does not space out and stays within the 400 width.
Visually, the problem looks the same as with “display dialog”. It also wraps strings containing tab characters – it also wraps strings containing spaces, which is well known.
This code illustrates my question:
use AppleScript version "2.4"
use scripting additions
use script "Dialog Toolkit Plus" version "1.1.3"
set the_headings to "ID" & tab & "Extension" & tab & tab & tab & "Performance" & tab & "File size" & tab & "File Type" & tab & tab & "Creator"
display dialog the_headings
set {headings, theTop, theWidth} to create label the_headings left inset 30 bottom 20 max width 900
set {theButtons} to create buttons {"Copy", "OK"} default button 2
display enhanced window "Formats" acc view height theTop + 20 acc view width 900 buttons theButtons acc view controls {headings}
Result looks like this:
This is with multiline off:
Is there a way to force create label
to space out text with tabs ?