Hello,
I thought I'd share one of my first macros I've tried with Keyboard Maestro. Basically, it runs a program when Xcode is activated/deactivated to enable and disable the function keys. The method here uses a program created by Nelson Chen. I forked his project and modified it slightly for my purposes (mostly by adding an option to toggle when the program is invoked with no arguments).
The project can be downloaded here -> https://github.com/mscreations/fntoggle
and if you would prefer an Applescript version (I ditched this method because I didn't like how the System Preferences icon would bounce on the dock):
Script -> https://gist.github.com/mscreations/a1ca6c1ccea23d8b4d3f
Script -> https://gist.github.com/mscreations/8aa02ea00cd53573eb91
Script -> https://gist.github.com/mscreations/de5ccb4a88c63aac6fac
Hope someone finds this useful.