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 MacLoggerDX Version 4 Sample Scripts Folder.
Don't forget to have a look at the User Contributed AppleScripts.