onSave Event Listener to prompt scaled images – Part 2
Hi Manan,
Since the previous Post was successfully closed, I have created a new Post to address a new problem.
The script given by Manan, is working fine, but I noticed that if the InDesign file has Vector graphics like .eps or .pdf files, then it is giving an error regarding the event handler, see snapshot.
Can you please check if this can be fixed.
Thanks,
Masood

//DESCRIPTION: Event Listener to check if image is scaled <80% or >120%
#targetengine "save"
app.addEventListener("beforeSave", function(){
for(var i = 0; i < app.documents[0].allGraphics.length; i++)
{
var img = app.documents[0].allGraphics[i]
if((img.absoluteHorizontalScale < 80 || img.absoluteHorizontalScale > 120) || (img.absoluteVerticalScale < 80 || img.absoluteVerticalScale > 120))
{
alert("Scaling of Image(s) is below 80% and/or above 120%. Please Fix it!")
break;
}
}
})