Hi,
I have very basic understanding of how to write Apple Script. I need to add code to my existing script so that pags will select a specific Placeholder text and paste Clipboard (Rich Text) instead of it.
Maybe one option could be to select PlaceHodler Text and execute Edit - Paste to paste Rich Text over it?
Please help.
Existing code that I use to move data from Drafts app to Pages Template
-- Set Variables
on run {input}
set clinic to item 1 of input
set fullName to item 2 of input
set dateOfBirth to item 3 of input
set dateOfLoss to item 4 of input
set dateOfAssessment to item 5 of input
set supervisor to item 6 of input
set reportNamePath to item 7 of input
set dateStamp to item 8 of input
set reportTemplate to item 9 of input
-- Pages Create New File
tell application "Pages"
activate
set thisDocument to ¬
make new document with properties {document template:template reportTemplate}
tell thisDocument
-- Replace Tags
set (every placeholder text whose tag is "clinic") to clinic
set (every placeholder text whose tag is "name") to fullName
set (every placeholder text whose tag is "DOB") to dateOfBirth
set (every placeholder text whose tag is "DOL") to dateOfLoss
set (every placeholder text whose tag is "DOA") to dateOfAssessment
set (every placeholder text whose tag is "supervisor") to supervisor
set (every placeholder text whose tag is "DOR") to dateStamp
save thisDocument in POSIX file reportNamePath
end tell
end tell
return input
end run