How to insert automatic Date/Time Stamp on filename?!

I have a simple chart that I fill out for work hours and whatnot every day with the Numbers program.

I would love to have the date inserted into the filename automatically so that I don't have to manually enter it every day when I save.

Is this possible?

Macbook, Mac OS X (10.5.8)

Posted on Nov 10, 2010 11:10 PM

Reply
6 replies

Nov 11, 2010 12:40 AM in response to al3x_newton

If you use an Autosave tool like my free script, you will get several date_time stamped copies.
This would :

(1) fill your needs
(2) give you incremental backups in case something behave wrongly on your machine.

Of course it would be easy to build a script which you would trigger as a replacement of the standard Save to save with a date_time stamp appended to the file name.
If I have time available, I will write such a script.

Yvan KOENIG (VALLAURIS, France) jeudi 11 novembre 2010 09:40:42

Nov 11, 2010 1:37 AM in response to KOENIG Yvan

--

--[SCRIPT savewith_date_timestamp]
(*
Enregistrer le script en tant que Script : savewith_date_timestamp.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Aller au menu Scripts , choisir Numbers puis choisir savewith_date_timestamp
Le script enregistre les documents Numbers ouverts ayant été modifiés.
Il crée également une copie dont le nom inclut la date et l'heure.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
Sous 10.6.x,
aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
puis cocher la case "Afficher le menu des scripts dans la barre des menus".
--=====
Save the script as a Script: savewith_date_timestamp.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Go to the Scripts Menu, choose Numbers, then choose "savewith_date_timestamp"
The script save open and modified Numbers documents.
It create duplicates with date_time stamp appended to the file names.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editor’s Preferences dialog box
and check the “Show Script menu in menu bar” option.
--=====
Yvan KOENIG (VALLAURIS, France)
2010/11/11
*)
--=====
on run
-- my savemodifieddocuments("Pages")
-- my savemodifieddocuments("Keynote")
my savemodifieddocuments("Numbers")
end run
--=====
on savemodifieddocuments(theApp)
local titres, aDoc
tell application "System Events" to set titres to title of processes
if theApp is in titres then
tell application theApp
repeat with aDoc in every document
if modified of aDoc then
save aDoc
tell application "System Events" to my duplicatewith_date_timestamp(path of disk item (path of aDoc))
end if
end repeat
end tell
end if
end savemodifieddocuments
--=====
on duplicatewith_date_timestamp(fichier) (* fichier is an HFS path*)
local Nom, ext, dossier, nomZip, source, dest
tell application "System Events" to tell disk item ("" & fichier)
set Nom to name
set ext to name extension
set dossier to path of container
end tell
set source to quoted form of POSIX path of (fichier)
set Nom to text 1 thru -(2 + (count of ext)) of Nom
set nomZip to Nom & (do shell script "date +_%Y%m%d-%H%M%S") & "." & ext
set dest to quoted form of POSIX path of (dossier & nomZip)
do shell script "ditto " & source & " " & dest
end duplicatewith_date_timestamp
--=====
--[/SCRIPT]
--


Yvan KOENIG (VALLAURIS, France) jeudi 11 novembre 2010 10:37:19

Nov 11, 2010 5:32 PM in response to KOENIG Yvan

So I created the Numbers folder and moved the script file into it.

Now I am confused at this point:

"Go to the scripts menu, choose numbers, then choose "save with_date_timestamp
the script save open and modified numbers documents"s


When I click on the scripts icon in the menu bar I do not see a Numbers selection to choose...


Sorry I have no experience with this kind of stuff! Thank you very much for your help thus far!

Nov 11, 2010 7:41 PM in response to al3x_newton

al3x_newton wrote:
When I click on the scripts icon in the menu bar I do not see a Numbers selection to choose...


You will only see the Numbers Scripts if both conditions below are true:

• Numbers in the active application (ie. the name beside the Apple menu is "Numbers".

• The script is stored at the following location:
username > Library > Scripts > Applications > Numbers
User uploaded file

Regards,
Barry

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.

How to insert automatic Date/Time Stamp on filename?!

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