Topic : change all AW docs to pages docs

Topic Archived This topic has been archived - replies are not allowed.


This question is answered.



            Permlink
            Replies : 8 - Pages : 1 - Last Post : Dec 1, 2007 12:56 PM by: KOENIG Yvan
George UK


Posts: 150
Registered: Jun 15, 2003
change all AW docs to pages docs
Posted: Nov 24, 2007 5:59 AM
 

Hi,

I'm aware that I can change individual AW docs into a pages doc, I would like to change them all as I have 100's and this would be too time consuming to carry out individually.

How can I achieve this change in one attempt or is it just not possible?

Thx George UK

iMac 2.4 Ghz Intel Core 2 Duo 24" screen   Mac OS X (10.5)   Classic 2!  
Sagesse


Posts: 1,297
From: Philadelphia, PA, USA
Registered: Oct 29, 2003
Re: change all AW docs to pages docs
Posted: Nov 24, 2007 6:39 AM   in response to: George UK
Helpful

You can make the documents open in Pages by going to the finder, single clicking on any cwk document and then going to the file menu and selecting "Get Info". The find the "Open With:" section, select Pages and then click on the "Change All" button. Note: This will not batch convert your documents, but will make it so they are opened in Pages when you double click on them.

Towers: G5 1.6 GHz, G4 PCI 400 MHz Yikes! 10.3.9; Laptop: G3 (Kanga/3500) 9.2.2   Mac OS X (10.4.11)   Yikes! Overclocked to 450, magically fixed internal USB.  
George UK


Posts: 150
Registered: Jun 15, 2003
Re: change all AW docs to pages docs
Posted: Nov 24, 2007 8:01 AM   in response to: Sagesse
 

Thanks. Is it not possible to do change all of my WX docs then? Cheers George UK

iMac 2.4 Ghz Intel Core 2 Duo 24" screen   Mac OS X (10.5)   Classic 2!  
Michael Morgan1


Posts: 11,705
Registered: Jan 18, 2002
Re: change all AW docs to pages docs
Posted: Nov 24, 2007 8:28 AM   in response to: George UK
Solved

I'm aware that I can change individual AW docs into a pages doc,

How do you think you can do this? I'm aware of no magic wand of that type, but know that you can open the AW file in Pages, then save it from Pages — but you wind up with two files, not one newly changed one.

I can't imagine that this would be possible in any sort of a group move, unless it could be fudged by something like a command-line mass change of a whole group of filetype suffixes (which would NOT be the case here, as Pages files are packages, among other differences).

I suppose the open/save process could be automated, perhaps using Automator or something similar. It still wouldn't be instantaneous, but you wouldn't have to baby-sit the whole process either.

iMac G5 17" iSight   Mac OS X (10.4.9)  
KOENIG Yvan


Posts: 15,907
From: France
Registered: May 18, 2002
Re: change all AW docs to pages docs
Posted: Nov 24, 2007 12:47 PM   in response to: Michael Morgan1
Helpful

Hello

This script may help.

Save it as an application on the desktop.

Drag and drop a bunch of AW6 WP files, or a folder containing such files on the script's icon.

The script will batch open every AW6 WP and save them as Pages documents in a folder named "wasBOBO_nowPages" on the desktop.

At the end of the process if some files haven't be treated, the clipboard would contain their list.

--SCRIPT AW batch BOBO2Office8
(*
Exécuter ce script ou déposer l'icône d'un dossier
sur son icône (version application)
ouvre les documents AppleWorks du dossier
et les enregistre en fichier Pages
dans le dossier "wasBOBO_nowPages" sur le bureau.

Run the script or drag and drop a folder icon
on its icon (application version)
open AppleWorks documents stored
in the folder and save them as Pages file
in the folder "wasBOBO_nowPages" on the desktop.

Yvan KOENIG le 24 novembre 2007
*)

property english : true (* false = messages français
• true = english messages *)

property Stockage : "wasBOBO_nowPages"

property rapport : "" -- globale
property msg8 : "" -- globale
property msg91 : "" -- globale
property msg92 : "" -- globale
property msg93 : "" -- globale
property msg94 : "" -- globale
property msg99 : "" -- globale
property cheminDeStockage : "" -- globale
property Bttns1 : {"", "", ""} -- globale

    • ===========

(* deux lignes exécutées si on double clique
sur l'icône du script application
• two lines executed if one double click
the application script's icon *)
if english is false then
set msg00 to "Choisir un dossier …"
else
set msg00 to "Choose a folder …"
end if
tell application "Finder"
choose folder with prompt msg00
set listeFichiers to every item in result
end tell
if (count of listeFichiers) = 0 then return
open listeFichiers

    • ==============================

on open (sel) (* sel contient une liste d'alias des éléments
qu'on a déposés sur l'icône du script (la sélection)
• sel contains a list of aliases of the items
dropped on the script's icon (the selection) *)
try
if msg8 is "" then my prepareMessages()

set rapport to ""

set cheminDeStockage to ¬
my creeDossierDeStockage()

repeat with elem in sel
set elemA to elem as alias
my exploreTraite(elemA, (info for elemA), "")
end repeat

if rapport > "" then
set the clipboard to (msg8 & return & return & rapport)
tell application ¬
(path to frontmost application as string) to ¬
display dialog ¬
"le presse-papiers contient la liste des fichiers non traités" with icon 0 ¬
buttons {msg99}
end if
on error MsgErr number NroErr
if NroErr is not -128 then
beep 2
tell application ¬
(path to frontmost application as string) to ¬
display dialog "" & NroErr & " : " & MsgErr ¬
with icon 0 ¬
buttons {msg99} giving up after 20
end if -- NroErr is…
return
end try
end open

    • ============= Routines

on creeDossierDeStockage()
(* S'il n'existe pas,
construit un dossier destination sur le bureau
• If does not exist,
create a destination folder on the desktop *)
set cheminDuBureau to (path to desktop)
if Stockage ends with ":" then set Stockage to ¬
(text 1 thru -2 of Stockage) as text
set cheminDeStockage_ to ¬
"" & cheminDuBureau & Stockage & ":"
try
cheminDeStockage_ as alias
on error (* cheminDeStockage n'existe pas, on le crée
• cheminDeStockage is not available, build it *)
tell application "Finder" to ¬
make new folder at cheminDuBureau ¬
with properties {name:Stockage}
end try
return cheminDeStockage_
end creeDossierDeStockage

    • ===========

on exploreTraite(elem, les_infos, ptree)
set elem_ to elem as text
if (folder of les_infos) then
try
set pf to (package folder of les_infos) as boolean
on error
set pf to (package of les_infos) as boolean
end try
if pf is true then (* amandine *)
set rapport to rapport & msg93 & elem_ & return
(* Attention, un package EST un dossier "spécial".
• Caution, a package IS a "special" folder. *)
else
my ExploreUnDossier(elem_, ptree)
end if -- (package…
else
if (file creator of les_infos is "BOBO") and (file type of les_infos is "CWWP") then
my TraiteUnFichier(elem_, ptree)
else
set rapport to rapport & msg93 & elem_ & return
(* Rejette fichier non Claris/AppleWorks.
• Skip non Claris/AppleWorks files. *)
end if -- file type…
end if
end exploreTraite

    • ===========

on ExploreUnDossier(dossier, ptree)
repeat with nomElement in ¬
list folder dossier without invisibles
set cheminElement to dossier & nomElement
tell application "Finder" to ¬
set C to name of (dossier as alias)
my exploreTraite(cheminElement as alias, ¬
(info for file cheminElement), ptree & C & ":")
end repeat
end ExploreUnDossier

    • ===========

on TraiteUnFichier(leFichier, ptree)
if (ASCII number of (read (leFichier as alias) for 1)) is 6 then
tell application "Pages"
try
open alias leFichier
set isOpen to true
on error
set isOpen to false
set rapport to ¬
rapport & msg92 & leFichier & return
end try
end tell -- to Pages 
if isOpen is true then
tell application "Pages"
try
set oldName to name of document 1
save document 1 in (cheminDeStockage & oldName)
close document 1
on error
set rapport to ¬
rapport & msg91 & leFichier & return
end try
end tell -- to Pages 
end if
else
set rapport to ¬
rapport & msg94 & leFichier & return
end if

end TraiteUnFichier

    • =============

on prepareMessages()
if english is false then
set msg8 to "Fichiers non enregistrés."
set msg91 to "Pas copié"
set msg92 to "Pas ouvert"
set msg93 to "Refusé"
set msg94 to "Pas un TdT AW6"
set msg99 to " Vu "
set Bttns1 to {"Annuler", "Modifier", "Accepter"}
else
set msg8 to "Unsaved files."
set msg91 to "Not copied"
set msg92 to "Not open"
set msg93 to "Rejected"
set msg94 to "Not an AW6 WP"
set msg99 to "Oops"
set Bttns1 to {"Cancel", "Reset", " OK "}
end if
set msg91 to "### " & msg91 & " ### "
set msg92 to "### " & msg92 & " ### "
set msg93 to "### " & msg93 & " ### "
set msg94 to "### " & msg94 & " ### "

end prepareMessages

--[/SCRIPT]

I don't embed too many checks. I'm aware of one possible error: if two AW docs have the same name the second one wil not be saved (at least if I made no error) ;-)

Yvan KOENIG (from FRANCE samedi 24 novembre 2007 21:47:04)

To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !   Mac OS X (10.4.11)    

George UK


Posts: 150
Registered: Jun 15, 2003
Re: change all AW docs to pages docs
Posted: Nov 26, 2007 11:21 AM   in response to: KOENIG Yvan
 

Thanks folks. It would appear that what I ask is not possible.

I manually drag AW docs to the pages icon in the dock and that opens a copied pages doc, which I can then save, leaving me with an original Aw doc and now a new pages one.

Tedious but looks like that is the only way to do this.

Thx again,

George UK

iMac 2.4 Ghz Intel Core 2 Duo 24" screen   Mac OS X (10.5)   Classic 2!  
Barry


Posts: 2,507
Registered: Jun 20, 2003
Re: change all AW docs to pages docs
Posted: Nov 26, 2007 11:37 AM   in response to: George UK
 

"Tedious but looks like that is the only way to do this."

Yvan's script makes the process much less tedious by letting Pages take care of the process without your needing to intervene for each document.

Regards,
Barry

     
George UK


Posts: 150
Registered: Jun 15, 2003
Re: change all AW docs to pages docs
Posted: Dec 1, 2007 12:05 PM   in response to: Barry
 

Hi Barry and Yvan,

Thanks for your help here. Yvan, your suggestion may work, but to be absolutely honest, that is way, way over my head!! Never seen anything like it in my life and would not know where to start such a process. Many thanks anyway,

cheers George UK

iMac 2.4 Ghz Intel Core 2 Duo 24" screen   Mac OS X (10.5.1)   Classic 2!  
KOENIG Yvan


Posts: 15,907
From: France
Registered: May 18, 2002
Re: change all AW docs to pages docs
Posted: Dec 1, 2007 12:55 PM   in response to: George UK
 

Hello

What is difficult?

Select the script in the message
Copy to clipboard (cmd + c)

Open the Script Editor
Open a new file
Paste in the new file's window.

Select menu item

File > Save
Select the format Application
click OK

You will find the Script's icon in your default folder (for me it's the desktop).

Select a folder containing AW6 WP documents
drag and drop its icon on the script's one

Now look it working.

Yvan KOENIG (from FRANCE samedi 1 décembre 2007 21:55:44)

To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !   Mac OS X (10.4.11)