Copy link to clipboard
Copied
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
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
...Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Salut Ludovic,
Cela pourrait être "simpliste" ou plus compliqué comme le suggère justement Ariel !
Avant :

1 clic plus tard !

(^/)
[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!]
Copy link to clipboard
Copied
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...

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 ...
Copy link to clipboard
Copied


… 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!]
Copy link to clipboard
Copied
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...
Copy link to clipboard
Copied
I marked as helpful, because of the POP.
LOL
P.
Copy link to clipboard
Copied
It is helpful: people don't realize how intuitive scripting is.
Copy link to clipboard
Copied
Merci pour cette excellente utilisation du .pop() !!!
Merci pour cette excellente utilisation du .pop() !!!
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now