• 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: Luther Fuller <email@hidden>
  • Date: Thu, 1 Dec 2005 16:34:52 -0600

John R. asked ...
I want to copy selected text into my script from ANY active application. I need to tell the current application to <get selection>, or I need to use GUI scripting via: <keystroke "c" using command down>. But I can't find the name of the active application or
process...

As per my posting yesterday, you just write ... short name of (info for (path to frontmost application)) and you'll have the name of the active application.

But, I ran into another problem this afternoon that may be relevant here. If you save your code as an application, you are likely to get the name of YOUR application as the current active application. I solved my problem by saving my code as an application bundle with 'LSUIElement = yes'. (Making it a "faceless background application".) You can also save your code as a script, then run it via the script menu.

Copying text from ANY application may be a problem. I just checked a script I wrote earlier this year where I got the text selected in either Smile or in Script Editor. I had to use very different code for each application. Perhaps System Events has a general solution for this. If so, I hope someone knows and will tell us how to do it.
_______________________________________________
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
  • Prev by Date: Shell script timing, regex
  • 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