If you want to run AppleScripts from the Function Keys - have a look at David Stark's freeware XKeys
The following scripts are delivered in the Sample Scripts Folder.
Don't forget to have a look at the User Contributed AppleScripts.