Re: keystroke - cancel modifiers?
Re: keystroke - cancel modifiers?
- Subject: Re: keystroke - cancel modifiers?
- From: "Nathaniel Virgo" <email@hidden>
- Date: Fri, 9 May 2008 15:54:40 +0100
Thanks Yvan, that did the job.
It would seem odd to me if there isn't a more general solution to this type of problem.
Nathaniel
2008/5/9 KOENIG Yvan <
email@hidden>:
Le 9 mai 2008 à 13:24, Nathaniel Virgo a écrit :
Hi,
I would like my favorite text editor to insert the current time and date when I press command-D. I have inserted the following into its scripts menu:
set date_ to (current date) as string
tell application "System Events" to keystroke date_
which works fine. The problem is that if I assign this the shortcut command-D (using the keyboard preferences pane), then when the script starts running I'm still holding down the command key so that it enters command-F command-R command-I command-D command-A command-Y etc. instead of "Friday...," causing my document to become very strangely formatted.
You may try with:
set the clipboard to (current date) as string
tell application "System Events" to keystroke "v" using {command down}
Yvan KOENIG (from FRANCE vendredi 9 mai 2008 14:24:52) _______________________________________________
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
_______________________________________________
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