Copy link to clipboard
Copied
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 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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi Rick,
Thank you for your response!
I was afraid that Adobe didn't cover the OLE2 use case...
I'll check if this can be done with AutoIt.
Best Wishes,
Roman