Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

118
Visualizações
adobe jsx setting fill and stroke not updating until script is finished

I finished this script to set the colours on some paths stoke and fill named The Path name is = "Block" in illustrator and then I wanted to open a save as. Only problem is the changes are not registering until after the save dialog where the page is refreshed with changes. What do I need to call to refresh before the save dialog.

if ( app.documents.length > 0) {


//Set some colours
var blackColor = new RGBColor();
blackColor.red = 0;
blackColor.green = 0;
blackColor.blue = 0;

var whiteColor = new RGBColor();
whiteColor.red = 255;
whiteColor.green = 255;
whiteColor.blue = 255;




var docRef = app.activeDocument;  
//var layers = docRef.layers;  
//var myLayer = layers["layer1"]; //this defines the layer that you want to get the selection from  
//
docRef.selection = null; //ensure there is nothing in the document selected already. this way you only get the selection you want.  
for(var a=0;a<docRef.pathItems.length;a++){
    if (docRef.pathItems[a].name == "Block"){
     docRef.pathItems[a].fillColor = whiteColor;
     docRef.pathItems[a].strokeColor = blackColor;
     docRef.pathItems[a].selected = true;
     }
}

////////
//This need to be added to refresh the draw process
redraw();   //<--Add This
/////////

alert("Save outline"); 
app.executeMenuCommand("saveas"); 

}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda