• 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
Re: Web text to word
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Web text to word


  • Subject: Re: Web text to word
  • From: kai <email@hidden>
  • Date: Wed, 16 Nov 2005 17:00:40 +0000


On 16 Nov 2005, at 04:07, dor kelman wrote:

Hello, I am new to applescript. I have tried reading how to do this but I
cant figure it out. I want to copy all the text in my current safari web
page and put it into ms word. So far all I have is:


Tell application "Safari"
Open location "http://news.google.com";
--here I need to copy the text
End tell

Hopefully we're talking about Word 2004 here, dor - in which case something like this might do the trick:


----------------

on SafariText(l)
	tell application "Safari" to tell document 1
		open location l
		tell URL to repeat until (exists) and it is l
			delay 0.5
		end repeat
		its text
	end tell
end SafariText

tell application "Microsoft Word"
	activate
	tell (make new document) to set text object's content ¬
		to my SafariText("http://news.google.com/";)
end tell

----------------

(Note the "/" at the end of the URL, which is needed for this approach to work.)

---
kai


_______________________________________________ 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
References: 
 >Web text to word (From: dor kelman <email@hidden>)

  • Prev by Date: Re: Running AppleScripts from Users CronTab [was (no subject)]
  • Next by Date: Closing a terminal window when a terminal process ends
  • Previous by thread: Re: Web text to word
  • Next by thread: Re: Get default icon of document/etc programmatically (Applescript-users Digest, Vol 2, Issue 758)
  • Index(es):
    • Date
    • Thread