0 Replies Latest reply on May 17, 2008 2:22 PM by (Daniel_Rodney)

    [JS] Modification Date & Time for Linked Graphic

    Level 1
      I am trying to get the modification date and time for linked graphics in InDesign. Below is the code I am currently using. It does report the date correctly, but the time is wrong. It is exactly one hour later than the actual modification time. I am in New York and it's saying the time is for GTM -4. That's wrong because NY is GMT -5. That would seem to be where the problem is. How do I get it to report the right time? I've tried using myLink.date.toLocaleString() and that just removed the GMT info but still reports the wrong time. This is happening in both CS2 and CS3, although CS3 is where I need it to work.

      var myDocument = app.documents.item(0);
      var myGraphics = myDocument.allGraphics;

      for( i = 0; i < myGraphics.length; i++) {

      var myGraphic = myGraphics[i];

      var myLink = myGraphic.itemLink;

      alert( "Name: " + myLink.name + "\nDate: " + myLink.date );

      }

      Also, is there an "easy" way to get it to report AM/PM instead of a 24 hour time, or just I just need to manually build the time string?

      Thanks in advance for any help,
      Dan