Copy link to clipboard
Copied
Hi,
before exporting a document to pdf I'm running few checks on links (if out of date or missing etc...). But I realized that you can have inaccessible assignment which is a little bit harder to find. Can anybody help me with this one... is there a way to check if the assignment is "in use" beside checking if lock file of assignment file exists?
The thing is that in some kind of workflow you could export document to pdf without knowing that someone else is still holding a piece of text in InCopy. Browsing through links is not helpfull with this situation.
TNX!
Regards,
Marko
Hi,
isn't it just the storyproperty lockState?
var currStories = app.activeDocument.stories.everyItem().getElements();
l= currStories.length;
while(l--){
cS = currStories
; lS = cS.lockState;
if(lS == LockStateValues.LOCKED_STORY){
cS.textContainers[0].select()
alert('Locked Story')
}
}
the other way round: assignments -> assignedStories -> storyReference -> check if story -> check lockState
Copy link to clipboard
Copied
There is an "Assignments" palette in InDesign that will help you with this. You can find it under Window > Editorial > Assignments. That should show you all InCopy links, and if there's a pencil icon with a red line through it, that means someone is currently working on the that piece.
Copy link to clipboard
Copied
Of course... and you can see who is working in that document if you place a mouse over it and wait a little bit.
Tnx Moucri for your reply, but I'm searching for a scripting solution (this forum is about InDesign scripting).
Something like ReadOnly Property AssignmentFileStatus in VB.Net but this property will not return if the file is in use, only if needed update or if missing.
Regards,
Marko
Copy link to clipboard
Copied
Oh, sorry.
Copy link to clipboard
Copied
I don't work with InCopy and Assignments, so I don't know what an "inaccessible assignment" is, but you could do some tests on the properties of an Assignment: http://jongware.mit.edu/idcs6js/pc_Assignment.html. Would "assignmentFileStatus" be the one you are looking for?
You loop through your assignments using the property app.activeDocument.assignments
Copy link to clipboard
Copied
Sorry, I see you already mentioned that property does not work
Copy link to clipboard
Copied
Hi,
isn't it just the storyproperty lockState?
var currStories = app.activeDocument.stories.everyItem().getElements();
l= currStories.length;
while(l--){
cS = currStories
; lS = cS.lockState;
if(lS == LockStateValues.LOCKED_STORY){
cS.textContainers[0].select()
alert('Locked Story')
}
}
the other way round: assignments -> assignedStories -> storyReference -> check if story -> check lockState
Copy link to clipboard
Copied
Hi,
The alert from Hans is probably what you are looking for.
We have a script that lists assignments and the status.
http://www.kerntiff.co.uk/products-4-indesign/assignmentnavigator
P.
Copy link to clipboard
Copied
TNX!
This one works fine. Here is VB version also:
'Check for Locked Stories For storyCount As Integer = 1 To myApplication.ActiveDocument.Stories.Count Dim myStory As InDesign.Story = myApplication.ActiveDocument.Stories.Item(storyCount) If myStory.LockState = idLockStateValues.idLockedStory Then Dim myStoryContent As String = myStory.Texts.Item(1).Contents.ToString MsgBox("Locked Story: " + vbNewLine + vbNewLine + myStoryContent.Substring(0, 100) + vbNewLine + vbNewLine + "Exiting...") Exit Sub End If Next
Thanks once again!
Kind regards,
Marko