• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to check if assignment is in use?

Community Beginner ,
Feb 17, 2013 Feb 17, 2013

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

TOPICS
Scripting

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Feb 22, 2013 Feb 22, 2013

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

Votes

Translate

Translate
New Here ,
Feb 22, 2013 Feb 22, 2013

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.

incopy_link.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 22, 2013 Feb 22, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

Oh, sorry.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2013 Feb 22, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

Sorry, I see you already mentioned that property does not work

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 22, 2013 Feb 22, 2013

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 23, 2013 Feb 23, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 24, 2013 Feb 24, 2013

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines