2 Replies Latest reply on Feb 11, 2015 10:42 AM by jcooper

    Web Viewer Script Triggers

    jcooper

      Title

      Web Viewer Script Triggers

      Post

      Hi,

      I'm trying to get a script to fire when the url of a webviewer object changes. I see it has "onobjectmodify" as a possible trigger, but it doesn't seem to do anything. onobjectenter and ..exit work ok, but the rest seem to be ignored.  What am I missing?  This is in FMP12.

      Thanks,

      Jeff

        • 1. Re: Web Viewer Script Triggers
          schamblee

          The OnObjectModify script trigger fires when the object is active, has focus and then the field is modifed.  Do you are a field that the url is keyed into?  I would suggest using the script trigger on this url field.   The webview can not have focus if a url is being enter in another field.

          • 2. Re: Web Viewer Script Triggers
            jcooper

            Except for the initial page, I don't set it programmatically. The initial page is loaded and the user navigates pages within the viewer. I was hoping when the url changed by clicking a link within the viewer it would trigger a modify event.  It seems to ignore all events save for entering and exiting the web viewer.

            Found a workaround though since it looks like the web viewer runs in a separate process from FMP.  On enter, I  install an ontimer script that runs every half second and gets the current url, along with subscripts to perform actions based on that url.  on exit, I turn off the timer. At the end of the script I save the url in a global variable so when it next runs it can compare to the current url and exit immediately if it's the same.

            Thanks,

            Jeff