If it was just a matter of truncating at some maximum length I could deal with it. But even relatively short strings are truncated.
Here’e my best try yet on my borrowed mac:
the prompts can contain NO spaces. Try adding them and see what happens.
All prompts must be padded to the same length,
All prompts must have minimum 5 character padding at right.
displaying feet and inches will require extra work to replace spaces with dashes.
No prompt can be larger than 25 characters.
Title can’t be larger that 51 characters.
No forward slashes in prompts.
Try this on mac: add spaces or remove padding to see what happens.
xprompt = "X=292.1mm_____________"
yprompt = "X=292.1mm>266.7mm_____"
zprompt = "X=292.1mm>334.5mm_____"
prompts = [xprompt, yprompt, zprompt]
puts xprompt
puts yprompt
puts zprompt
#set defaults
defaults = ["","",""]
#set list
list = ["","",""]
#set title
titletext = "Enter Sizes, Increments (+|-) or Factors (*|/)"
#Here is inputbox
resultinputbox = UI.inputbox(prompts, defaults, list, titletext)
The problem on MAC with spaces only comes up when prompts get close to 25 characters.
Try editing my code above. I cant because I had to give my borrowed mac back to its owner.
Another discovery
The MAC inputbox automatically right justifies each prompt string so it is close to the entry field. This makes it more readable. The Windows input box keeps the prompt string left justified, so I often padded shorter prompts with leading spaces to get them right justified in Windows. This looked better but causes truncation when displayed on a MAC.
Also trying to grasp Inputbox on Mac.
tested;
3 lines holding 2 groups (words) of 10 chars each separated by a space; input box displays only the first group.
The second ‘word’ of each line is displayed by adding a space and 4 more chars to the last one. But those added chars do not display.
updt:
Actually adding the chars to any line will have the same effect.
inputbox ([‘1234567890 1234567890’,‘1234567890 1234567890 1234’,‘1234567890 1234567890’], [“”], “Mac InputBox Length study”)
I could be wrong but to me this looks like line breaking with the additional lines hidden. “QwertyuiopQwertyuiop” which is just one word is shown with no problem in the screenshot but “Qwert yui opghjklQwertyuiop” gets it last word truncated. “Asdf ghjkl Asdf ghjklQwertyuiop” also gets the last word truncated while “Zxcvb nm Zxcvbnm” which is shorter than “QwertyuiopQwertyuiop” isn’t truncated.
That is what I did; n-b spaces between words.
But still, several ones have to be added in order to make the line long enough not to be truncated.
At least those added spaces do not display.
This should have been corrected by Apple long ago !
Yes. In fact truncation can happen anywhere in a word, not only between them.
Seems like there is no other way but having the last line longer than any one above. So, for now, lines have n-b spaces between words and last one has padding added.
Yes, that seems to be the only solution. Had to create something quickly for my client and at least it works fine on Windows (although the spacing is just awful).
I have a single field and I ended up adding another word on macOS (as the inputbox will ignore it). Anyway, I will code this properly using a UI::HtmlDialog pop-up.