• 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: Fri, 2 Dec 2005 09:49:11 -0500


"Brett K."  wrote:
This is how I do it:
tell application "System Events"
     set theProcess to every process whose frontmost is true
     tell process theProcess to keystroke "c" using command down
end tell

How is this any different from what I did?

tell application "System Events"
set x to (name of application processes whose frontmost is true)
display dialog item 1 of x
end tell
---> "ScriptEditor" when run under Script Editor;
---> "System Events" when run from the any application via script menu.

The problem is that the "frontmost" process is NOT correct when I run a script from Apple's Script Menu. Is is always "system events"!


- John R.

_______________________________________________
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: "Brett K." <email@hidden>
  • Prev by Date: Re: Validating email address
  • Next by Date: Re: Copy text to the clipboard
  • Previous by thread: Re: Copy text to the clipboard
  • Next by thread: Re: Copy text to the clipboard
  • Index(es):
    • Date
    • Thread