https://github.com/Tyler-Anderson/Applescripts-
I'm sure its been done a bunch of times, but I created a super simple alfred workflow that calls a script to toggle hidden files. I haven't used applescript otherwise, but i still think it's a super simple example for anyone who needs an example.