Copy link to clipboard
Copied
This script works fine in CC2015 but I really need it to work in InDesign CS3 aswell - can anyone help me out?
When I run the script in CS3 nothing happens - no errors and no alert though the document contains missing links and fonts.
if (app.documents.length != 0)
{
var MY_DOC = app.activeDocument;
var myLinks = MY_DOC.links;
var thePageNames = new Array();
for (var j = 0 ; j <= (myLinks.length - 1); j++)
{
if(myLinks
.status == LinkStatus.LINK_MISSING || myLinks.status == LinkStatus.LINK_OUT_OF_DATE == true){ try
{
thePageName = myLinks
.parent.parentPage.documentOffset; }
catch (e)
{
continue; // must be on Pasteboard so ignore
}
thePageNames[thePageName] = 1
}
}
if (thePageNames.length != 0)
{
var s = "";
for (i in thePageNames)
{
s = s + app.documents[0].pages[Number(i) - 1].name + ", ";
}
s = s.substring(0,s.length - 2);
if(!confirm("Missing or not updated links in document - continue?"))
exit();
if(fun_FontMissing)
if(!confirm("Font missing in document - continue?"))
exit();
}
}
function fun_FontMissing()
{
var isFontMis=false;
try{
for(var i=0;i<MY_DOC.fonts.count();i++){
if(MY_DOC.fonts.status==1718832705 || MY_DOC.fonts.status == 1718834037 || MY_DOC.fonts.status == 1718830689){
isFontMis=true;
}
}
}
catch(ex){
alert(ex);
exit();
}
return isFontMis;
}
Copy link to clipboard
Copied
add this line in top of script
app.scriptPreferences.version = "6.0"
Copy link to clipboard
Copied
Same result:
When I run the script in CS3 nothing happens - no errors and no alert though the document contains missing links and fonts.
Copy link to clipboard
Copied
ok.. i just checked CS3 version number is 5, let try this
app.scriptPreferences.version = "5.0"
Copy link to clipboard
Copied
tpk1983, the scriptPreferences.version is used to make old scripts run into newer indesign versions. Runew needs it the other way around, and for that the script needs to be rewriten not to use things like parentPage that is not available in cs3.
Copy link to clipboard
Copied
Thanks for the information. I just provided a temporary solution for Runew, i did this for some old scripts and got results.. i agree it need to be rewritten
Copy link to clipboard
Copied
And can you help me rewrite it?
I have this script for checking overset fonts and it works fine i CS3:
if (app.documents.length != 0){
var myFrames = app.activeDocument.textFrames;
var thePageNames = new Array();
for (var j = 0 ; j <= (myFrames.length - 1); j++) {
if(myFrames
.overflows && myFrames .itemLayer.visible == true){ try {
thePageName = myFrames
.parent.documentOffset; } catch (e) {
continue; // must be on Pasteboard so ignore
}
thePageNames[thePageName] = 1
}
}
if (thePageNames.length == 0) {
} else{
var s = "";
for (i in thePageNames) {
s = s + app.documents[0].pages[Number(i) - 1].name + ", ";
}
s = s.substring(0,s.length - 2);
if(!confirm("Overset text found - Do you want to ignore?"))
exit();
}
}
Copy link to clipboard
Copied
Sorry i don't have CS3, but like Vamitul said, you may try..
not sure change your line 12 from
thePageName = myLinks
to
thePageName = myLinks
just a try
PS: but did u tried
app.scriptPreferences.version = "5.0" ??
Copy link to clipboard
Copied
I have tried to change to thePageName = myLinks
I cannot figure why it works with the overset text and not for missing/out of date links.
I did also try app.scriptPreferences.version = "5.0" and stil no luck.
Did I put it in the correct place in the script?
app.scriptPreferences.version = "5.0"
if (app.documents.length != 0)
{
var MY_DOC = app.activeDocument;
var myLinks = MY_DOC.links;
Copy link to clipboard
Copied
Sorry, I don't have CS3, i don't remember the CS3 DOM, haven't scripted CS3 since CS4 came out.
Copy link to clipboard
Copied
Yes you put the line in the right place. The CS3 object model is different with the higher version, we have check with that object model. But if i have CS3 then only i can able to see the script working or not. Helpless now.
Copy link to clipboard
Copied
I can give you acces to my machine with teamviewer and then you can work with CS3?
Copy link to clipboard
Copied
No one else with some CS3 skills can help me figure this out?
Copy link to clipboard
Copied
I still hope someone can help me out here