You need three tools and a little of effort: AppleScript installed ( :lol: ), URL Access Scripting & Filemaker.
Also, you can substitute URL Access Scripting for a web browser, but theorically you don’t need it. Step 1. “Download” the web page with results from a search query. Look at URL Access Scripting dictionary. You should see a command called “download” with several parameters. You can download an URL such as “http://www.google.com/search?hl=en&ie=ISO-8859-1&q=apple”, which will give you a HTML page with the results of searching “apple” at Google. Step 2. “Read” this web page. You can find some useful commands within “Standard Additions”’ terminology: open for access, read, close access. Step 3. Extract the info you’re looking for from this text and enclose it into variables, for later use. Step 4. Put this info within your FM db (this is easy; look at FM’s dictionary).
If you need some detailed info about any particular question, this is your site!
AppleScript defines several properties & command to work with strings. You can extract from a given text its “word 1” or its “character 6”, or a bunch of text “characters 1 thru 8”.
Also, you can determine the position of a given string into a long text offset of “text” in “Hello, text!” (which will return “8”… character 8 is “t”).
So, if we call “html_code” to the text you’ve posted:
set x to (offset of "Maturity date(*)</strong></td>
<td class='secdb'>" in html_code) + 50
set y to (offset of " </td>
<tr height="3">" in html_code) - 1
set maturity_date to text from character x of html_code to character y of html_code
--> "16 May 2010"
I sum 50 to x because I don’t want include that string into my calculation. 50 is the length of “Maturity date(*)</str…”.
And I rest 1 to y because I don’t want include “&” into the string…
Now, set the value of a FM’s field may be easy:
tell application "FileMaker Pro"
set cell "maturity" of record 54 of database 1 to maturity_date
I think I follow your idea, I try the script
and I’m sure I made small mistake it says
the variable html_code is not defined.
How can I tell the script to find the string in a
specific html file in a specific folder ??