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.

tin tin
  • 71
  • 2
  • 4
  • I just experienced a vietnam-war-sized flashback. I think I have to go home early, turn off all the lights and curl up in a fetal ball. –  Sep 23 '10 at 17:38

5 Answers5

7

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
  • 149
  • 3
2

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,578
  • 1
  • 27
  • 21
1

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 the string "</html>")... 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.

Erics
  • 803
  • 9
  • 23
DFCraig
  • 91
  • 1
0

I realize this is an old thread - but there is another, rather klunky but useful, way to do this as a one-liner... getting the escaping and paragraph markers etc right is finniky, but, worth it in some cases..

Perform AppleScript["set cmd to \"curl 'http://wherever.com/whichever.php?randomparameter=" & Database::Field & "'\"" & ¶ & "set someVariable to do shell script cmd" & ¶ & "set cell \"someField\" of current record to someVariable"]
Amos
  • 161
  • 1
  • 8
-1

You can eighter do it via a button that launches a script or you can just add a button in layout mode and then select use url and add the url between the "" marks to launch it.