[JS] Embedding images on placing
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
Copy link to clipboard
Copied
Embedding a link is easy :
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
Copy link to clipboard
Copied
An after place listener would not help me in my weird requirement!
Thanks anyway mate
Roy
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… 🙂
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
Copy link to clipboard
Copied
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
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

