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

[JS] Embedding images on placing

Participant ,
Mar 02, 2017 Mar 02, 2017

Copy link to clipboard

Copied

I am needing a way to automatically embed any image my script is placing. Is there a way to do this?

PageItem.place (fileName: File , showingOptions: Boolean , withProperties: Object )

allows me to apply properties, but I cannot find one to embed on Place.

Maybe it doesnt exist. If not, can I override the Default Kb size that InDesign will automatically embed when placing (aka. PageMaker back in the days)

Cheers!!

Roy

TOPICS
Scripting

Views

1.0K

Translate

Translate

Report

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
People's Champ ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

Embedding a link is easy :

See unlink

so you can do something like

myPageItem.place(myFile)[0].itemLink.unlink(); //

Apart from that if you want to have automatically done for every single placed file, you would have to set an afterPlace eventListener.

HTH

Loic

Votes

Translate

Translate

Report

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
Participant ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

An after place listener would not help me in my weird requirement!

Thanks  anyway mate

Roy

Votes

Translate

Translate

Report

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 ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

Hi Roy,

ah, you remember that old PageMaker "feature"…
No there is nothing there with InDesign.

Embedding a placed image is easy.

Just use the method unlink() with the link of the placed image.

You could also do the contrary with method unembed() of a link.

You will get the link of a placed image with image.itemLink .

Look it up here:

Adobe InDesign CS6 (8.0) Object Model JS: Table of Contents, Links Suite

Regards,
Uwe

// Loic was faster… 🙂

Votes

Translate

Translate

Report

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
Participant ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

Thanks  Uwe

It's a shame that feature is not in InDesign as it was in PageMaker. I used it alot!

Roy

Votes

Translate

Translate

Report

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 ,
Mar 04, 2017 Mar 04, 2017

Copy link to clipboard

Copied

LATEST

Hi Roy,

back then that feature of PageMaker was a burden to me.
I don't miss it with InDesign.

But back to your problem with "after place".
Look also into "beforePlace" to get valuable info out of the registered event.


Check event.target for available properties and values.

Whatever your "weird requirements" are…

Regards,
Uwe

Votes

Translate

Translate

Report

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
Participant ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

Thanks guys.

That sort of confirms my thoughts. I do use the unlink function elsewhere and it does it's job as expected. I was hoping to speed up a current task I have, and if I could have the data embedded in the indd doc as the image was being placed it may have helped my cause.

It would be hard going into the "why's" here, just trust me!

Thanks again

Roy

Votes

Translate

Translate

Report

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