Throw this script in the tmp
directory of where your PowerDNS on Rails installation lives, make is executable and run like this:
$ ./tmp/apply-macro.rb 1 example.com example.org example.net
It will load the macro with ID 1, and apply it against each domain passed as CLI arguments.