how to: filemaker->applescript->curl->applescript->filemaker
how to: filemaker->applescript->curl->applescript->filemaker
- Subject: how to: filemaker->applescript->curl->applescript->filemaker
- From: "Daniel A. Shockley" <email@hidden>
- Date: Fri, 18 Jul 2003 13:06:02 -0400
To call curl from FileMaker is not too difficult - the question is
whether you want the raw data back, or would want to parse it first.
So, if you had the fields in FileMaker (each is Text):
searchBaseURL
searchTermLabel
searchTermValue
WebResult
You'd do the following:
In FileMaker's ScriptMaker, make a new script.
Choose the Perform AppleScript command (near the end of the list)
in it, use the following:
set searchBaseURL to cell "searchBaseURL" of current record
set searchTermLabel to cell "searchTermLabel" of current record
set searchTermValue to cell "searchTermValue" of current record
set searchFullURL to searchBaseURL & searchTermLabel & "=" & searchTermValue
do shell script "curl '" & searchFullURL & "' | vis"
-- piped through vis to strip out any characters that make do shell script fail
set cell "WebResult" of current record to result
Try this as a sample (searches the Internet Movie Database):
searchBaseURL:
http://us.imdb.com/find?
searchTermLabel: q
searchTermValue: Stargate
Now, if you want to include spaces and other such characters in your
searchTermValue, you'll need to replace those with or + or
whatever the server you're hitting requires. This also gets you raw
HTML in response, so you may want to run it through some process.
Also note the comment about the curl line - some pages respond with
characters that do shell script chokes on, so I pipe the result
through vis, which changes them to escaped codes. Strangely enough,
if you save curl's output to a file, AppleScript has no problems
reading those characters from a file - it's just a do shell script
problem/bug.
Hope the helps, late response though it may be.
----
Daniel A. Shockley, Database Programmer
MacEasy Computing
email@hidden
email@hidden
email@hidden
http://www.maceasycomputing.com
On 6/16/03, drcaggiano <email@hidden> wrote:
I may need to use curl to submit a credit card processing info from
filemaker. I haven't been able to get troi URL plug in to work right.
The only way I can see to do it without writing text files and reading
them ( which seesm ugly)
Any syntax/ suggestions?
1) call an applescript from filemaker passing the applescript field1,
field2 etc
2) call curl with parameters field1, field2 from the applescript
3) receive the curl results back to applescript into returnvarstring (
seems like the hard part)
4) insert the returnvarstring from applescript back to filemaker
Thanks
=============================
--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.