I use this AppleScript to create a new Pages document with some standard titles and verbiage:
tell application "Pages"
activate
set myDoc to make new document with properties {document template:template "MyTemplate"}
set paragraph 1 of body text of myDoc to (current date as text)
end tell
The "set" is meant to write over a dummy line provided by the template and replace it with the date. However, the line is not changed. I have tried scripts that I found online, and they all have the same effect: the script refuses to modify text provided by the Pages template.
After the script exits, though, I can edit the line, so it's not read-only.
What is happening?
(Yosemite, Pages 5.6, Script Editor 2.7)
tell application "Pages"
activate
set myDoc to make new document with properties {document template:template "MyTemplate"}
set paragraph 1 of body text of myDoc to (current date as text)
end tell
The "set" is meant to write over a dummy line provided by the template and replace it with the date. However, the line is not changed. I have tried scripts that I found online, and they all have the same effect: the script refuses to modify text provided by the Pages template.
After the script exits, though, I can edit the line, so it's not read-only.
What is happening?
(Yosemite, Pages 5.6, Script Editor 2.7)