Skip to main content
Inspiring
August 23, 2020
Answered

how to delete placed file from indesign document

  • August 23, 2020
  • 5 replies
  • 2489 views

I have a 200+ page indesign document and inported multiple AI fileusing PLACE command. Now I want to use same indesign document to place differant AI files. My new AI files have differant no of artboards than the previouse AI files I used, so i can not use Relink option.

So how can i delete/unlink my previously Placed files that i don't have content of those files in Indesign file. 

This topic has been closed for replies.
Correct answer Manan Joshi

Ok, now I understand the problem. I don't think there is anything inbuilt to achieve this. I quickly put up a script that can help you. See the following, just change the values of the linkName array to the name of the links that you want to delete and it should get it done, The link name can be seen in the links panel, it is generally the file name

var linkName = ["download1.jpeg", "app1496256.pdf"]
for(var i =0; i < linkName.length; i++)
{
	var ln = app.documents[0].links.itemByName(linkName[i])
	while(ln.isValid == true)
	{
		ln.parent.parent.remove()
		ln = app.documents[0].links.itemByName(linkName[i])
	}
}

-Manan

5 replies

michal-44680644
Participating Frequently
November 14, 2022

I had the same problem. I used 

myPDFPage.parent.remove();

and now it works

Community Expert
August 26, 2020

Compare the permissions of the file you created and the one's that work? If it still does not work then upload the file on Dropbox and share the link here, i will see if it runs on my MAC or not?

-Manan

-Manan
HaahoouAuthor
Inspiring
August 26, 2020

ok thank you for the script it works. it just gived=s this messgae at end 

 

just want to understand why  i am geting this error and how to stop this. It could be because of my file because i have a linked file that is behaving strangely. I will post question about it.  

 

Community Expert
August 25, 2020

Which editor did you use to create this jsx file?

 

-Manan

-Manan
HaahoouAuthor
Inspiring
August 26, 2020

i am using mac(OS Catalina) and used texteditor and made sure that its plain text not rich text. 

Manan JoshiCommunity ExpertCorrect answer
Community Expert
August 24, 2020

Ok, now I understand the problem. I don't think there is anything inbuilt to achieve this. I quickly put up a script that can help you. See the following, just change the values of the linkName array to the name of the links that you want to delete and it should get it done, The link name can be seen in the links panel, it is generally the file name

var linkName = ["download1.jpeg", "app1496256.pdf"]
for(var i =0; i < linkName.length; i++)
{
	var ln = app.documents[0].links.itemByName(linkName[i])
	while(ln.isValid == true)
	{
		ln.parent.parent.remove()
		ln = app.documents[0].links.itemByName(linkName[i])
	}
}

-Manan

-Manan
HaahoouAuthor
Inspiring
August 25, 2020

Hi I save this code as ",jsx" file. but in script panel it is greyed out and i can see a "i" symbol next to it. when I bring mouse over on the it in the script panel it says 
"This file is not executable by any supported language". 

Robert at ID-Tasker
Legend
November 14, 2022

".jsx" - "." not ","

 

Community Expert
August 23, 2020

Are you not able to select the object showing the content of AI file on the INDD document? If yes just select and click delete to remove the object and the link from your document. You can select using the layer panel as well, and also use the links panel, just right click the link and select Go To Link, then hit delete button to delete the object

-Manan

-Manan
HaahoouAuthor
Inspiring
August 24, 2020

Well reason for asking the question was i do not want to delete one by one.
All the methods u r describing are basically delete one by one from 200 + pages.
So i thought may there is a way that one can do it say with  click of a button