• 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: Fri, 15 Apr 2005 02:26:59 +0200

Joseph Weaks wrote:

There is a catch to this when run from the Script Menu. Here's some info from the AppleScript v1.9.2 release notes -

Scripts that use the path to frontmost application command will now get the correct path when run from the Script Menu menu extra. Previously, the command would return the path to System Events. [3084984]

Here is the work-around I use to bypass the bug/feature. This line returns the proper/expected result when run from the script menu:

tell application "Finder" to set frontProcess to displayed name of (path to frontmost application)

Thank you very much guys! Thanks to your suggestions now the script works very well! :-D The final form is:

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


I tested it with many application without any problem.
Only with my current mail program (Netscape 7.2) it doesn't work... but it's a small bug, I'll try to fix it if it will be still present in the coming soon Netscape 8.
Thanks again! :-)


--
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: David C Andrews <email@hidden>
References: 
 >Re: Insert text and paste command (From: J Stewart <email@hidden>)
 >Re: Insert text and paste command (From: Joseph Weaks <email@hidden>)

  • Prev by Date: Re: Insert text and paste command
  • Next by Date: Setting permission from an applescript
  • Previous by thread: Re: Insert text and paste command
  • Next by thread: Re: Insert text and paste command
  • Index(es):
    • Date
    • Thread