Clearly I am out of my depth and should not even try to do what I am trying, but if there’s an easy answer to this question. I’ll be very grateful. After a great deal of trial and error (mostly error) I created this dialog using Dialog Toolkit Plus:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
use script "Dialog Toolkit Plus" version "1.1.0"
set accViewWidth to 300
set {theButtons, minWidth} to create buttons {"Cancel", "OK"} button keys {"", ""} default button 2 cancel button 1
set {keyField, keyLabel, theTop, fieldLeft} to create side labeled field "" placeholder text " " bottom 0 total width accViewWidth label text "Key (default [space]; try 'e'): " field left 0
set {depthField, depthLabel, theTop, fieldLeft} to create side labeled field "" placeholder text "6" bottom (theTop + 14) total width accViewWidth label text "Search depth (default 6): " field left 0
set {maxField, maxLabel, theTop, fieldLeft} to create side labeled field "" placeholder text "12" bottom theTop + 12 total width accViewWidth label text "Max password length (default 12):" field left 0
set {minimField, minimLabel, theTop, fieldLeft} to create side labeled field "" placeholder text "3" bottom theTop + 10 field left 0 label text "Min password length (default 3): " total width accViewWidth
set {headingLabel, theTop} to create label "I will use these settings for decrypting; change only if defaults fail." bottom theTop + 14 max width accViewWidth aligns left aligned
set {buttonName, controlsResults} to display enhanced window "Settings" acc view width accViewWidth acc view height theTop acc view controls {headingLabel, keyField, keyLabel, depthField, depthLabel, maxField, maxLabel, minimField, minimLabel} buttons theButtons active field minimField initial position {10, 10} with align cancel button
What I can’t figure out is something that ought to be obvious: how to get the user’s input from the dialog into a variable? Whenever I try to set a variable to (for example) “depthField” I get an error message saying that nsTextString - or its stringValue() when I tried using that - can’t be converted to text.
Apologies for wasting bandwidth on a question that anyone who knows anything AppleScript should be able to answer