Prepare to get $PAID$ if you have a solution!

I need a solution to push data directly into a text field of a webpage using applescript.

Here is the line of html code that displays the text field in question:

I have a variable in my applescript called JobName.

I would like to set the contents of the text field in the above html code to this variable.

Does this action require Java within my Applescript code?

something like:
tell application “safari”
do JavaScript “set contents of text field “strClientJobName” to JobName” in document 1
end tell

If you have a solution and have a Paypal account I have $30 for you!

Any info would be greatly appreciated,
AppleScriptJunkie

There are several threads regarding this issue. Eg:

http://bbs.applescript.net/viewtopic.php?id=12703

And, if you search for “do AND javascript AND elements AND forms”, you will find some more ones.

jj,

You are awsome! Thanks for your help! It worked!

I have one more question: I can get most of the data to input and post with the submit for most of my forms.
One form however, I am having problems posting the data. The data flows into the text fields but doesn’t post the data (data flashes into the text fields and when page refreshes the data is gone).

Html Code (SIMPLIFIED):

Applescript code:


set PONumber to "001"
set ItemDescription to "Cards"
set Price to "$5.00"

set FormPush to "document.forms['frmData'].elements['Quote0_strNumber'].value ='" & PONumber & "';document.forms['frmData'].elements['Quote0_strDescription'].value ='" & ItemDescription & "';document.forms['frmData'].elements['Quote0_curAmount'].value ='" & Price & "';document.forms['frmData'].SubmitPage('SavePrint');"

tell application "Safari" to do JavaScript FormPush in document 1

I suspect that it is this part of the code that is not working:
document.forms[‘frmData’].SubmitPage(‘SavePrint’);

Any ideas?

Thanks again,
AppleScriptJunkie
BTW, do you have a Paypal account? I will send you the donation!

Yes. Apparently, you should call the “SubmitPage” function (but not attached to the form object). So try simply using “SubmitPage(‘SavePrint’);”.

jj,

That worked! You are awesome! Thanks for your help!

AppleScriptJunkie