How to insert automatic Date/Time Stamp on filename?!
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)
Macbook, Mac OS X (10.5.8)
--[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]
--
al3x_newton wrote:
When I click on the scripts icon in the menu bar I do not see a Numbers selection to choose...
How to insert automatic Date/Time Stamp on filename?!