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

INDESIGN Transformation automatique /// Forme Blocs /// Rond > Carré

Community Beginner ,
Nov 27, 2017 Nov 27, 2017

Bonjour sur indesign je travaille sur un guide avec des miliers de pictogramme dans des blocs ronds...

Cette année il faudrait que ces blocs soient carrés... Auriez vous un script ou une idée de comment je peux faire pour automatiser la tache ?

Car je ne trouve rien dans les paramètres de rechercher/remplacer pour faire cela... et à la main au secours...

Merci beaucoup

TOPICS
Scripting
1.1K
Translate
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

People's Champ , Nov 27, 2017 Nov 27, 2017

So if we can simply convert all ovals to rectangles, this should work:

var i, o;

o = document.allPageItems;

while (i = o.pop()){

if (i instanceof Oval){

     i.convertShape(ConvertShapeOptions.CONVERT_TO_RECTANGLE);

}

But I think it would be a good idea to apply object styles to them at this stage. So, instead of the above, select one of the ovals, apply an object style to it, and then run this:

var i, o, s = app.selection[0].appliedObjectStyle;

o = document.allPageItems;

while (i = o.pop()){

if (i instanc

...
Translate
People's Champ ,
Nov 27, 2017 Nov 27, 2017

Changing a rectangle to an oval (if I've understood the question correctly) is an easy task.

To do so for thousands of images in a document? Well, it depends on how the document has been set up...

Are any images in groups?

Have object styles been used? That would make things a lot easier....

Are there any other objects on the page that should not be changed?

With answers to these questions a script could be cooked up -- more or less complicated depending on the answers!

Ariel

Translate
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
LEGEND ,
Nov 27, 2017 Nov 27, 2017

Salut Ludovic,

Cela pourrait être "simpliste" ou plus compliqué comme le suggère justement Ariel !

Avant :

Capture d’écran 2017-11-27 à 14.40.14.png

1 clic plus tard !

Capture d’écran 2017-11-27 à 14.40.36.png

(^/)

[Such a script is not proposed for free because I think such a gratuity no longer values scripters' real work and knowledge, as it may have been the case by the past!]

Translate
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
Community Beginner ,
Nov 27, 2017 Nov 27, 2017

Déjà merci de vos réponses... Je vous explique comment le document est construit et je vais ajouter capture également...

Déjà pas de style de bloc (hélàs)... Il s'agit d'un bloc texte avec des blocs ronds ancrés à l'intérieur...

On pourrait TOUT transformer rond vers rectangle je n'ai pas d'autres blocs ronds... Ou s'il le faut on peut aussi travailler avec une couleur car ces blocs ont une couleur nuancier...

Comme il y a beaucoup de choses sur la capture il s'agit des pictogrammes sous la photo...

Capture-d’écran-2017-11-27-à-15.03.17.jpg

Already thank you for your answers ... I explain how the document is built and I will add capture also ...

Already no block style (alas) ... This is a text block with round blocks anchored inside ...


We could turn round to rectangle I do not have other round blocks ... Or if we must we can also work with a color because these blocks have a color swatch ...


Since there are many things about the capture, it's about the pictograms under the photo ...

Translate
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
LEGEND ,
Nov 27, 2017 Nov 27, 2017

Capture d’écran 2017-11-27 à 15.39.20.png

Capture d’écran 2017-11-27 à 15.39.29.png

… sachant que les "blocs circulaires" 1-2-3 ont un fond "M100" et les 4 à 14 un fond "C100"!

(^/)

[Such a script is not proposed for free because I think such a gratuity no longer values scripters' real work and knowledge, as it may have been the case by the past!]

Translate
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
People's Champ ,
Nov 27, 2017 Nov 27, 2017

So if we can simply convert all ovals to rectangles, this should work:

var i, o;

o = document.allPageItems;

while (i = o.pop()){

if (i instanceof Oval){

     i.convertShape(ConvertShapeOptions.CONVERT_TO_RECTANGLE);

}

But I think it would be a good idea to apply object styles to them at this stage. So, instead of the above, select one of the ovals, apply an object style to it, and then run this:

var i, o, s = app.selection[0].appliedObjectStyle;

o = document.allPageItems;

while (i = o.pop()){

if (i instanceof Oval){

     i.convertShape(ConvertShapeOptions.CONVERT_TO_RECTANGLE);

     i.applyObjectStyle(s);

}

}

This will apply the object style of the selected item to all the ovals as it converts them.

I havent tested this, but it should work.

Ariel

(Re. free scripts: My "policy" is that I'm willing to donate a script that only involves a single loop! )

PPS Of course, this script only works because the ovals look like balloons, so you can perform a pop() function on them...

Translate
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
Guide ,
Nov 27, 2017 Nov 27, 2017

I marked as helpful, because of the POP.

LOL

P.

Translate
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
People's Champ ,
Nov 27, 2017 Nov 27, 2017

It is helpful: people don't realize how intuitive scripting is.

Translate
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
Enthusiast ,
Nov 28, 2017 Nov 28, 2017
LATEST

Merci pour cette excellente utilisation du .pop() !!!

Merci pour cette excellente utilisation du .pop() !!!

Translate
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
Community Beginner ,
Nov 27, 2017 Nov 27, 2017

Thank you very much ... The version with the application of style works perfectly and has a real added value.

Merci infiniment... La version avec l'application du style marche à merveille et a une reelle valeur ajoutée.

Translate
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