Run Applescript through Key Command

Hello all, I’m very new to applescript. I’m trying to get an applescript that I wrote to run through a keyboard shortcut. I have made one that empties the trash and I can run that through a keyboard shortcut. I just set it in System Prefrences → Keyboard.

For some reason I can’t achieve this same effect with this script:


tell application "Finder"
	delete every item in folder "Downloads" of home
end tell

I compiled it and saved it as an Application Bundle (same as I did with my empty trash script). I placed it in the same folder as my Empty Trash script, and then tried to assign it to a key shortcut. For some reason this script just won’t work using shortcuts.

I was wondering if anyone could tell me what might be wrong. Here a few pictures to clarify what I’m talking about:

http://img243.imageshack.us/img243/9773/picture1xq9.jpg
http://img376.imageshack.us/img376/1518/picture2nd7.jpg

Just to clarify the Empty Trash script shortcut works but the Downloads script doesn’t.

Thank you in advance.

i have tried your script and put it in menu script folder, short cut is working fine.

regards
anni

Could you explain your process? Like from compiling it, to getting the shortcut to run. Thank you.

In my opinion the keystroke management of Apple’s System Preferences is a bit clumsy.
Personally I do prefer QuickSilver which not only offers a better key management but also a lot of other great things which make it easier to use and automate your Mac.

Ciao
Farid

That’s a great idea, I’ve never thought of that.

hi Wicked,

i didn’t make a application bundle as you told. I just save your script with .scpt extension in folder(~/Documents/Microsoft User Data/Entourage Script Menu Items/) and executed using short cut.

i think your keyboard setting is not enabled
go to
System Preferences=>Universal Access=> select check box(Enable access for assistive devices)

regards,
anni

Hmm, that box is checked in universal access. It’s still not working. Strange. Thank you for your help by the way.