• 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
Safari: When do changes to a <textarea> show up in AppleScript "get the text..."
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Safari: When do changes to a <textarea> show up in AppleScript "get the text..."


  • Subject: Safari: When do changes to a <textarea> show up in AppleScript "get the text..."
  • From: email@hidden
  • Date: Tue, 20 Oct 2009 09:50:41 -0700 (PDT)

I have the following script that I use to read the text of a Safari document and write it to a file:

tell application "Safari"
	set txt to get the text of document 1
end tell
set f to a reference to file ((path to desktop as string) & "justTesting1")
open for access f with write permission
write txt to f
close access f

If I have a web page displayed in Safari that has a <textarea> in it, then the contents of the <textarea> appear in the text written to the file.

However, if I merely change the contents of the <textarea> and then delete the file contents and rerun the script I still get the value of the <textarea> before I changed it.

If I click a button that causes part of the page to be reloaded and then delete the file contents and rerun the script I get the new value of the <textarea>

I guess my question is when do changes I type into a <textarea> get bound to the text of document 1?

Thanks,

Jerry
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Safari: When do changes to a <textarea> show up in AppleScript "get the text..."
      • From: "Mark J. Reed" <email@hidden>
  • Prev by Date: Re: watermark
  • Next by Date: Re: Empty strings in XML-RPC struct replies
  • Previous by thread: Re: 64 vs 32
  • Next by thread: Re: Safari: When do changes to a <textarea> show up in AppleScript "get the text..."
  • Index(es):
    • Date
    • Thread