• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Alert dialog box custom width

Engaged ,
Jan 23, 2025 Jan 23, 2025

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?

 

GhoulFool_0-1737642254734.png

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();
}

 

 

TOPICS
Actions and scripting

Views

54

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jan 24, 2025 Jan 24, 2025

Copy link to clipboard

Copied

LATEST

@Ghoul Fool 

 

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines