• 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: Sun, 17 Apr 2005 20:46:49 +0100


On Sun, 17 Apr 2005 13:50:52 +0200, Andrea -XFox- Govoni wrote:

David C Andrews wrote:

<cut-here>
    tell application "Finder" to set frontAppPath to path to frontmost
    application
    tell application "System Events"
    set frontAppName to displayed name of frontAppPath
    set frontmost of process frontAppName to true
    tell process frontAppName to keystroke "MyText"
    end tell
    <cut-here>

FWIW, I've been told that "System Events" should be faster at this. So perhaps (untested from script menu) the following will do:

<cut-here>
tell application "System Events"
set frontAppName to (displayed name of (path to frontmost application))
set frontmost of process frontAppName to true
tell process frontAppName to keystroke "MyText"
end tell
<cut-here>

It works, thanks! :-)
Somehow I was convinced that the "path to" command was in the Finder dictionary... '^_^

In fact it belongs to neither the Finder or System Events, but to Standard Additions - so the first version above should have worked with the first line as simply: "set frontAppPath to path to frontmost application".


---
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


  • Prev by Date: Re: An Applescript Cocktail
  • Next by Date: Re: Localized Internals of AppleScript (date Class for example)
  • Previous by thread: Re: Insert text and paste command
  • Next by thread: Mail to iCal and iCal to Mail
  • Index(es):
    • Date
    • Thread