tell front document of application "Pages"
make new page with properties {template:page template "Foo"}
end tell
There are two page templates in my document, Foo and Bar. I need to add a page with the Foo page template after the current page. When I run the script, there is an error:
Pages got an error: Can’t get template “Foo” of document 1.
How to fix this?