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

auto close alert message

New Here ,
Oct 25, 2017 Oct 25, 2017

Copy link to clipboard

Copied

Hello everyone ,

i need a script to close alert after 5 seconds automatically. in extend script toolkit please help me .

Thanks and regards,

Arun

TOPICS
Scripting

Views

2.5K

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

correct answers 1 Correct answer

Explorer , Oct 25, 2017 Oct 25, 2017

You have to create your own palette window. Example below


customAlert('Hello', 3, 'This is a test - Will close in 3 seconds')
customAlert('Hello', 0, 'This is a test - Will not close automatically')

function customAlert(message, delaySeconds, title){
    title = title || 'Alert';
    var alertWindow = new Window('palette', title);
    var control_text = alertWindow.add('edittext', [0, 0, 500, 200], message, {multiline: true});
   
    if(delaySeconds == 0){
        var control_close = alertWindow.add('b

...

Votes

Translate

Translate
Adobe
Explorer ,
Oct 25, 2017 Oct 25, 2017

Copy link to clipboard

Copied

You have to create your own palette window. Example below


customAlert('Hello', 3, 'This is a test - Will close in 3 seconds')
customAlert('Hello', 0, 'This is a test - Will not close automatically')

function customAlert(message, delaySeconds, title){
    title = title || 'Alert';
    var alertWindow = new Window('palette', title);
    var control_text = alertWindow.add('edittext', [0, 0, 500, 200], message, {multiline: true});
   
    if(delaySeconds == 0){
        var control_close = alertWindow.add('button', undefined, 'Close');       
        control_close.onClick = function(){
            if(alertWindow){
                alertWindow.hide();
            }
        };
    }

    alertWindow.show();
    alertWindow.update();
   
    if(delaySeconds > 0){
        $.sleep(delaySeconds * 1000);
        alertWindow.hide();
        alertWindow = null;
    }  
}

Glenn

o2 Creative

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
New Here ,
Oct 26, 2017 Oct 26, 2017

Copy link to clipboard

Copied

LATEST

Thank you so much sir!!!

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