• 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
replacing selected text in a document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

replacing selected text in a document


  • Subject: replacing selected text in a document
  • From: David Rice <email@hidden>
  • Date: Tue, 15 May 2007 19:23:57 -0400

I am using ThisService to set up a Service with the following script:

on process(_str)
tell application "System Events"
set _appname to name of first process whose frontmost is true
end tell
tell application _appname
set _str to "[" & _str & "]"
display alert "String: " & _str
set the clipboard to _str
paste
end tell
end process

If TextEdit is the top application and I have made a selection, the alert that TextEdit displays shows that the clipboard has been set to _str. 
How  do I paste the contents of the clipboard in place of the selected text?

Cheers,
David



 _______________________________________________
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

  • Prev by Date: Re: Filemaker 8.5 stored applescript problem
  • Next by Date: Appending text?
  • Previous by thread: Re: List filtering - help
  • Next by thread: Re: replacing selected text in a document
  • Index(es):
    • Date
    • Thread