Set Web Viewer
Purpose 
Controls the specified web viewer.
Format 
Set Web Viewer [Object Name: ”<object name>”; Action: <action>]
Options 
Click Specify to display the Set Web Viewer Options dialog box, where you can set the following options:
  •
Object Name is the name of the web viewer to act upon. To assign an object name, select the web viewer, choose View menu > Object Info in Layout mode, and enter a name.
  •
For Action, choose one of the following:
  •
Reset resets the named web viewer to its originally specified web address. This action also clears this web viewer’s Back and Forward history.
  •
Reload reloads the web page that the web viewer is displaying.
  •
Go Forward goes forward one page, the same way a web browser does.
  •
Go Back goes back one page, the same way a web browser does.
  •
Go to URL lets you specify a new web address to load in the web viewer. The new web address is a calculation that you specify in the Set Web Viewer - Go to URL Options dialog box. In this script step, you cannot change whether the web viewer allows interaction, shows a progress bar or status messages, or displays content in Find mode. You can set these options only when you add or change a web viewer in Layout mode.
Compatibility 
This script step is supported in web publishing and in a FileMaker Server scheduled script, but the Go Forward and Go Back actions are not.
Description 
Click Specify to open the Set Web Viewer Options dialog box and specify the web viewer’s object name and the action to be performed.
Notes
  •
To specify the object name, either type the name in the Object Name box or click Specify and create a calculation.
If you choose the action Go to URL:
  •
  •
data:[<mediatype>][;base64],<data>
Where the following syntax applies:
dataurl = "data:" [ mediatype ] [ ";base64" ] "," data
mediatype = [ type "/" subtype ] *( ";" parameter )
data = *urlchar
parameter = attribute "=" value
More information about the “data URL scheme” can be found on the web.
  •
In FileMaker Pro 8.5, data URLs will work on Mac OS_X but not in Windows. In addition, FileMaker Pro supports only UTF-16 character encoding. Character data encoded using other methods will not display the target of the URL.
Examples 
The following example resets the web viewer named “Web Viewer 1” to its originally specified web address:
Set Web Viewer [Object Name: "Web Viewer 1"; Action: Reset]
The following example displays the FileMaker, Inc. homepage in the active web viewer, or displays an error message if the active object is not a web viewer:
If [GetLayoutObjectAttribute( Get (ActiveLayoutObjectName);
      "objectType") = "web viewer"]
Set Web Viewer [Object Name: Get (ActiveLayoutObjectName);
      URL: "http://www.filemaker.com"]
Else
Show Custom Dialog ["This object is not a web viewer."]
End If
The following example uses the data URL scheme to display a small icon in a web viewer named WV2:
Set Web Viewer [Object Name: "WV2"; Action: URL "data:image/gif;base64,R0lGODlhFwAMAKEAAL+/v///AAAAUwAAACH5BAEAAAAALAAAAAAXAAwAAAI7hBGHapHcXJKPumizpigI+QliSH0XIjokWJ6oB4+qt0Zmaqpjesxz7st1YD8ZEbhJajAuDgfSYTx60wIAOw=="]
Related topics 
Script steps reference (alphabetical list)
Script steps reference (category list)
Working with web viewers on layouts
Naming objects
Adding a web viewer