Re: Insert text and paste command
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