Skip to main content
September 9, 2009
Question

Get linked image path

  • September 9, 2009
  • 1 reply
  • 1277 views

Hello!

I want to change a low res image to a hi res image, but I can't get the low res path.

for (var pageItemIdx = 0; pageItemIdx < myDocument.allPageItems.length; pageItemIdx++) {

  var pageItem = myDocument.allPageItems[pageItemIdx];

    if ( "geometricBounds" in pageItem && pageItem instanceof Rectangle ) {

 

      try  {

        app.consoleout( pageItem.allGraphics.itemLink.filePath );

      } catch (error) {

        app.consoleout( error.toString() );

      }

    }

}

pageItem.allGraphics.itemLink.filePath does not work....using applescript I was able to do it with

return file path of item liink of image....

But with javascript I can't

Anyone?

This topic has been closed for replies.

1 reply

Harbs.
Legend
September 9, 2009

Where did allGraphics come from?

That should be: pageItem.images[0].itemLink.filePath

But you should check that your page item really has an image, or it

will err...

Harbs

http://www.in-tools.com

Innovations in Automation

September 9, 2009

Get this error

ReferenceError: Object is invalid

trying to find out why