Skip to main content
rombanks
Inspiring
April 21, 2017
Answered

Function equivalent to "Break Link" in the Edit-->Links dialog box

  • April 21, 2017
  • 1 reply
  • 694 views

Hello fellows,

I wonder if there is an API (in framescript/extendscript) for breaking a link to an imported inset file (Excel sheet, Visio, etc).

Thanks,

Roman

This topic has been closed for replies.
Correct answer frameexpert

This won't work for OLE (linked) objects. The InsetFile property for these is always an empty string. These kinds of links are not exposed to the FDK, ExtendScript, or FrameScript. As far as I know, there is no way to break this kind of link programmatically.

1 reply

4everJang
Legend
April 22, 2017

Hi Roman,

With a simple script you can find the inset to be unlinked and set its InsetFile property to an empty string. That should do the trick, I think.

Ciao

Jang

rombanks
rombanksAuthor
Inspiring
April 23, 2017

Hi Jang,

I appreciate your input! No wonder I didn't find any function related to that. Following your suggestion, I came up with the following code.

The problem is that for a reason that is unclear to me, I can't retrieve the InsetFile path using alert() and can't make it null. The alert dialog box that pops up contains no value. What am I missing?  

var doc= app.ActiveDoc; 

DisconnectGraphics(doc); 

 

function DisconnectGraphics(doc) 

          

   var graph = doc.FirstGraphicInDoc; 

       while (graph.ObjectValid()) { 

       

            if ( graph.type == Constants.FO_Inset ) { 

               alert(graph.InsetFile);

               graph.InsetFile = "";

                                                              

               } 

         graph = graph.NextGraphicInDoc;   

  } 

    

Thanks!

frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
April 23, 2017

This won't work for OLE (linked) objects. The InsetFile property for these is always an empty string. These kinds of links are not exposed to the FDK, ExtendScript, or FrameScript. As far as I know, there is no way to break this kind of link programmatically.