keystroke - cancel modifiers?
keystroke - cancel modifiers?
- Subject: keystroke - cancel modifiers?
- From: "Nathaniel Virgo" <email@hidden>
- Date: Fri, 9 May 2008 12:24:32 +0100
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.
So is there a way either cancel out or ignore the modifiers I'm holding down, or to detect when I've finished pressing them and only run the keystroke command then? I tried "...keystroke date_ using {}" but it didn't work.
Thanks in advance
Nathaniel
_______________________________________________
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