February 6, 200619 yr 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?
February 6, 200619 yr 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
February 8, 200619 yr 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
February 8, 200619 yr A couple of ways of doing this. Look at the Patterncount and Position functions.
February 8, 200619 yr 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
February 10, 200619 yr 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.
February 10, 200619 yr 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.
February 10, 200619 yr 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
February 10, 200619 yr 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.
February 10, 200619 yr 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