iPhone iOS17 Shortcut Automation to insert Date-Time stamp into Notes

Notes for iOS 15, 16, 17:                                                                          [2023-10-16 MO and  2021-09-26 SU]
 –01– you need to check option “Local Only” in 2 places. First, when you copy Formatted Date to Clipboard and then second time, when you restore original clipboard value into Clipboard. 
–02– if you automation stopped working completely, you need to shut down the phone for several minutes and then it will work normally again.
 –03– I would be able to provide additional guidance in case you still can’t make this to work under iOS 15, 16, 17.

Note for any iOS upgrade: if you start to see an error massage after upgrading your iPhone to a new iOS, please see instructions added at the end of the article.

For many years we were using a free  Time Stamp Text APP to insert current date and time stamp from clipboard (CB). Something happened to this simple APP and it is no longer available in the Apple store.

For over 3 months I had to type the date and time manually loosing 10 seconds or so on every new Notes entry.  – Unacceptable.

Starting from iOS 13.1 iPhone has a new feature – Shortcuts that facilitates automation.  And these Shortcuts did not disappoint.

Here is a plan for the shortcut actions and attaching that shortcut to Notes automation procedure:

 – every time we go to Notes, system should open the latest note and store current date and time stamp in the clipboard so that we can paste it into a desired spot in the note.

Here are the implementation details       

 

First we create a shortcut “Send Timestamp to Clipboard” that has 3 actions:

 

 – ACTION 1 – place current date and time into a Date variable

 

– ACTION 2 – format Date string to required personal standard (“EEE” in  format string means Day-of the-week, for example Mon, Tue, Wed etc.)

 

– ACTION 3 – Place Formatted Date into clipboard

 

We will call this shortcut from Notes automation procedure later 

Next, we will “code” actions required for Time and Date paste automation for Notes.

 

We will create a Personal automation for an event <<When “Notes” opened>>.  It will consist of 6 actions

Details of first 3 actions displayed in the image to right:

 

– store current Clipboard content into a variable StoreClipboard.

 

 – execute (or run) previously created shortcut “Send Timestamp to Clipboard” to fill CB with properly formatted Date and Time stamp.

 

 – open latest note by searching All Notes by latest creation date and limiting result by one note only.

And the final 3 steps.

– open (or show) the latest note that was found

 

– wait 7-9 seconds for user in paste the Date Time stamp into the note

 

– restore original CB contend from variable StoreClipboard.

This solution works great.  Not additional third party downloads are required, and 7 to 9 seconds appears to be a very good compromise between waiting and scrambling to paste the date.  Besides, if you missed the  opportunity to paste the date, you can always switch out and back into the Notes to have the fresh Date Time stamp in your CB for another 7 seconds.

Ideas and questions for further refinement:

 – Is it possible to distinguish when Notes were opened and when user just switched to Notes from other APP(s)?

 – How can I manipulate (compare, truncate, search  by)  portions of the strings stored in variables?

Your input is appreciated.

 

You see an error message after updating iOS

After taking a major version update, you will see an error  message: “Can’t find a shortcut” or “Can’t find an automation”.  You go to your Shortcuts, and you clearly see it is there. What you need to do is to go inside, make an artificial change and save your shortcut or automation.  That will reset internal pointer and everything will be working again.


[2023-10-16 MO - validated for iOS 17.0.3]
[2021-01-27 WE - updated for iOS 14.3]

 

(Visited 40,164 times, 2 visits today)

6 Comments

  1. Questions to *** HiThere321 ***:
    –01– You did all your customization using only native iOS shortcut tools. You did not use any third party coding – Correct?
    –02– Did you find a way to insert a date stamp automatically at the end at the beginning of the Note. In my method, user still had to perform a paste within 7 seconds of opening the Note.
    – Thank you for your post.

  2. I added some steps to my initial shortcut that allow you to use it in a variety of ways. This one will look for input via tapping on Share with any text hilighted or the recent clipboard contents (kind of like what you did in your Notes automation). To quickly launch the shortcut without the share sheet or leaving your current app you can add the shortcuts widget to your notification screen. Then from inside any app you can swipe open the notification screen, then swipe right to get to widgets, and tap on the shortcut there to activate it manually.
    Method 1: Hilight any text you want to append the timestamp to, use the right arrow in the selection popup to select SHARE, tap your shortcut in the list (if enabled).
    Method 2: Copy some text to the clipboard and quickly launch this shortcut from the notification center* or Shortcuts app to append the clipboard contents.
    Method 3: Assuming you have not copied something recently, launch this shortcut from the notification center* or Shortcuts app to copy just the timestamp.
    Method 4: Build an automation to get it into Notes or something like in the original walk-through, but it wouldn’t need to get the current clipboard or the wait because this shortcut will check for that and append the timestamp inline.

    //SETUP – To enable Method 1 go into the Shortcut Details screen and turn on “Show in Share Sheet”
    //Then set the Share Sheet Types to Rich Text, Text, and URLs (and any others you want).

    //SHORTCUT ACTIONS – (comments prefixed with // and all are built-in/global/magic)

    IF HAS ANY VALUE
    //If text was passed as the shortcut input (via Share sheet/automation)…

    TEXT: –
    //Tap the 1st and set TYPE=Text, GET=Creation Date, and DATE FORMAT=(Preference/Custom)
    //Type any hyphens/spaces/etc you want separating the timestamp and text
    //Tap the 2nd and set TYPE=Text (or Rich Text to preserve formatting)

    OTHERWISE
    //…No text input so check for recent clipboard contents…

    IF IS IN THE LAST 1 MINUTE
    //Tap and set GET=Creation Date (as date) then set the IF comparison to IN THE LAST
    //Set the IF comparison criteria to a duration after which the clipboard is considered stale and should be ignored

    TEXT: –
    //Tap the 1st and set TYPE=Text, GET=Creation Date, and DATE FORMAT=(Preference/Custom)
    //Type any hyphens/spaces/etc you want separating the timestamp and text
    //Tap the 2nd and set TYPE=Text (or Rich Text to preserve formatting)

    OTHERWISE
    //…Clipboard is empty or stale so just return the timestamp by itself…

    TEXT:
    //Tap on and set DATE FORMAT=(Preference/Custom)

    END IF

    END IF

    COPY TO CLIPBOARD
    //Copy the (magic variable) to the clipboard

    SHOW ALERT
    //Display a popup with copied text so the user knows it is ready to paste (optional)

  3. I like your walk-through and in setting it up myself I discovered an enhancements I thought you might like…
    “Current Date” is actually a built-in global variable and you can format its output to a custom format string so your “Send Timestamp to Clipboard” shortcut can be reduced to a single action as long as you intend to use the current date/time and not some offset of that. Delete your “Current Date” and “Format Date” actions leaving just the “Copy to Clipboard” action. Change the action input from “Formatted Date” to the built-in “Current Date” global variable. Next, tap on the “Current Date” variable and you should see options to set the date & time formats. Switching the Date format to Custom allows you to enter a format string like what you had in the Format action.

  4. Hi Larry,
    We did not find a way to paste clipboard content at a current location. If you do, please let us know.
    Thank you for your comment.

  5. Is it possible for an action to “Paste” clipboard into the newly opened App? For example, I open an app that gives me a new / empty note (FastEver). I want to paste that Date / Time into the app at the current location.

    Thank you

  6. Thank you so much.
    For recording daily expense I have used several iphone apps , but nothing is good enough.
    I decided to use Excel , actually excel is perfect app for expense recording. But a blocking problem is how to put date and time of this moment. Ctrl + ; is not possible at mobile phone. I was almost give up.
    But your method resolve my issue perfectly.
    Thank you again. Bye.

Your question, correction or clarification Ваш вопрос, поправка или уточнение