• 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: select text of document 1 in TextEdit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: select text of document 1 in TextEdit?


  • Subject: Re: select text of document 1 in TextEdit?
  • From: kai <email@hidden>
  • Date: Thu, 3 Aug 2006 21:51:33 +0100


On 3 Aug 2006, at 21:19, Don W Strickland wrote:

tell application "BBEdit"
	activate
	-- this works in BBEdit but NOT in TextEdit
	select text of document 1
	copy the selection
end tell

Can you tell me how to do that same thing in TextEdit? I just want to copy the contents of a TextEdit document to the clipboard in an AppleScript.

Not an unreasonable request, Don - but one that Cocoa apps don't generally seem quite ready for at the moment. Until they are, you may have to resort to System Events to achieve something similar. (However, it seems unnecessary to enable GUI scripting for this kind of thing.)


--------

activate application "TextEdit"
tell application "System Events" to keystroke "ac" using command down

--------

---
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: 
 >select text of document 1 in TextEdit? (From: Don W Strickland <email@hidden>)

  • Prev by Date: Re: select text of document 1 in TextEdit?
  • Next by Date: Re: select text of document 1 in TextEdit?
  • Previous by thread: Re: select text of document 1 in TextEdit?
  • Next by thread: Problem with scripting ARD
  • Index(es):
    • Date
    • Thread