Re: System Events Keystroke
Re: System Events Keystroke
- Subject: Re: System Events Keystroke
- From: "Steven D. Majewski" <email@hidden>
- Date: Tue, 20 Feb 2007 12:16:08 -0500
On Feb 20, 2007, at 11:34 AM, John Dulion wrote:
Hello,
I cannot get Text Edit to save. I am closing the window after my
text is written and then I paste in my text to name file. I then
need it to "click" the save button or the return key. Any help
would be appreciated.
tell application "TextEdit" to activate
tell application "System Events"
tell process "TextEdit" to keystroke "w" using
command down
delay 1
keystroke return
delay 2
tell process "TextEdit" to keystroke "v" using
command down
delay 2
tell process "TextEdit" to keystroke return —
this is the action that does not happen.
end tell
Thanks,
Why in the world are you using System Events GUI scripting on TextEdit
when TextEdit has a scripting dictionary that can do what you want
directly
and more simply ?
tell application "TextEdit" to close document 1 saving in file
"Users:..."
-- Steve Majewski
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden