I’d like to auto update a cell with the date on which the document was last saved. I know I can find the information elsewhere, it would just be convenient to have it front and centre on this particular sheet.
Not sure there will be, but is there a way of programatically getting that saved date so I can populate accordingly?
On 14/11/2022 15:32, Ian McCall wrote:
I’d like to auto update a cell with the date on which the document was
last
saved. I know I can find the information elsewhere, it would just be
convenient to have it front and centre on this particular sheet.
Not sure there will be, but is there a way of programatically getting
that
saved date so I can populate accordingly?
I don't think you can do it programmatically from within Numbers e.g. by using some sort of formula, but you can do it using AppleScript.
tell application "Numbers" to tell front document to set thePath to its
file
tell application "Finder" to set modDate to modification date of file
thePath
tell application "Numbers"
tell active sheet's first table of front document
set value of cell 2 of column "B" to modDate
end tell
end tell
The closest formula I can find inside Numbers is NOW() which works, but
every time you make an edit (even without saving) it updates.
Chris Ridd wrote:
[snip]
The closest formula I can find inside Numbers is NOW() which works, but every time you make an edit (even without saving) it updates.
That ought to be OK.
If you make an edit, what you see on the screen updates. But if you
close the file without saving then surely the file is not changed, and therefore retains the original value.
Compare that with MS Word, where opening a document that has a date configured as "update automatically" the date changes as soon as you
open the ducument - very confusing when perhaps your reason for opening
the document is to see when you last modified it ...
On 14/11/2022 23:30, Bruce Horrocks wrote:
On 14/11/2022 15:32, Ian McCall wrote:
I’d like to auto update a cell with the date on which the document
was last
saved. I know I can find the information elsewhere, it would just be
convenient to have it front and centre on this particular sheet.
Not sure there will be, but is there a way of programatically getting
that
saved date so I can populate accordingly?
I don't think you can do it programmatically from within Numbers e.g.
by using some sort of formula, but you can do it using AppleScript.
tell application "Numbers" to tell front document to set thePath to
its file
tell application "Finder" to set modDate to modification date of file
thePath
tell application "Numbers"
tell active sheet's first table of front document
set value of cell 2 of column "B" to modDate
end tell
end tell
The closest formula I can find inside Numbers is NOW() which works, but
every time you make an edit (even without saving) it updates.
Chris Ridd wrote:
[snip]
The closest formula I can find inside Numbers is NOW() which works,
but every time you make an edit (even without saving) it updates.
That ought to be OK.
If you make an edit, what you see on the screen updates. But if you
close the file without saving then surely the file is not changed, and therefore retains the original value.
Notesdevice where the app is located.
The NOW function does not have any arguments. However, you must include the brackets.
The displayed date and time are updated every time you open the file or change a table.
The time zone for a local macOS file: The file’s time zone matches the time zone in the Date & Time preferences on the Mac when the file was last saved.
The time zone for a local iOS or iPadOS file: The file’s time zone matches the time zone in your Date & Time settings when the file is opened or saved.
The time zone for an iCloud file: The file’s time zone matches the time zone in iCloud settings when the file is first created. If the file is opened and saved in a local app (not in iCloud), the time zone is updated to match the settings on the
The time zone for a file shared with collaborators: The file’s time zone continues to match the time zone in iCloud settings where the file was first shared, unless you unshare it and save it in a local app (not in iCloud).
To use NOW as a static date and time stamp, you can select a cell that contains it, choose Edit > Copy, select the cell where you want the time stamp, then choose Edit > Paste Formula Results to paste the date and time as static (unchanging) text.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 151:51:52 |
| Calls: | 12,091 |
| Calls today: | 4 |
| Files: | 15,000 |
| Messages: | 6,517,621 |