7 Replies Latest reply on Mar 13, 2010 1:17 PM by mjelsner

    [CS4-vb]Relinking slowness


      I have a script that I have been using (or a similiar version) for a couple years now and for some reason on some computers the time it takes to relink text files takes forever.  Let me give an example(these machines have similiar specs), one machine relinks 1200+ files in about 2-3 minutes.  The other machine takes in the neighborhood of 20 minutes.  Same code, ID is the same version.  Any ideas on what could be causing this?  The code is below.


      For myCounter = 1 To myDocument.Links.Count
                  myLink = myDocument.Links.Item(myCounter)
                  If myLink.Status = idLinkStatus.idLinkMissing Or myLink.Status = idLinkStatus.idLinkOutOfDate Then
                      FileSource = strFilePath + "\Events\" + myLink.Name
                      If System.IO.File.Exists(FileSource) = True Then
                          relink(myLink, FileSource)
                      End If
                  End If
      Public Sub relink(ByRef oItemLink As Object, ByVal sLinkPath As String)

              Dim fso As Object = CreateObject("Scripting.FileSystemObject")
              Dim oLink As Object = fso.getfile(sLinkPath)

      End Sub







        • 1. Re: [CS4-vb]Relinking slowness
          Kasyan Servetsky Level 5

          I don't if it's possible/how to do this in VB, but in JS you can use ESTK's Profile feature to find bottlenecks in scripts.

          You can download my Relinking script (similar to yours), open it in ESTK, turn  Profile > Lines and Show Timing on, and test it on different machines.



          • 2. Re: [CS4-vb]Relinking slowness
            mjelsner96 Level 1



            Thanks for the reply.  I don't believe the problem is in the code.  I have been using similiar code for about the last 4 years and have never experienced this level of slowness.  The way I used to do it was to go through text frames on a specific layer and relink the files, but this year the files changed that I am working with and they now have many text frames on master pages that need to be relinked.  So I decided to change to this method where I am just relinking every link that is in the document.  The really odd thing about the slowness as I stated in my first post is that it is not on every machine.  Some machines run it just fine.  I have had intermittent success renaming the preferences files in InDesign, so I think there is something within InDesign or it's dll's.  Do you have any thoughts on it from that perspective?



            • 3. Re: [CS4-vb]Relinking slowness
              Kasyan Servetsky Level 5

              I once had a problem with antivirus software -- Norton Antivirus -- when I run a VB script on my computer (actually I ran it from JS script through doScript method). The process looked suspicious to NA, so it paused for a while and finally asked for confirmation.



              • 4. Re: [CS4-vb]Relinking slowness
                AdobeScripts Level 3

                Like Kasyan said - this could be a problem with Antivirus software - but where are these files located ?

                On local or network drive ? If network - do both computers have network card with the same speed ?


                And you should iterate Links collection  (and many other) ALWAYS backward:


                For myCounter = myDocument.Links.Count To 1 Step -1


                This line suggests that you are working with VB.NET, right ?


                If System.IO.File.Exists(FileSource) = True Then




                • 5. Re: [CS4-vb]Relinking slowness

                  Yes I am using VB.Net.  I have no antivirus software installed on this computer.


                  Why should I iterate the links backwards?  I have done this before for other things where things will be deleted or removed, but in this case the links are only going to change, the number of links won't ever change, therefore my counter won't change.  Just curious on why I should do that.


                  The links that are being relinked are changing from local links(well they are actually missing) and being linked to a folder on a networked drive.  So yes they are over a network.  Just for kicks I setup another machine and things seem to be working very well. The machine that I have been talking about is a machine that has been running this way for quite a while and been doing the same tasks.  As far as I know the only real difference both hardware and software wise is that I updated ID so that it is at version 6.0.4.  Our business is cyclical so this machine was being run for a solid 8 hours a day up until about 6 months ago, since then it hasn't been doing anything so it hasn't been updated or anything.  Then when I went to get the machine setup for the upcoming summer, I was doing some testing and ran into these issues.  I can work around this machine not working because it essentially does automation for us and I can just setup another machine in it's place easily.  But if this problem creeps up at a user workstation, it would be a bit of a problem to be down for a day while I setup another machine.  Sorry to be long winded, but I am just trying to give you more clues.



                  • 6. Re: [CS4-vb]Relinking slowness
                    John Hawkinson Level 5

                    Is 6.0.4 the slow machine or the fast machine?

                    • 7. Re: [CS4-vb]Relinking slowness
                      mjelsner Level 1

                      Both are running that version.  I think that is the latest version.