Made resource button macros more general