Re: General question about what is possible re: AS driving JavaScript
Re: General question about what is possible re: AS driving JavaScript
- Subject: Re: General question about what is possible re: AS driving JavaScript
- From: Malcolm Fitzgerald <email@hidden>
- Date: Wed, 13 Jul 2005 11:18:33 +1000
On 7/12/05 4:08 PM, "Gary (Lists)" <email@hidden> wrote:
If you wish to view the source HTML of a form, then in most browsers
you can
position your pointer near to the place you are interested in and then
right-click to 'View Frame Source' (not page source.)
On 13/07/2005, at 8:10 AM, Bill Planey wrote:
Thanks! That revealed a bunch of stuff. Now the task is to figure out
whether:
1) I can actually set data from database sources to these fields and
2) submit the data for a result.
You're trying to replicate the job a human has to do as if your
computer were a human too, that may not be necessary.
Try using an URL: look through the HTML code for the <form> tag, e.g.,
<FORM ENCTYPE="multipart/form-data"
ACTION="/cgi-bin/info.cgi/ChangeAddress" METHOD=POST>.
You want the action element.
/cgi-bin/info.cgi/ChangeAddress
In this example the action element doesn't have a domain name included,
some do. You need the domain name and the protocol. Most web
transactions use HTTP but your real estate form may be on a secure
server and use HTTPS.
http://www.domain.com
or
https://www.domain.com
Next you need a list of the field names. They'll all be in the HTML
code. You'll use them to build key/values in this format,
fieldName=value.
location=Redfern
state=NSW
String the key/values together with an ampersand (&), e.g.
location=Redfern&state=NSW
To build the URL you concatenate (1) the domain name and (2) the action
and (3) the field key/value pairs
http://www.domain.com/cgi-bin/info.cgi/ChangedAddress?
street=33+Lilly+st&location=Redfern&state=NSW&postcode=2012
This example URL is the equivalent of a web form with four fields:
street, location, state and postcode. However, it's a URL, so you can
paste it into the browser location bar and go to it. It's the same as
filling out the form and pressing the submit button.
Paste the URL that you build into the location bar and see if it works.
Here's the applescript
property theProtocol: "http://"
property theDomain: "www.re.com"
property theAction: "/cgi-bin/info.cgi/ChangeAddress"
tell application "Filemaker Pro"
tell layout "re web form"
set theFieldNames to name of every field
set theFieldValues to record 1
end tell
end tell
set s to {}
repeat with i from 1 to length of theFieldNames
set end of s to item i of theFieldnames
set end of s to item i of theFieldValues
end
set my text item delimiters to "&"
set theURL to theProtocol & theDomain & (s as string)
open location theURL
Malcolm Fitzgerald ph: 02 93180877
Database Manager fax: 02 93180530
The Australian Society of Authors www.asauthors.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden