Skip to main content
Known Participant
August 9, 2011
Answered

indesign export text as rtf with links

  • August 9, 2011
  • 2 replies
  • 981 views

Hi,

I have an indesign file with lot of math type equation are EPS as in links.

Now I want extract the indesign file as rtf format. I know math type is not directly support the indesign. So I want to get the links name and delete the links from the indesign document. My script is getting the link name. I don’t know how to delete the links and place the link name the relevant position.

my script is:

for(var myLinkCounter = app.activeDocument.links.length -1 ; myLinkCounter > 0; myLinkCounter --)
{
    myLink = app.activeDocument.links.item(myLinkCounter);
            myLinkName=myLink.name;
            //alert(myLinkName);
           
                if (myLinkName.indexOf("Eqn"))

                {

                   
                }

}

Please help me for further............

Thanks

M. Karthikeyan

This topic has been closed for replies.
Correct answer csm_phil

Hi Karthik,

Please try the below JS code, i hope you expected this!

var myDoc = app.activeDocument;
var myLink = myDoc.links;
for (i=myLink.length-1; i>=0; i--){     
     var myLinkitem = myLink;
     var myname = myLink.name;
     app.select(myLinkitem.parent);
     var mySel = app.selection[0];
     app.select(mySel.parent);
     mySel.remove();
     app.selection[0].contentType = ContentType.TEXT_TYPE;
     app.selection[0].contents = myname;
     //app.selection[0].fit(FitOptions.FRAME_TO_CONTENT);
     }

thx

csm_phil

2 replies

csm_phil
csm_philCorrect answer
Legend
August 9, 2011

Hi Karthik,

Please try the below JS code, i hope you expected this!

var myDoc = app.activeDocument;
var myLink = myDoc.links;
for (i=myLink.length-1; i>=0; i--){     
     var myLinkitem = myLink;
     var myname = myLink.name;
     app.select(myLinkitem.parent);
     var mySel = app.selection[0];
     app.select(mySel.parent);
     mySel.remove();
     app.selection[0].contentType = ContentType.TEXT_TYPE;
     app.selection[0].contents = myname;
     //app.selection[0].fit(FitOptions.FRAME_TO_CONTENT);
     }

thx

csm_phil

M KarthikAuthor
Known Participant
August 10, 2011

Thanks so much........... It's very very usefullllllllllll..............

Peter Spier
Community Expert
Community Expert
August 9, 2011

I've moved this into the scripting forum where you'll get help faster.