• 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
Executing javascript in Safari via AppleScript...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Executing javascript in Safari via AppleScript...


  • Subject: Executing javascript in Safari via AppleScript...
  • From: David Crowe <email@hidden>
  • Date: Sun, 21 Nov 2004 22:59:19 -0700

Title: Executing javascript in Safari via AppleScript...
There's probably a really simple explanation for this...

I'm trying to execute some _javascript_ from an applescript, and I'm able to view elements of the page from the "do _javascript_" applescript command in Safari (and from entering the code with a "_javascript_:" prefix as a pseudo-URL) but I cannot modify any elements.

For example:

do _javascript_ "alert(document.frmQueryBox.SendTo.value)" in document 1

displays the value (i.e. name) showing in a pull-down menu.


However
    do _javascript_ "document.frmQuery.Box.SendTo.value = 'New Value'" in document 1

does nothing. But if I build similar _javascript_ into a web page it works.

Is there some kind of prohibition in browsers from having external _javascript_ modify the page?

- David Crowe
 _______________________________________________
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: Executing javascript in Safari via AppleScript...
      • From: jj <email@hidden>
  • Prev by Date: Re: Deleting last item of a List
  • Next by Date: Re: Executing javascript in Safari via AppleScript...
  • Previous by thread: Re: Applescript-users Digest, Vol 1, Issue 213
  • Next by thread: Re: Executing javascript in Safari via AppleScript...
  • Index(es):
    • Date
    • Thread