• 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: Copy text to the clipboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copy text to the clipboard


  • Subject: Re: Copy text to the clipboard
  • From: "John R." <email@hidden>
  • Date: Mon, 5 Dec 2005 12:12:00 -0500

kai wrote:
John, you don't appear to have mentioned which OS version you're
running. If it's Tiger (or possibly even Panther), have you tried the
approach that both Luther and I suggested in this thread - and that
Chris Nebel also mentioned in the recent "frontmost application" thread?


path to frontmost application

Thanks, that's easy and works fine to get the app. (I use Tiger)

What I really want is to copy the current selection from that app. System Events is not working for me. Same results even if I convert from a path string to the process name alone. What am I doing wrong?

set myapp to (path to frontmost application as string) -- NOTE: only works as scpt (not as app)
set myapp to find text ":([^.:]+)\\." in myapp using "\\1" with regexp and string result -- Convert path to name.
tell application myapp to activate
tell application "System Events"
tell process myapp
keystroke "c" using command down
end tell
end tell
tell application myapp
set mytext to the clipboard
display dialog mytext & return & myapp
end tell


_______________________________________________
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: Copy text to the clipboard
      • From: kai <email@hidden>
  • Prev by Date: Re: Tiger broke the print command in quarkXpress - who else has noticed this
  • Next by Date: Re: Shell script timing, regex
  • Previous by thread: Re: Copy text to the clipboard
  • Next by thread: Re: Copy text to the clipboard
  • Index(es):
    • Date
    • Thread