Re: Keystroking a Text Field
Re: Keystroking a Text Field
- Subject: Re: Keystroking a Text Field
- From: Bill Cheeseman <email@hidden>
- Date: Wed, 01 Jul 2015 12:01:46 -0400
On Jul 1, 2015, at 11:44 AM, Yvan KOENIG < email@hidden> wrote:
Why insert a delay whose length maybe too big when we may wait just the time required by the machine ? This may be achieved with :
activate application "TextEdit"
tell application "System Events" to tell process "TextEdit" set frontmost to true keystroke "Hello Cruel World!" end tell
Fair enough, although I've never been able to tell the difference between an application with a delay of 0.1 seconds and an application with no delay.
But your script still has some redundancies. Since you're setting TextEdit's frontmost property to true in the System Events tell block, you don't need the initial activate command. And you don't need to send the 'keystroke' command to an inner TextEdit tell block. Here's my next version:
tell application "System Events" set frontmost of process "TextEdit" to true keystroke "Hello Cruel World!" end tell
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden