Article View: adobe.scripting.indesign
Article #9372Re: [JS, VBS CS2] Unlink all Incopy Stories, Delete All Assignments via script?
From: Michael_Fontecchio
Date: Tue, 22 Aug 2006 16:15
Date: Tue, 22 Aug 2006 16:15
22 lines
1616 bytes
1616 bytes
Thanks Karthik,
Ok. The script I have is below. If there is an unassigned story,(not part of an assignment), it will delete the story, but I get the following error. Is there a way to have it ignore if stories are not assigned? Also, could it delete multiple assignments? Right now it only does one at a time and then I have to run the script again. Thanks, Mike
Error Number: 48645
Erro String: The Unassigned InCopy Content cannot be deleted.
Line: 14
Set myind = CreateObject("InDesign.Application.CS2")
Set mydoc = myind.ActiveDocument
For Each mylink In mydoc.Links
If mylink.LinkType = "InCopyInterchange" Then
mypath = mylink.FilePath
myfilename = mylink.Name
mylen = Len(mypath) - Len(myfilename)
myincname = Mid(mypath, 1, mylen)
myincname = myincname & "*.incx"
mylink.Unlink
End If
Next
Set myinc = mydoc.Assignments(1)
myinc.Delete
Technical Details
Message-ID:
<3bc09db8.3@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossingReferences:
<3bc09db8.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,51db34675c26cde1 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Michael_Fontecchio@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: Re: [JS, VBS CS2] Unlink all Incopy Stories, Delete All Assignments via script? Message-ID: <3bc09db8.3@webcrossing.la2eafNXanI> Date: Tue, 22 Aug 2006 09:15:00 -0700 References: <3bc09db8.-1@webcrossing.la2eafNXanI> Lines: 26 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.stben.net!webcrossing