How to make F7/F8/F9 keys only control iTunes
1) Install karabiner
https://pqrs.org/osx/karabiner/index.html .
2) run karabiner elements
-> go to complex modifications tab
-> click "add rule" button
-> click "Import more rules.." button
Some web page will be open
https://pqrs.org/osx/karabiner/complex_modifications/
3) Search "Media key only control iTunes"
4) Import it. Go back to the karabiner element, enable the rules.
Here is my stack overflow answer.