Updating dates automatically in Pages

Doesn't seem like Pages has a way to update a date in a document automatically. Is there?

If not, that's a pretty significant omission in my opinion.

Posted on Jan 5, 2020 5:25 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 6, 2020 10:29 AM

Apple never intended to design Pages to compete with any other business-oriented word processing application such as MS Word that provides field codes for intra-document date locations as you describe. Use Word instead.


In addition to the cell solution that I mentioned, one can assign text strings throughout the document as placeholder text. One then uses AppleScript to replace those placeholder text strings with the particular date format needed.


For instance, I placed the text string [date] in the left footer segment on three pages. I selected [date], and from Format menu : Advanced : Define as Placeholder Text. The string now takes on a salmon colored appearance:


And when I run the appropriate AppleScript, every occurrence of the [date] string is now replaced by the current date:


code:

set date_text to "[date]" -- placeholder text string
set theTags to {} as list

set {year:y, month:m, day:d} to current date
-- January 6, 2020
set dstr to (m & space & d & ", " & y) as text

tell application "Pages"
	launch
	if not (exists front document) then
		display alert "Pages document must be open for this script to function properly."
		if it is running then quit
		return
	end if
	
	tell front document
		set theTags to the tag of every placeholder text whose tag is equal to date_text
		repeat with i from 1 to count of theTags
			set thisTag to item i of theTags
			set (every placeholder text whose tag is thisTag) to dstr as text
		end repeat
	end tell
end tell
return


Still, simpler to use MS Word, in my estimation.

8 replies
Question marked as Top-ranking reply

Jan 6, 2020 10:29 AM in response to nick baccante

Apple never intended to design Pages to compete with any other business-oriented word processing application such as MS Word that provides field codes for intra-document date locations as you describe. Use Word instead.


In addition to the cell solution that I mentioned, one can assign text strings throughout the document as placeholder text. One then uses AppleScript to replace those placeholder text strings with the particular date format needed.


For instance, I placed the text string [date] in the left footer segment on three pages. I selected [date], and from Format menu : Advanced : Define as Placeholder Text. The string now takes on a salmon colored appearance:


And when I run the appropriate AppleScript, every occurrence of the [date] string is now replaced by the current date:


code:

set date_text to "[date]" -- placeholder text string
set theTags to {} as list

set {year:y, month:m, day:d} to current date
-- January 6, 2020
set dstr to (m & space & d & ", " & y) as text

tell application "Pages"
	launch
	if not (exists front document) then
		display alert "Pages document must be open for this script to function properly."
		if it is running then quit
		return
	end if
	
	tell front document
		set theTags to the tag of every placeholder text whose tag is equal to date_text
		repeat with i from 1 to count of theTags
			set thisTag to item i of theTags
			set (every placeholder text whose tag is thisTag) to dstr as text
		end repeat
	end tell
end tell
return


Still, simpler to use MS Word, in my estimation.

Jan 5, 2020 10:06 PM in response to nick baccante

Real old version (over 8 years ago) had this. We all used it in our office.


When Apple made Pages as an App, they took this away.

I guess it made the program a bit smaller code-wise but that is just a guess. May other features disappeared as well. A few have been added back over the years.


I agree this would be a valuable preference, but Apple software engineers took it away.


Pls see: https://en.wikipedia.org/wiki/Pages_(word_processor)


On October 23, 2013, Apple released a redesign with Pages 5.0 and made it free for anyone with an iOS device. In this release, many templates, as well as some advanced features that were available in version 4.3, were not included. Some of these missing features were put back over the next releases but the current version (8.0, released March 28, 2019) still lacks important features from version 4.3 including mail merge, non-contiguous selection of text, advanced find/replace functions, the ability to print comments, and more.

Jan 6, 2020 10:47 AM in response to Eric Wieczorek

They omitted it, as Pages v5.0 in 2013 was a complete, ground-up rewrite of the better Pages '09 application. It was not based on the Pages '09 v4.3 code pool, so the automatic date feature would have to be something that they were motivated to add to the new code — and have not for over six years.


Even Pages '09 v4.3 was intended as a consumer grade application. Of course, many chose to use it in their business for the simplicity over Word, but that still doesn't alter it from its original intended purpose.

Jan 6, 2020 9:00 AM in response to VikingOSX

thanks, I was afraid that's the only option, really baffles me why Pages doesn't have a simple feature that MS Word has had as long as I can remember

the cell trick is fine for a simple instance of this but imagine a document where today's date is referenced throughout (such as a legal doc or anywhere today's date needs to be referenced)


it's not a huge deal for me but if it was more important I can see easily moving over to Word just for that feature

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Updating dates automatically in Pages

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