Forum Replies Created
-
AuthorPosts
-
Emil Barbaric
MemberI have a similar problem with unused (hidden) cross references imported from Word document.
I end up with this two scripts:
First removes unused CR all at once, and second which show position of CR and then ask you if you want to delete one or proceed to next one// —- First One —-
Array.prototype.exists = function(search){
for (var i=0; i<this.length; i++)
if (this[i] == search) return true;
return false;
}var allUsedSources = getHyperlinksUsedSources(); // ALL hyperlink sources
var allCRSources = app.activeDocument.crossReferenceSources.everyItem().getElements(); //All Cros Reference Sources
var counter = 0;// Check if Cros Reference Source is used
for (var i = allCRSources.length-1;i >= 0; i–){
if (!allUsedSources.exists(allCRSources[i])){
allCRSources[i].remove();
counter++;
}
}alert (“Deleted ” + counter + ” unused Cross reference sources”);
function getHyperlinksUsedSources(){
return app.activeDocument.hyperlinks.everyItem().source;
}// — END —
//— Second One —-
Array.prototype.exists = function(search){
for (var i=0; i<this.length; i++)
if (this[i] == search) return true;
return false;
}var allUsedSources = getHyperlinksUsedSources();
var allCRSources = app.activeDocument.crossReferenceSources.everyItem().getElements();
var counter = 0;for (var i = allCRSources.length-1;i >= 0; i–){
var myBoolean = allUsedSources.exists(allCRSources[i]);
if (!allUsedSources.exists(allCRSources[i])){
allCRSources[i].showSource();
if (confirm (“Unused Cross reference source text:”+””+allCRSources[i].sourceText.contents + “”+””+”Delete Cross reference?”)){
allCRSources[i].remove();
counter++;
};
if (!confirm (“Continue?”)){
exit();
}
}
}alert (“Deleted ” + counter + ” unused Cross reference sources”);
function getHyperlinksUsedSources(){
return app.activeDocument.hyperlinks.everyItem().source;
}// — END —
Emil Barbaric
MemberI have the very same problem. (ID CS6 on El capitan). Yesterday I trash Indesign preferences and then disable “Application Frame” under Indesign Window menu. So far so good, no more out of memory massages, missing undos and blank screens in Indesign all day. Todays workflow was pretty same as yesterday, so I hope this is solution.
-
AuthorPosts
