Script for automatic fade in/out at the clip boundaries

Yeah sorry about the mess.
Anyway, i found what i wanted in this topic: Macro: How to make a selection relative to labels and slightly modded the code to fit my desires.
Case closed, thanks everyone for the help!