Copy link to clipboard
Copied
Hi Team,
I am very new to this Adobe Illustrator Java Scripting language.
var doc = app.activeDocument;
var layers = doc.layers;
var desiredLayerName="Layer 1"
var targetLayer = layers.getByName(desiredLayerName);
var placedItem = targetLayer.placedItems;
if(placedItem.typename == "CompoundPathItem") {
console.log("test");
}
// Example: Duplicate and place before a specific artboard (index 0)
var targetArtboard = doc.artboards[1];
I would like to paste this compound path to specific art board as shown above.
Can any one please help me with this query? I need the scripting code for the same.
Thank you
I've added a section where you can define specific artboards and ranges.
Download:
Entering "1,3,6,8-12" in the Range text box should paste the current clipboard on artboard 1, 3 and 6 as well as on artboard 8 to 12.
Try it and report back if it works as expected.
Copy link to clipboard
Copied
How would you expect this script should be working?
You select an object on an artboard, copy it and paste it at the same position on a specified artboard (that may be always the same, like artboard 3)? And with the same dimensions?
Or are you looking for something that lets you select any artboard of the current document to which the object should be pasted at the same position? Probably with a modal dialog? If it should be with a modal dialog, how exactly should the modal dialog be constructed to suit your needs?
What should happen if some or all artboards have different dimensions?
And what else has to be considered to get it right according to your requirements?
Sorry to be a bit verbose about the requirements, but these kinds of thoughts arise when things are not clarified as needed to provide an appropriate approach.
Copy link to clipboard
Copied
Hi @Kurt Gold .
Thanks for your quick response.
Requirment: We have a list of Artboards, and all of them will be having same dimensions. Our idea is to paste this Compound Path (basically looks like a border to Artboards/Pages) to specified Artboard/Artboards. In Adobe Illustrator GUI we can only find a option to paste this Compound Path to all the Art Boards, but not to a specific Art Board/Art Boards. We thought to write a script, so if you want to paste this Compound Path/ Border to even/odd order (specified) Art Boards/Pages.
Hope you understood my requirment and I believe you can provide me some guidance to achieve my idea.
I will be waiting for your response.
Copy link to clipboard
Copied
I posted a similar script in this thread:
Paste Special
You may try it and check if it suits your needs.
Copy link to clipboard
Copied
Hi @Kurt Gold ,
Sorry for delay in response. Let me give a try on it and will share the feedback of it, whether it works for my use case of not.
Thank you for looking into my issue.
Copy link to clipboard
Copied
Hi @Kurt Gold ,
I have tried above script that actually suits our use case.
On seeing the above code, we got an idea and also looking for this functionality.
We expect a text box like another option - Where we can send a list of values to it and on execution it should paste on specified Art Boards.
Can you share some insights over it? As pasted on specified is our primary requirment.
Thank you once again for the amazing script. It works great.!
Copy link to clipboard
Copied
Yes, it's possible to implement the functionalitiy to specify ranges.
Have you already tried to work on that or are you looking for an instant result?
Copy link to clipboard
Copied
Hi @Kurt Gold ,
I am very new to this scripting language, so for me writing a code is bit of task.
But I would be happy if I can find any code for specific ranges...
If you want me to open a new post for this question, I will do that.
I will close this thread by accepting your answer.
Thank you.
Copy link to clipboard
Copied
I've added a section where you can define specific artboards and ranges.
Download:
Entering "1,3,6,8-12" in the Range text box should paste the current clipboard on artboard 1, 3 and 6 as well as on artboard 8 to 12.
Try it and report back if it works as expected.
Copy link to clipboard
Copied
Thank you @Kurt Gold for all your efforts.
The code works perfect. Helped a lot.!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now