• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Convert script to InDesign CS3

Participant ,
Apr 10, 2016 Apr 10, 2016

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;

}

TOPICS
Scripting

Views

807

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 10, 2016 Apr 10, 2016

Copy link to clipboard

Copied

add this line in top of script

app.scriptPreferences.version = "6.0"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 11, 2016 Apr 11, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 11, 2016 Apr 11, 2016

Copy link to clipboard

Copied

ok.. i just checked CS3 version number is 5, let try this

app.scriptPreferences.version = "5.0"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Apr 11, 2016 Apr 11, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 11, 2016 Apr 11, 2016

Copy link to clipboard

Copied

Vamitul

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 11, 2016 Apr 11, 2016

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();

  }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 11, 2016 Apr 11, 2016

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.parent.parentPage.documentOffset;  

to


thePageName = myLinks.parent.documentOffset; 

just a try

PS: but did u tried

app.scriptPreferences.version = "5.0" ??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 11, 2016 Apr 11, 2016

Copy link to clipboard

Copied

I have tried to change to thePageName = myLinks.parent.documentOffset; with no luck.

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; 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Apr 11, 2016 Apr 11, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 11, 2016 Apr 11, 2016

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 12, 2016 Apr 12, 2016

Copy link to clipboard

Copied

I can give you acces to my machine with teamviewer and then you can work with CS3?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 14, 2016 Apr 14, 2016

Copy link to clipboard

Copied

No one else with some CS3 skills can help me figure this out?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 21, 2016 Apr 21, 2016

Copy link to clipboard

Copied

LATEST

I still hope someone can help me out here

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines