-
-
2. Re: How to check if assignment is in use?
mmargeta Feb 22, 2013 12:34 PM (in response to moucri)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
-
3. Re: How to check if assignment is in use?
moucri Feb 22, 2013 12:40 PM (in response to mmargeta)Oh, sorry.
-
4. Re: How to check if assignment is in use?
[Jongware] Feb 22, 2013 3:50 PM (in response to mmargeta)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
-
5. Re: How to check if assignment is in use?
[Jongware] Feb 22, 2013 3:52 PM (in response to [Jongware])Sorry, I see you already mentioned that property does not work
-
6. Re: How to check if assignment is in use?
-hans- Feb 22, 2013 11:19 PM (in response to [Jongware])Hi,
isn't it just the storyproperty lockState?
var currStories = app.activeDocument.stories.everyItem().getElements(); l= currStories.length; while(l--){ cS = currStories[l] ; 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
-
7. Re: How to check if assignment is in use?
Pickory Feb 23, 2013 2:23 AM (in response to -hans-)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.
-
8. Re: How to check if assignment is in use?
mmargeta Feb 24, 2013 3:09 PM (in response to -hans-)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 NextThanks once again!
Kind regards,
Marko




