You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

How do I create a timestamp on a macOSMonterey pages?

I don't have Microsoft Word anymore and my time stamp is gone and I use it for timecodes and would love to find out how to create a macro for a shortcut to do it on pages.

Thanks!

MacBook, macOS 10.12

Posted on Aug 1, 2022 4:40 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 2, 2022 3:20 AM

Pages is not a Word clone, so has limitations on what you can do with Date & Time.


The Pages Insert menu has a Date & Time menu item. That format will key off your System Preferences Language & Region settings as to its format. Once Pages has inserted that Date & Time data, you can click on it to alter the formatting.



This inserted Date & Time data does not automatically update when the document or template is opened. If you need a feature that allows the Date & Time stamp to auto-update each time the document or template is opened, then you would use a table cell with the function NOW in it. You have great latitude in how you alter the table cell Date/Time Format including a custom time stamp.



Since you cannot put other Pages objects in header or footer sections, and if that is the destination for your Date & Time content that you want to have updated, then it becomes a scripting or automator solution to manually apply the date/time information.

3 replies
Question marked as Top-ranking reply

Aug 2, 2022 3:20 AM in response to ctopherd

Pages is not a Word clone, so has limitations on what you can do with Date & Time.


The Pages Insert menu has a Date & Time menu item. That format will key off your System Preferences Language & Region settings as to its format. Once Pages has inserted that Date & Time data, you can click on it to alter the formatting.



This inserted Date & Time data does not automatically update when the document or template is opened. If you need a feature that allows the Date & Time stamp to auto-update each time the document or template is opened, then you would use a table cell with the function NOW in it. You have great latitude in how you alter the table cell Date/Time Format including a custom time stamp.



Since you cannot put other Pages objects in header or footer sections, and if that is the destination for your Date & Time content that you want to have updated, then it becomes a scripting or automator solution to manually apply the date/time information.

Aug 2, 2022 8:09 AM in response to ctopherd

Pages does not have any macro support language inherent to the application. Apple includes Automator with macOS through macOS Monterey, and Shortcuts, the Automator replacement beginning with Monterey. The upside is that you can create an Automator Service associated with Pages that can be assigned a non-conflicting keyboard shortcut, and that can enter any timestamp you want.


Try this:


In your Applications folder you will find a robot icon named Automator.



Double-click to launch Automator, and with the dialog, select New Document > Service or Quick Action (depending on the version of macOS), and then click Choose.


This opens a three-column display with Libraries, actions, and large workflow window.

  1. Select the Utilities Library. Locate Run Shell Script, and drag/drop that action over onto the large workflow window.
  2. At the top of the workflow window, set Workflow receives current [ no input ] in [ any application ]. And ☑︎ Output replaces selected text.
  3. In the Run Shell Script window, just enter the UNIX date command and the formatting for the timestamp that you want to apply in Pages.
  4. Save the Service or Quick Action with the name Date_Time_Stamp.
  5. In System Preferences > Keyboard > Shortcuts > Services, scroll down in the service items until you encounter the preceding service name you used.
    1. In the right-column, there will be a gray word none. Click that. It will change to a Add Shortcut button. Click that. Use control+t which will appear as ^T. Press enter to set it.
    2. Quit System Preferences


In Pages, the first time you want to enter the time stamp, click where you want it, and then control-click to open the secondary menu, where you select Services > Your service name. That will enter the Time Stamp. Subsequently you can use the keyboard shortcut to enter that content.


Here is what you copy/paste into that Run Shell Script action:


# reference: https://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html

date -j +%X

hh:mm:ss


The OpenGroup link shows you all of the % codes you can use to manipulate your output. If you want time adjusted to UTC, then use date -j -u +%X. You can also view these codes locally in the Terminal application by entering:


man strftime



The Automator Service/Quick Action will look like this:


How do I create a timestamp on a macOSMonterey pages?

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