Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

In Pages, how to insert a PRINT-DATE field into a doc.?

Want to insert a field that will show the date of the doc's printing.

In MS Word, this is known as 'insert print date'.

How to do so in Pages? Thanks.

iMac (21.5-inch, Late 2013), OS X Yosemite (10.10.2)

Posted on Mar 25, 2015 11:57 AM

Reply
3 replies

Mar 25, 2015 8:11 PM in response to Dave in San Juan Capistrano

You can define placeholder text in Pages v5.5.2 in any of the six header/footer sections. Think of it as a a field code that when you click on it the text you enter replaces the placeholder text using the same style. By example, I placed a combination of text and placeholder text in the lower left footer segment.


User uploaded file


The text and the brackets were selected, and then Format ▸ Advanced ▸ Define as Placeholder Text. Also, because it is in the footer, it is replicated throughout the document. Although you could Insert > Date/Time into this placeholder text, automation may be preferred. I have chosen to use the same date/time style as MS Word uses in its print date field code. You can only change placeholder text programmatically with Pages and AppleScript on Yosemite. Once I run the AppleScript, all placeholder tags are replaced as shown in this image:


User uploaded file


You could make this an Automator Service (e.g. run AppleScript action with no input, and output replacement is checked). One could assign a keyboard shortcut to this service too. One click printed date stamp and document sent to default printer.


The AppleScript (Yosemite only).

-------------------------------------------


property tagStr : "[print-date]"


--- used for testing ---

-- set f to POSIX path of ((path to desktop) as text) & "arg.pages"

-- set hf to POSIX filef as alias

--------------------

set printDate to "" as text

set theTags to {}


tell application "Pages"

activate

-- openhf


tell front document


set theTags to the tag of every placeholder text whose tag is equal to tagStr


-- Word print-date field code uses this 12-hour date/time format as mm/dd/YY 00:00 AM/PM

set printDate to do shell script ("/bin/date +'%D %l:%M %p'") as text


repeat with i from 1 to count of theseTags

set thisTag to itemi of theseTags

set (every placeholder text whose tag is thisTag) to printDate

end repeat


-- use your own System Preferences printer name string

tell application "Samsung ML-2950 Series (Sammy)"

activate

-- no print dialog

print front document without «class pdlg»

quit

end tell


end tell


-- close front documentsavingno


end tell

In Pages, how to insert a PRINT-DATE field into a doc.?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.