Help!!! how do i write a keystroke to trigger an idle script?

Hi, great site
what i was trying to do was a script that while idle is triggered by the “keystroke “c” using {command down}” then runs the script.
this is what i have so far.

on idle
	set CR to ASCII character 13
	set Search_dictionary to the clipboard
	tell application "System Events"
		tell application "Dictionary" to activate
		keystroke Search_dictionary & CR
	end tell
	return 3
end idle

Hi,

Welcome to MacScripter. :slight_smile:

To trigger a script with a shortcut you need a third party tool like FastScripts, QuickSilver, QuicKeys.
Then this is sufficient

activate application "Dictionary"
tell application "System Events" to keystroke (get the clipboard) & return

Thanks Stefan :slight_smile:
I’ll tell you how it went.

cheers
jonserr

Stefan,
I used Fastscripts, it worked like a charm.

thanks again
jonserr