• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Passing variable from javascript to applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing variable from javascript to applescript


  • Subject: Passing variable from javascript to applescript
  • From: Chris Swain <email@hidden>
  • Date: Tue, 25 Apr 2006 20:34:19 +0100

Hi,

I have a simple web page (see html at the bottom of the email) it contains an applet that is used to generate a test string. (Its actually a text representation of a chemical structure called a SMILES string).

What I want is to pass the SMILES to an applescript.

I tried this script to no avail.

All help welcome,

Thanks

Chris


tell application "Safari"
activate


set the_SMILES to do _javascript_ "
var drawing = document.JME.smiles();
  document.form.smi.value = drawing;
  return drawing;"


display dialog the_SMILES


end tell

HTML for page

<HTML>
<HEAD>
<TITLE>JME Example 1</TITLE>

<SCRIPT LANGUAGE="_javascript_">

function getSmiles() {
  var drawing = document.JME.smiles();
  document.form.smi.value = drawing;
}


</SCRIPT>

</HEAD>
<BODY  BGCOLOR="#FFFFFF">

<center>

<H2>Test SMILES</H2>

<applet code="JME.class" name="JME" archive="JME.jar" width=360 height=315>
You have to enable Java and JavaScritpt on your machine !
</applet>

<FORM METHOD="POST" NAME="form" >
<p>
<b>smiles</b><BR>
<INPUT TYPE="text" NAME="smi" SIZE=48"><BR>
</p>
<INPUT TYPE="button" VALUE="Get SMILES" >

</form>


</center>

</BODY>
</HTML>

 _______________________________________________
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

  • Follow-Ups:
    • Re: Passing variable from javascript to applescript
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: scripting Word top copy text - should be simple, but ain't
  • Next by Date: Re: Struggling with a script
  • Previous by thread: Re: scripting Word top copy text - should be simple, but ain't
  • Next by thread: Re: Passing variable from javascript to applescript
  • Index(es):
    • Date
    • Thread