There's a great chance that WV hasn't loaded already when GetLayoutObjectAttribute is triggered. Set a Pause for about 3 seconds before before GetLayoutObjectAttribute
How about a GetFromURL script?
I have WV with dynamic content (search engine as a example) where I use GetLayoutObjectAttribute ( "WebViewer" ; "source") in order to get current href, which I then use for the GetFromURL script.
Thanks for the input.
However the webviewer is fully loaded
If the content of the webpage is fix, what do you get when using the InsertFromURL script task?
If the content is dynamically, that GetLayoutObjectAttribute ( ; "source") could be a work around.
I'ld also like to refer to the standard FMP Voodoo-Toolbox:
before any Get (…), setField, or other calculation tasks.
Thanks for your reply.
Sometimes the page comes up as an advertisement. This seems to be when the script will fail. Refreshing the page will bring the correct data visually. But even after refreshing the screen and allowing it to load, the HTML shows null (this is while data is clearly visible)
The point is it shows no data at all when data is there. I have inserted, refresh, commit and pause steps to no avail.
As I mention without any of those steps, if I go to layout mode then return to browse mode, rerun the script that creates the data in the WV it works. Somehow when the 1st rendering is the ad it fails. As I also mentioned even if I then go to other records run the script successfully, then return to the original record, the data shows but still it collects nothing.
It is if it has a memory that previously there was no data. Going to layout mode is the only consistent thing that seems to remove this "ghost memory"
That is a BUG in my opinion, unless there is a script step to clear that out of wherever FM is storing that history.
Don't get me wrong on this: There are some strange and inconsistent behavior when try to get html-content into FMP. Though this certainly could be a bug.
From one FMP release to another, I switched from InsertFromURL to GetLayoutObjectAttribute ("WV"; "content") and back in order to have this work.
With FMP 14, I recommend to give the InsertFromURL another try.
just some thoughts, probably not the answer:
- with Script Debugger, this script will work more reliable than without since there's plenty of time for WV AND for Var to load
- even for SetVar, I'ld try to set a commit after every single SetVar step for testing and narrow this down. *)
- another test could be to set the WV content into a field instead a Var *)
- I didn't catch this: Did you use global ($$) OR local Var? *)
You'll have a lot of work ahead to narrow this down.
*) play it save with every single step. means: use dozens of commits and refreshes, use Field values instead of Var, use a formula- OR text field with href instead of writing in with the script until you can spot the trouble maker.