Some useful macro scripts