tags:

views:

678

answers:

5

Im trying to get the contents of a webpage put into a field in Filemaker pro 10. Does anybody know the code to do this in the scripmaker?

I have a field called URL that has the url I want and a filed called content, this is where the source html will go once FMP has grabbed the web page.

Thanks for reading.

+1  A: 

But you can get a plugin like ScriptMaker from 360Works, which, among other things, lets you do this:

Get URL as Text: Retrieves the contents of a URL (url) as a text field.

DisplacedAussie
+4  A: 

Filemaker 10 is perfectly capable of exporting the web viewer contents for you.

Use the Object Viewer in layout mode to name your web viewer (I am using "YourWebViewerName" here) then you can snag the content of your webviewer using:

GetLayoutObjectAttribute("YourWebViewerObjectName";"Content")

Your scriptmaker step would look like:

Set Field [tablename::Content; GetLayoutObjectAttribute ("YourWebViewerObjectName"; "Content")]

Bob Minteer
Indeed. The murky depths of FileMaker's layout functions!
DisplacedAussie
Note: You'll want to pause your script until the web viewer is finished loading, and this doesn't work with binary data.
Sam Barnum
A: 

The only problem I encountered while using this method is that it requires Pause/Resume script step before Set Field. Unless you pause the script for couple seconds the Content is empty.

Unfortunately, Pause/Resume is not compatible with Server Scheduled script. Any idea how import a web page content in a server scheduled script?

A: 

Or...

You can of course loop until a time Start + x is up...

However delaying a "second or 2" for the wv to load is a gamble anyway... you don't know how long it will take on any given day or moment for the page to load.

So I would be inclined to wrap the Get Content step as described above in a loop with an exit test that looks to see that the entire HTML has been loaded (e.g. content retrieved should contain "")... plus a time out check so that if it hasn't arrived within say 10 or 20 seconds you bail out and report some kind of error.

DFCraig
A: 

please visit http://fmoverflow.stackexchange.com for a site dedicated exclusively to filemaker

Joe