Here is a way to Save As in a single call.
--(SCRIPT Pages_save_a_copy]
(*
Enregistrer le script en tant que Script : Pages_save_a_copy.scpt
déplacer le fichier créé dans le dossier
<VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Pages:
Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
Aller au menu Scripts , choisir Pages puis choisir “Pages_save_a_copy”
Le script enregistre une copie du document au premier plan
au format natif de Pages en ajoutant la date et l'heure au nom du fichier.
--=====
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".
+++++++++
Save the script as a Script: Pages_save_a_copy.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.
Go to the Scripts Menu, choose Pages, then choose “Pages_save_a_copy”
The script saves the frontmost document
in the native Pages format in a date_time stamped file.
--=====
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
--=====
Yvan KOENIG (VALLAURIS, France)
2011/08/12
*)
on run
local docPath, docName, docFolder, fileName, theExt, newName, newPath
set major_OS to get system attribute "sysv"
(*
Grab infos about the open doc at front *)
tell application "Pages"
tell document 1
set docPath to its path
set docName to its name
end tell
if major_OS ≥ 4208 then savedocName(* Required for Lion *)
end tell
(*
Grab infos about the file from which the doc was open *)
tell application "System Events" to tell disk item docPath
set docFolder to path of container
set fileName to name
set theExt to name extension
end tell
(*
Build an unique name for the new document *)
if theExt is not "" then
set newName to (text 1 thru -(2 + (length of theExt)) of fileName) & (do shell script "date +_%Y%m%d_%H%M%S.") & theExt
else
set newName to fileName & (do shell script "date +_%Y%m%d_%H%M%S")
end if
(*
Create the new file *)
tell application "System Events"
makenewfileat end of folderdocFolderwith properties {name:newName}
end tell
set newPath to (docFolder & newName) as alias
(*
Save a copy in the newly created file *)
tell application "Pages"
savedocumentdocNameinnewPath
end tell
end run
--=====
--[/SCRIPT]
--{code}
Open a document.
Run the script once you will have a date_time stamped copy of its original state.
Make wanted changes.
Run the script which will automatically save the doc adding a date_time stamp to its name.
When you have finished, close the mainb file which will save the late changes if they arent already saved.
If you want to keep the changes in the main doc, leave iot as is.
If you want to retrieve the doc in iots original state, delete the doc and rename the first date_time stamped file removing its date_time stamp.
Yvan KOENIG (VALLAURIS, France) samedi 13 août 2011 21:29:23
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !