Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How do i run a script after WebViewer finished loading?


This topic is 4566 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hello,

i want to start a script after the webviewer has finished loading, because i have to read out some summarys from the Webviewer.

Is there any way to trigger a script after loading completed?

Thank you!

Posted

This is the script that I came up with in my solution:


##

# Load URL Script

#

Set Error Capture [ On ]

Set Variable [ $webviewer; Value:"webviewer" ]

Set Variable [ $url; Value:"http://www.fmforums.com/" ]

Set Variable [ $lastTag; Value:"</html>" ]

Set Variable [ $timeout; Value:30 ]

##

# Load the URL

#

Set Web Viewer [ Object Name: $webviewer; URL: $url ]

If [ Get(LastError) ]

# Error: Either the webviewer is missing or did not load properly

Exit Script [ Result: False ]

End If

##

# Wait for the URL to load

#

Loop

Pause/Resume Script [ Duration (seconds): 1 ]

If [ GetLayoutObjectAttribute ( $webviewer ; "content" ) <> "<HTML></HTML>" ]

Exit Loop If [ PatternCount ( GetLayoutObjectAttribute ( $webviewer ; "content" ) ; $lastTag ) ]

End If

Set Variable [ $timer; Value:$timer + 1 ]

If [ $timer = $timeout ]

# Error: Url did not load in time

Exit Script [ Result: False ]

End If

End Loop

Note: The "<>" symbol should be a "Not Equals" symbol.

I hope that helps!

Posted

Is there any way to trigger a script after loading completed?

No, but you can put a script in a looped pause and exit the loop when the page has loaded. Usually, you can tell a page has loaded when the web viewer's content contains the string "</html>", but it really depends on the specific page.

This topic is 4566 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.