• 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: kai <email@hidden>
  • Date: Wed, 13 Apr 2005 23:57:24 +0100


On Thu, 14 Apr 2005 00:38:42 +0200, Andrea -XFox- Govoni wrote:

deivy petrescu wrote:

set myText to "Supercalifragilisticexpialidocious"
 tell application "System Events"
   keystroke myText
 end tell

In the Script Editor window it works flawlessy, but If I try to execute the script from the Script Menu when I am in a TextEdit document, for example, it doesn't work.
It works only inside Script Editor.

Andrea,
This is a known issue with some cocoa apps. They will not respond to scripts run on script menu.
So, provided you do not run it from script menu when TE s the active application, I believe it will work!

No, it works *only* in Script Editor if I run it with the Run command (Apple + R).
It's very annoying...

It's necessary to follow Andrew's original advice and bring the target application to the front. This works here:


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

---
kai

_______________________________________________
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: Andrea -XFox- Govoni <email@hidden>
  • Prev by Date: Re: Insert text and paste command
  • Next by Date: Help......scripting for Quicktime Fullscreen mode doesn't work correctly
  • Previous by thread: Re: Insert text and paste command
  • Next by thread: Re: Insert text and paste command
  • Index(es):
    • Date
    • Thread