3 Replies Latest reply on Jul 18, 2008 10:58 PM by (elwissan)

    [CS3 VBS/JS] Information of the linked images

      Hi,

      I only get to obtain the name of the file, filepath, LinkType.
      I need to know which the space of color of the links in the document.

      Example:
      Msgbox = Mydocument.Links(3).Name &" = " & Mydocument.Links(3).SpaceColor (of course of that way is wrong)
      Msgbox " Test.psd = cmyk "

      I don't know as accessing the Link information.

      Please help me.
      Thanks
        • 1. Re: [CS3 VBS/JS] Information of the linked images
          Level 1
          I need to convert all the files RGB for CMYK. For that also use Photoshop. But files already exist in CMYK, then it is not necessary to open in Photoshop.
          The problem is that I don't get to know the file it is in CMYK before opening in Photoshop.

          Script is almost ready, only remaining that detail.
          Here it is the script that I am doing:

          > Set OID = CreateObject
          ("InDesign.Application.CS3")
          Set OPS = CreateObject("Photoshop.Application")
          Extens = Array("psd","tif","jpg")
          With oID.ActiveDocument.Links
          For i = 1 To .Count
          EBitmap = False
          For Each Exten In Extens
          If Exten = Right(.Item(i), 3) Then
          EBitmap = True
          Exit For
          End If
          Next
          If EBitmap = True Then
          If .Item(i).Status = 1852797549 Or .Item(i).Status = 1819242340 Then
          ''If Space <> CMYK then '(It is here that begins the condition)
          OPS.Open .Item(i).FilePath
          With OPS.ActiveDocument
          .ChangeMode 3
          .Close (1)
          End With
          ''End if '(End of the condition)
          End If
          End If
          Next
          J = .Count
          For i = 0 To J - 1
          If .Item(J - i).Status = 1819242340 Then .Item(J - i).Update
          Next
          End With

          Please, I need help.

          Thanks
          Elvis
          • 2. Re: [CS3 VBS/JS] Information of the linked images
            Level 1
            look at this screen (old version of my tool PhotoManager ;) ) - next to last column (and green group header) show text values of:

            Property Space As String
            read-only
            Member of InDesign.Image
            The color space

            and don't use For Each ... In - it's limited to only 255 iterations

            robin

            --
            www.adobescripts.com
            • 3. Re: [CS3 VBS/JS] Information of the linked images
              Level 1
              Hi, Robert_Tkaczyk
              I re-did almost everything.

              > Set
              OID = CreateObject("InDesign.Application.CS3")
              Set OPS = CreateObject("Photoshop.Application")
              Extens = Array("psd","eps","tif","jpg")
              With oID.ActiveDocument
              For i = 1 To .AllGraphics.Count
              EBitmap = False
              For Each Exten In Extens
              If Exten = Right(.AllGraphics.Item(i).ItemLink, 3) Then
              EBitmap = True
              Exit For
              End If
              Next
              If EBitmap = True Then
              Set imgSpace = .AllGraphics(i)
              MyStatus = imgSpace.ItemLink.Status
              If imgSpace.Space <> "CMYK" And MyStatus = 1852797549 Or MyStatus = 1819242340 Then
              With OPS
              .Open imgSpace.ItemLink.FilePath
              With .ActiveDocument
              .ChangeMode 3
              .Close (1)
              End With
              End With
              End If
              imgSpace.ItemLink.Update
              End If
              Next
              End With

              about
              b For Each ... In
              .
              I saw some examples of script of own InDesign, but the one that I found do in the same way.
              Do you have a suggestion? Please show me an example.
              Thank you!