Skip to main content
Roy Marshall
Known Participant
March 3, 2017
Question

[JS] Embedding images on placing

  • March 3, 2017
  • 3 replies
  • 1352 views

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

This topic has been closed for replies.

3 replies

Roy Marshall
Known Participant
March 4, 2017

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

Community Expert
March 3, 2017

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… :-)

Roy Marshall
Known Participant
March 4, 2017

Thanks  Uwe

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

Roy

Community Expert
March 4, 2017

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

Loic.Aigon
Brainiac
March 3, 2017

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

Roy Marshall
Known Participant
March 4, 2017

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

Thanks  anyway mate

Roy