Copy link to clipboard
Copied
Is there a way of specifying the width of the alert box?? ie preferredSize.width = 300;
I often use them to display file names with full paths - and those tend to get line-wrapped - which I find difficult to read; prefering them one line apiece.
Without having to say... create a custom window?
Fake file real place, BTW.
function scriptAlert(alertString1)
{
var alertWindow = new Window("dialog", undefined, undefined, {resizeable: false});
alertWindow.preferredSize.width = 300;
var alertText = alertWindow.add("group");
alertStringSize1 = alertText.add("statictext", undefined, alertString1, {name: "alertText", multiline: true});
var okButton = alertWindow.add("button", undefined, undefined, {name: "okButton"});
okButton.text = "OK";
alertWindow.show();
}
Copy link to clipboard
Copied
Not that I am aware of, these are native OS windows.
I have always been challenged with scriptUI. So when I found out about the dialog builder from Joonas Pääkkö, I created some template/boilerplate versions of the standard UI windows and added the additional code required to "do stuff":
https://github.com/MarshySwamp/ScriptUI-Alert-Window
https://github.com/MarshySwamp/ScriptUI-Prompt-Window
https://github.com/MarshySwamp/ScriptUI-Prompt-Window-Integer
https://github.com/MarshySwamp/ScriptUI-Confirm-Window