Salir
  • Comunidad global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티

SctiptsUI Windows Immediately Close

Explorador ,
Oct 30, 2020 Oct 30, 2020

I've just started with learning how to create UI panels and windows. I've quickly run into a problem and would like some help.
Here is my script:

var palette = new Window("window"); 
    palette.text = "Dialog"; 
    palette.preferredSize.width = 277; 
    
palette.show();

When I run from VSCode, it shows fine. When I save it and run it in Illustrator (File>Scripts>Other Scripts) It looks like the window appears for a split second, then emmediately closes.

TEMAS
Scripts
616
Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines

correct answers 1 respuesta correcta

Community Expert , Oct 30, 2020 Oct 30, 2020

Hi @Amdival 

do you want a Palette or a Dialog?

 

example for Dialog

var dlg = new Window("dialog", 'Title Dialog');
dlg.preferredSize.width = 277; 
    
dlg.show();

 

example for Palette:

 

#targetengine main

var plt = new Window("palette", 'Title Palette');
plt.preferredSize.width = 277; 
    
plt.show();

 

 

If that works for you

have fun

😉

Traducir
Adobe
Community Expert ,
Oct 30, 2020 Oct 30, 2020

Hi @Amdival 

do you want a Palette or a Dialog?

 

example for Dialog

var dlg = new Window("dialog", 'Title Dialog');
dlg.preferredSize.width = 277; 
    
dlg.show();

 

example for Palette:

 

#targetengine main

var plt = new Window("palette", 'Title Palette');
plt.preferredSize.width = 277; 
    
plt.show();

 

 

If that works for you

have fun

😉

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Oct 30, 2020 Oct 30, 2020

Thanks for the reply!
I do see that I was using an argument that was not valid ("window")

When I use "dialog" as the first argument, it works.

When I use "palette" as the first argument, nothing appears.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Community Expert ,
Oct 30, 2020 Oct 30, 2020

Have you added a targetengine for your Palette (see my example)?

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Explorador ,
Oct 30, 2020 Oct 30, 2020
MÁS RECIENTES

Thank you so much!
 I guess I overlooked it in the above code block!

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines