Copy link to clipboard
Copied
Hello.
I want to have a preeflight for indesign that only checks visible objects.
We have alot of hidden objects due to we work with a plugin Easy Catalog and its able to change things (for example price bubble/market bubble) depending on different variables.
I cant see you have that option when you set up an preeflight option.
Would it be possible to write/program a specific one that meets this demand?
Best regards Mattias
Hello Mattias,
Sorry for the delay. Save the InDesign document and run the script below. Then every time you save the document, the script updates the non-printing values to true if visible and false if not visible. After closing the document the script is not running anymore and the script engine is deleted after InDesign application is closed. This could be written also as an application level event listener; perhaps as a startup script.
#targetengine session;
app.activeDocument.addEventListe
Copy link to clipboard
Copied
Hello Mattias,
A cleaning script can be written, which deletes all hidden objects. That way the file size is reduced also. Of course if the hidden objects are needed later this is no good.
Cheers!
Funtom
Copy link to clipboard
Copied
Thanks for the tip, unfortunately the hidden objects may be needed later in the process.
Copy link to clipboard
Copied
Hi @mattiaso33135605 sorry if this is a dumb questions, but just checking that you have these options set?
Copy link to clipboard
Copied
Hidden objects are not non-printing by default. This script below sets all hidden page items' non-printing value to true. Notice that hidden layer doesn't make its items hidden.
doc = app.activeDocument;
for (var i = 0; i < doc.allPageItems.length; i++){
if (doc.allPageItems[i].visible == false) doc.allPageItems[i].nonprinting = true;
}
Copy link to clipboard
Copied
Hi Funtom.
First i didnt understand how to get this script/text in to indesign.
I duplicated an excisting .jsx file and put your code in to that and renamned it.
Worked good but how would you suggest to put code like this (im not a coder)
Anyway the script did exactly what i wanted, all the warnings dissapeared for the hidden objects but i also see that if you bring back a hidden object its still not effected by the preeflight (you dont get back a warning for the text overflow) is it possible to have this function included in one script so you just runs the same script after the document has been updated? or shall it be a second script that puts back the non-printing value as it was before on all showing objects, i hope you understands what i mean 😊
Copy link to clipboard
Copied
Do a 2nd one and change false to true and true to false
Copy link to clipboard
Copied
Hello Mattias,
Sorry for the delay. Save the InDesign document and run the script below. Then every time you save the document, the script updates the non-printing values to true if visible and false if not visible. After closing the document the script is not running anymore and the script engine is deleted after InDesign application is closed. This could be written also as an application level event listener; perhaps as a startup script.
#targetengine session;
app.activeDocument.addEventListener("afterSave",change_nonprinting);
function change_nonprinting (){
doc = app.activeDocument;
for (var i = 0; i < doc.allPageItems.length; i++){
if (doc.allPageItems[i].visible == false) {
doc.allPageItems[i].nonprinting = true;
}
else {
doc.allPageItems[i].nonprinting = false;
}
}
}
Cheers!
Funtom
P.S. If there is a script used frequently, might make sense to apply a keyboard shortcut for it.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more