• 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: Insert text and paste command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Insert text and paste command


  • Subject: Re: Insert text and paste command
  • From: Andrea -XFox- Govoni <email@hidden>
  • Date: Thu, 14 Apr 2005 17:27:02 +0200

Adam Wuellner wrote:

set myText to "Supercalifragilisticexpialidocious"
tell application "System Events"
   set frontmost of process "TextEdit" to true
   keystroke myText
end tell

Ok, thanks kai, this works in TextEdit but I need that it works in
every application.
So the following logical question is: is there a way to determine
the name of the fronmost application?

Try this:

tell application "Finder" to set theApp to name of (every process
whose frontmost is true) as string

This is getting a little circular, isn't it?  Could it really be that
one has to set the frontmost property of the application whose
frontmost is true, to true???  I'm sorry that I have nothing more
constructive to add... this just seems so bizarre...

I found that the frontmost application when I launch a script from the Script Menu is always System Events, so I tried to set the frontmost property of System Events to false, hoping that this would make the former frontmost application (that is the application where I want that the script operates) the new frontmost application... but I found that the Finder always became the new frontmost application. :-\


--
Andrea "XFox" Govoni
ICQ UIN: 43488185
AIM/iChat: email@hidden
Yahoo! ID: xfox82
_______________________________________________
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: Insert text and paste command
      • From: Martin Orpen <email@hidden>
References: 
 >Re: Insert text and paste command (From: Adam Wuellner <email@hidden>)

  • Prev by Date: Re: Insert text and paste command
  • Next by Date: RE: Display Dialog
  • Previous by thread: Re: Insert text and paste command
  • Next by thread: Re: Insert text and paste command
  • Index(es):
    • Date
    • Thread