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

(JS) Duplicate a graphics frame?

New Here ,
Oct 24, 2008 Oct 24, 2008
I'm trying to duplicate a selected tif graphic, and apply the embedded clipping path as well as an object style to the duplicated image while leaving the original alone.

After reading a lot of help files I git as far as figuring out how to duplicate a selected text frame.

if (app.selection[0].constructor.name == "TextFrame"){
myFrame = app.selection[0];
myDupeFrame = myFrame.duplicate();
}

If I change the "TextFrame" to "Objectframe" or "GraphicFrame" or "ImageFrame" it doesn't work. Is there a place where I can find out what things are called?

Thanks,
Randy
TOPICS
Scripting
4.3K
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 ,
Jun 19, 2009 Jun 19, 2009

Thanks very much Kasyan that's great, it doesn't seem to selecting the photoshop clipping path though.

If I select the path manually, comment out //myClippingPathSettings.clippingType = ClippingPathType.PHOTOSHOP_PATH; and then run the script it does all the other bits brilliantly

Any ideas?

Thanks again

Paul

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
Guru ,
Jun 19, 2009 Jun 19, 2009

I made this script for CS3 -- you didn't mention that you need it for CS2 at first. I'll try to check it in CS2, if I have time, but don't promise.

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 ,
Jun 19, 2009 Jun 19, 2009

No problem, thanks for your time, its much appreciated

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 ,
Jun 19, 2009 Jun 19, 2009

Just looking at this some more and it seems that it has chosen the path, but not actually applied it (very strange), so if you go into clipping paths and click the preview button off and then on again it will work.

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
Guru ,
Jun 19, 2009 Jun 19, 2009

I now remember that InDesign CS2's scripting is broken with respect to clipping paths. I found a workaround back in CS2 days, but it was so long ago that I can't recollect how I did it. Another problem is that the only copy of CS2 I have in my disposal is broken: I can't debug scripts in ESTK, I am able only to run 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
New Here ,
Jun 19, 2009 Jun 19, 2009

I wonder if a tiny inset frame measurement (0.01mm) would force it to apply?

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
Guru ,
Jun 19, 2009 Jun 19, 2009

No, I tried and it didn't help. Time to upgrade!

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 ,
Jun 19, 2009 Jun 19, 2009
LATEST

Can't do that unfortunately.

Thanks very much for you help on this, maybe I'll find some bodge to make it work.

cheers

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