Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Downloading data from a website

Featured Replies

Sorry, I wasn't sure were this question would go. My question is, is it possible to download data from a general website and input the data into FileMaker? Is there a script that will do this or a utility?

Take a look here:

http://jesse.cnsplug-ins.com/index.htm?category=AppleScript

But beware that a lot of switches could be needed to cope with sites out of the ordinary html.

http://curl.haxx.se/docs/httpscripting.html

--sd

  • Author

Thanks Soren. Now, do you know a way of taking text that is imported into a container, searching for keywords in the text, finding the text associated with those keywords and then copying and pasting in separate text fields? I hope this isn't too hard to do. It would make my life much easier.

Thanks

Why do you import to a containerfield ...should be text!

--sd

A couple of ways of doing this. Look at the Patterncount and Position functions.

Indeed provided the recieveing field is text, but an alternative could be piping further through a combination of sed and grep under shell scripting, would make the hit on storage less ...but also tougher to figure out.

--sd

  • Author

It seems though that Curl doesn't do everything. I've tried it on a few websites and comparing what Curl brings back to what is shown when you View Source in your internet browser. It seems Curl doesn't show all the html. Any other ideas on how to download a sites html into a text field in filemaker.

  • Author

My next step was to try to use Applescript in FileMaker to control safari to copy the source html of the front most page. Here is the code I used.

tell application "Safari"

activate

set frontmost to true

set theURL to URL of front document

set theTitle to name of front window

set theSource to source of front document

set the clipboard to theSource as Unicode text

end tell

The problem now is, Filemaker doesn't seem to see that there is text in the clipboard. I can paste it into TextEdit but not into FileMaker. Although the weird thing is, after pasting it into TextEdit I can select all and then copy that and FileMaker then sees text in the clipboard. I'm stumped.

If you just want the text, you don't need to use the clipboard.

tell application "Safari"

set theName to name of document 1

set theURL to URL of document 1

set theText to text of document 1

end tell

You can then set theText (and others) into Filemaker fields (global for theText likely), then take it apart, ie.:

tell application "FileMaker Pro Advanced" -- line not needed in a Perform Applescript step

set cell "_gText" of current record to theText

end tell -- ditto

  • Author

Fenton your a genius. All I had to do is make one simple change to your script and it works perfectly. This is what I did.

tell application "Safari"

set theName to name of document 1

set theURL to URL of document 1

set theText to source of document 1

end tell

tell application "FileMaker Pro Advanced"

Perform Applescript step

set cell "Web content" of current record to theText

end tell

By changing the word text to source it now gives me the html code that I needed. This works better than what I was originally thinking. Thanks again.

  • Author

Now that I have the html in a text field I need to sort through it. What would be the best way of doing this?

For example:

In the following html I need to find the tag "Name:" first because that will always be there. Then I need to input the associated information "Jeremy Big" into a another text field.

Name: Jeremy Big

My questions are: What script would I need in FileMaker to find the Name: in the text field. Then how would I select "Jeremy Big" and copy and paste it into another text field named "Name". The reason I need to do a find first of Name: is that the associated data "Jeremy Big" will change.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.