Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

142
Vistas
How to set default document effects using CEP/JavaScript?

I'm building an application which is drawing many objects (rectangles, lines, circle, etc.) in an Indesign document using CEP/JS. The issue I have is that all objects I’m adding are inheriting document’s default transparency settings, etc. which is a big issue as these settings are not under control (can be different on any document).

So, my first solution to this is to explicitly define all attributes for any object I’m drawing to overcome this and this works ok but the issue I have now is performance as I discover that settings all these objects attributes explicitly is taking a lot of time (and CPU). As a reference, I’ve to set around 40 attributes per object. On a test document with 100 objects to draw, it takes around 10 seconds and on the same document with exact same objects + settings 40 attributes, it goes to 40 seconds for the same job.

So question is :

  • Is it possible to prevent CEP to use the document default attribute when drawing new objects?
  • Is there a way to store the default values from the document in a variable, reset all the default values in the document prior to draw all my objects and then set the initial values back when done (to avoid having to set 40 attributes for every objects in a massive loop).

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I applied @RobC and @Yuri Khristich's solution which is to use the ObjectStyle of type 'None' on the various items I draw. It still takes time but less than before.

Here is the example :

https://paste.ee/p/3fW9a

var doc = app.activeDocument;

// 1. Obtain a reference to the '[None]' Object Style.
var noneObjectStyle = doc.objectStyles.itemByName('[None]');

// 2. Draw a rectangle
var rectangle = doc.pages[0].rectangles.add({
 geometricBounds: [0, 0, 50, 50],
 appliedObjectStyle: noneObjectStyle // <-- 3. Set its Object Style to [None].
 // ...
});
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda