Copy link to clipboard
Copied
Hello,
Is there a script out there that I have not been able to find that will allow you to place a Symbol, Centered and slightly below in relation to the selected art? Everything that I have tried places the Symbol based on x y coordinates.
Thank you!
Copy link to clipboard
Copied
What about this script by Jet?
- /*
- JET_ReplaceWithSymbol.jsx
- A Javascript for Adobe Illustrator
- Purpose: Replaces selected items with Instances of a Symbol from the Symbols Panel.
- The desired Symbol can be defined by its index number (its number of occurrance in the Panel).
- */
- var docRef=app.activeDocument;
- var symbolNum=prompt("Enter the number of the Symbol you want to replace each selected object",1);
- for(i=0;i<docRef.selection.length;i++){
- var currObj=docRef.selection;
- var currLeft=currObj.left;
- var currTop=currObj.top;
- var currWidth=currObj.width;
- var currHeight=currObj.height;
- var currInstance=docRef.symbolItems.add(docRef.symbols[symbolNum-1]);
- currInstance.width*=currHeight/currInstance.height;
- currInstance.height=currHeight;
- currInstance.left=currLeft;
- currInstance.top=currTop;
- currInstance.selected=true;
- currObj.remove();
- redraw();
- }
Copy link to clipboard
Copied
I'm not sure on this one because I am not replacing anything.
The most important thing is that the "ART" not move at all.
Right now I am Placing the Symbol (Generic Cyan Shape)
Selecting Both
Clicking on the "ART" so that I can center to that object
Center Horizontally
Align Bottom
Then with the Symbol Selected I am doing a "Transform Each" with the below settings twice.
Copy link to clipboard
Copied
Salut !
// JavaScript Document for Illustrator
var space = 10; // pt
var symbIndex = 0;
function slign(dec,index) {
var currObj, VBounds, currInstance;
for( var i = 0; i < selection.length; i++ ){
currObj =selection;
VBounds =currObj.visibleBounds;
currInstance= activeDocument.symbolItems.add(activeDocument.symbols[index]);
currInstance.position = [(VBounds[0]+VBounds[2])/2-currInstance.width/2,VBounds[3]-dec];
}
}
if (app.documents.length) {
slign(space,symbIndex);
}
de LR elleere