2

I have a normal display dialog working using AppleScript within the Editor. How would one increase the width of the display dialog and add text under the input field and above the buttons. In advance, thank you for your time.

display dialog "EXAMPLE" with icon alias ((path to me) & "Contents:Resources:ICON.icns" as string) default answer (do shell script "SHELL SCRIPT HERE " & quoted form of (text returned of (display dialog "Enter String:" default answer "" buttons {"OK"} default button 1 with title "EXAMPLE"))) buttons {"OK"} default button 1 with title "EXAMPLE"
1

You can't control this with vanilla AppleScript. There may be a plugin/hack that lets you do this, but I haven't found one.

The best way to accomplish this is to use Xcode and AppleScriptObjectiveC.
Tutorials and a book on that are available here.

2

Regarding "Changing Width of Dialog Box", I know of no method to decrease the width of a dialog box.

How would one increase the width of the display dialog

One unsophisticated method to increase the width of a dialog does exist.

A dialog will automatically widen to accommodate the full width of (so as to not truncate) a button title. Consequently, you can add space characters to the button text (spaced out evenly on both ends for a symmetrical appearance) to increase the overall dialog width.

Using your sample dialog:

Before

After

It looks funny to have such a broad button, but this is better than nothing, I suppose.

Using this method, you can make an AppleScript dialog as wide as your screen.

I'd prefer that this trick worked with the dialog title instead. But, if a dialog title exceeds the length of the dialog, the dialog title will simply be cut off, and an ellipsis will be appended.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .