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

Need to copy the compound path and paste it to specific art boards

New Here ,
Apr 06, 2024 Apr 06, 2024

Hi Team,

I am very new to this Adobe Illustrator Java Scripting language.

Screenshot 2024-04-06 at 8.57.17 PM.png

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

TOPICS
How-to
668
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

Community Expert , Apr 11, 2024 Apr 11, 2024

I've added a section where you can define specific artboards and ranges.

 

paste_special_range_001.png

 

Download:

 

Paste Special with Range

 

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.

Translate
Adobe
Community Expert ,
Apr 06, 2024 Apr 06, 2024

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.

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
New Here ,
Apr 06, 2024 Apr 06, 2024

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.


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 Expert ,
Apr 07, 2024 Apr 07, 2024

I posted a similar script in this thread:

Paste Special

You may try it and check if it suits your needs.

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
New Here ,
Apr 09, 2024 Apr 09, 2024

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.

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
New Here ,
Apr 10, 2024 Apr 10, 2024

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.

Gopi99_0-1712734170348.png


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.!

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 Expert ,
Apr 10, 2024 Apr 10, 2024

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?

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
New Here ,
Apr 10, 2024 Apr 10, 2024

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.

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 Expert ,
Apr 11, 2024 Apr 11, 2024

I've added a section where you can define specific artboards and ranges.

 

paste_special_range_001.png

 

Download:

 

Paste Special with Range

 

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.

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
New Here ,
Apr 12, 2024 Apr 12, 2024
LATEST

Thank you @Kurt Gold for all your efforts.
The code works perfect. Helped a lot.!

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