Fix path detection by using the path of the current macro and not assuming anything
Place script inside body tag