Skip to main content
dublove
Legend
June 23, 2025
Answered

The target of update() is supposed to be the image object... Dang, I wonder who's my target?

  • June 23, 2025
  • 1 reply
  • 175 views

One minute it says it's not preceded by an object, the next it says it's not a function.
Sometimes I really don't know what I'm getting, mostly guessing ......

 

    function reLink() {
        link.reinitLink(encodeURI(lst[ppJ]));
        link.update();
        app.activeDocument.links.everyItem().update();
    }

 

I have defined the Link, who is the subject of my update()?

var link = selectedFrame.images[0].itemLink;

 

Correct answer m1b

Hi @dublove the subject of update is the Link object. So...

var link = selectedFrame.images[0].itemLink;

if (LinkStatus.LINK_OUT_OF_DATE === link.status)
    link.update();

1 reply

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
June 23, 2025

Hi @dublove the subject of update is the Link object. So...

var link = selectedFrame.images[0].itemLink;

if (LinkStatus.LINK_OUT_OF_DATE === link.status)
    link.update();
dublove
dubloveAuthor
Legend
June 23, 2025

Victory.

Hi m1b.
Thankfully, this is it.