Converting mulitple Pages files to .doc

Hi I am using Pages '09 and have a lot of Pages documents that i want to convert to .doc so that i can open them in Microsoft Word on a PC. I know that you can go into each one and export them so they are .doc but you have to do that individually and that would take too much time. Is there any way that you can just convert them all at once.

Why not use a script already posted :
--[SCRIPT batch_exportPages2DOC]
Enregistrer ce script en tant que script ou progiciel.
Exécuter ce script ou
déposer l'icône d'un dossier sur son icône.
Il ouvre tout document Pages du dossier
et l' enregistre en fichier DOC
dans le dossier "wasPages_nowDOC".
Celui-ci peut être sur le bureau
ou dans le dossier "~/Documents".
Si le GUIscripting n'est pas activé
le script demande votre mot de passe pour l'activer.
Le script récupère le dossier d'exportation par défaut
dans le fichier de préférences de Pages.
Éviter de cliquer durant l'exécution du script
sauf évidemment pour sélectionner le dossier source.
Save the script as script or application bundle.
Run it or drag and drop a folder icon on its icon.
It opens every Pages's documents stored
in the folder and save it as DOC file in a folder named "wasPages_nowDOC".
This one may be on the desktop or in the "~/Documents" folder.
according to the property storeOnDesktop.
If GUIscripting is disabled
the script ask for your password to enable it.
The script extract the default export path
from the Pages's preferences file.
Don't click when the script is running.
Except, of course, to select the source folder.
Yvan KOENIG (VALLAURIS, France)
2008/04/20
2009/06/17 adapté pour format .doc
2009/12/13 updated for MacOs 10.6…
property theApp : "Pages"
property theExt : "pages"
property nomDuRapport : "report_Pages2DOC.txt"
property nomdudossier : "wasPages_nowDOC"
property storeOnDesktop : true (*
true = dest folder will be on Desktop
false = dest folder will be in "~/Documents"
property msg1 : "" -- globale
property msg90 : "" -- globale
property msg91 : "" -- globale
property msg92 : "" -- globale
property msg94 : "" -- globale
property msg95 : "" -- globale
property msg96 : "" -- globale
property msg99 : "" -- globale
property rapport : "" -- globale
property dossierDeStockage : "" -- globale
property dossierParDefaut : "" -- globale
property localExport : "" -- globale
property newExt : "" -- globale
property newType : "" -- globale
property isOs4 : missing value -- globale
property isOs5 : missing value -- globale
property theMenu : missing value -- globale
property menuExport : missing value -- globale
property types : {{"doc", "SLDocumentTypeMSWord", 2}, {"pdf", "SLDocumentTypePDF", 1}, {"txt", "SLDocumentTypePlainText", 4}, {"rtf", "SLDocumentTypeRichText", 3}, {"rtfd", "SLDocumentTypeRichTextBundle"}, 3}
--=====
(* our settings *)
property typeNum : 1
(* 1 = WORD, 2 = PDF, 3 = Txt, 4 = rtf, 5 = rtfd *)
property theButton : missing value
1 button PDF
2 button Word
3 button RTF
4 button Standard
--=====
on run (* lignes exécutées si on double clique sur l'icône du script application
• lines executed if one double click the application script's icon *)
tell application "System Events" to set dossier to choose folder (*
dans un bloc System Events pour avoir un titre de dialogue "localisé"
• in a System Events block to get a localized dialog title. *)
my commun({dossier})
-- my commun({"Macintosh HD:Users:yvankoenig:Desktop:forsee:" as alias})
end run
--=====
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) *)
my commun(sel)
end open
--=====
on commun(elems)
my nettoie()
my prepareMessages()
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true (*
Active le GUI scripting
• Enable GUI scripting *)
set titres to title of processes
end tell -- to System Events
if theApp is not in titres then my activateTheApp() (*
Active et ferme la fenêtre du document créé à l'ouverture
• Activate and close the doc's window created at opening *)
set {newExt, newType, theButton} to item typeNum of types (*
item 1 = {"doc", "SLDocumentTypeMSWord",2}
item 2 = {"pdf", "SLDocumentTypePDF",1}
item 3 = {"txt", "SLDocumentTypePlainText",4}
item 4 = {"rtf", "SLDocumentTypeRichText",3}
item 5 = {"rtfd", "SLDocumentTypeRichTextBundle",3}
set sysAtt to (system attribute "sys2")
if 4 > sysAtt then
if my parleAnglais() then
error "This script requires MacOs X 10.4 or higher !"
else
error "Ce script requiert MacOs X 1.4 ou ultérieur !"
end if
else if 5 > sysAtt then
set isOs4 to true
set isOs5 to false
if my getVersion() < "4" then
set theMenu to 3
set menuExport to 13
else
set theMenu to 10
set menuExport to 8 (* was a wrong 9 *)
end if
end if
my fermeFenetres() (*
• Close existing windows *)
my afficheLeMessage(msg1) (*
Éviter de cliquer…
• Don't click… *)
tell application theApp to set localExport to localized string "Export"
set dossierParDefaut to my getDefaultExport() as text
set rapport to ""
set dossierDeStockage to my creeDossierDeStockage(nomdudossier) (* Unicode text *)
try
repeat with elem in elems
try
my exploreTraite(elem as alias, "")
end try
end repeat
if rapport = "" then set rapport to msg90
-- crée un fichier texte sur le Bureau
set p2d to path to desktop
set p2r to (p2d as Unicode text) & nomDuRapport
tell application "System Events"
if exists (file p2r) then delete (file p2r)
make new file at end of p2d with properties {name:nomDuRapport}
end tell
set rapport to rapport as text
write rapport to (p2r as alias)
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
my nettoie()
if my parleAnglais() then
my afficheLeMessage("Export done.")
else
my afficheLeMessage("Traitement terminé.")
end if
end commun
--=====
on nettoie() (*
pour ne pas stocker dans le fichier script
• So it will not be stored in the script file *)
set dossierDeStockage to ""
set dossierParDefaut to ""
set rapport to ""
set localExport to ""
set newExt to ""
set newType to ""
set isOs4 to missing value
set isOs5 to missing value
set theMenu to missing value
set menuExport to missing value
set theButton to missing value
set msg1 to ""
set msg90 to ""
set msg91 to ""
set msg92 to ""
set msg94 to ""
set msg95 to ""
set msg96 to ""
set msg99 to " "
end nettoie
--=====
on afficheLeMessage(m)
beep 1
tell application (path to frontmost application as string)
activate
if my parleAnglais() then
display dialog m buttons {" OK "} default button 1 giving up after 10
else
display dialog m buttons {" Vu "} default button 1 giving up after 10
end if
end tell
end afficheLeMessage
--=====
on creeDossierDeStockage(Nom) (*
S'il n'existe pas, construit un dossier destination sur le bureau ou dans "~/Documents"
• If does not exist, create a destination folder on the desktop or in "~/Documents"
local dd, dds
if storeOnDesktop is true then
set dd to path to desktop as Unicode text
else
set dd to path to documents folder as Unicode text
end if
if Nom ends with ":" then
set dds to dd & Nom
else
set dds to dd & Nom & ":"
end if
dossierDeStockage n'existe pas, on le crée
• dossierDeStockage is not available, build it *)
tell application "System Events" to if not (exists item dds) then make new folder at end of folder dd with properties {name:Nom}
return dds as Unicode text
end creeDossierDeStockage
--=====
on exploreTraite(elem, ptree) (*
elem est un alias
• elem is an alias *)
local elem_, cl_, type_Id
set elem_ to elem as Unicode text
tell application "System Events" to tell disk item elem_
set cl_ to class
if cl_ is folder then
set type_Id to ""
else
set type_Id to type identifier
end if
end tell -- "System Events"
set cl_ to cl_ as Unicode text
if type_Id is in {"com.apple.iwork.pages.pages", "com.apple.iwork.pages.sffpages"} then (*
C'est un fichier Pages.
• It's a Pages document *)
my TraiteUnDocument(elem_)
else if cl_ is in {"file package", "«class cpkg»"} then
set rapport to rapport & msg91 & elem_ & return (*
"Package", Attention, un package EST un dossier "spécial".
• Caution, a package IS a "special" folder. *)
else if cl_ is in {"folder", "«class cfol»"} then
my ExploreUnDossier(elem_, ptree)
else
set rapport to rapport & msg92 & elem_ & return (*
"Pas un document Pages".
• "Not a Pages's document" *)
end if -- typeId_ is …
end exploreTraite
--=====
on ExploreUnDossier(dossier, ptree)
local nomElement, cheminElement, c
repeat with nomElement in list folder dossier without invisibles
set cheminElement to dossier & nomElement
tell application "System Events" to set c to name of (dossier as alias)
my exploreTraite(cheminElement as alias, ptree & c & ":")
end repeat
end ExploreUnDossier
--=====
on TraiteUnDocument(leCheminOriginal_UniText)
my export2Doc(leCheminOriginal_UniText as alias, leCheminOriginal_UniText)
end TraiteUnDocument
--=====
on export2Doc(p, leCheminOriginal_UniText) (*
• here p is the path as alias *)
local flag, nomdep, nouveauChemin, w, bof, x, p_xport
try
tell application theApp
open p
set flag to false
repeat 300 times (*
Attends que le fichier soit réellement ouvert.
• Wait until the file is really open *)
if my getNbWindows() > 0 then
set flag to true
exit repeat
end if
end repeat
end tell -- to theApp
if flag is false then error number 8888 (*
Le fichier n'a pu être ouvert.
• The file can't be open. *)
on error MsgErr number NroErr
if NroErr = 8888 then
set rapport to rapport & msg94 & leCheminOriginal_UniText & return
else
set rapport to rapport & msg95 & leCheminOriginal_UniText & return
end if
return (* can't do the remaining tasks *)
end try
tell application "System Events" to tell file leCheminOriginal_UniText
set nomdep to name
end tell -- System Events
if nomdep ends with theExt then set nomdep to text 1 thru -(2 + (length of theExt)) of nomdep
set nouveauChemin to dossierParDefaut & nomdep & "." & newExt
--log nouveauChemin
tell application "System Events" to if exists (file nouveauChemin) then set name of file nouveauChemin to nomdep & my horoDateur(modification date of file nouveauChemin) & "." & newExt (* name stamped *)
try
set {w, bof} to my getFrontWindow()
tell application "System Events" to tell application process theApp
click menu item menuExport of menu 1 of menu bar item theMenu of menu bar 1 (* Exporter… *)
repeat until exists sheet 1 of window w
delay 0.1
end repeat
tell sheet 1 of window w (* sheet containing the buttons PDF, Word, RTF, Standard *)
-- get properties of UI elements of radio group 1
if isOs4 then
click button theButton of radio group 1
else if isOs5 then
click checkbox theButton of radio group 1
else
click radio button theButton of radio group 1 (* I hope that they will no longer change it *)
end if -- isOs4 is true
if typeNum is 2 then
delay 0.2
tell pop up button 1
click
click menu item quality of menu 1
end tell
delay 0.2
end if
click button 1 (* Suivant… *)
repeat until exists button localExport
delay 0.1
end repeat
click button localExport (* Exporter… *)
end tell -- to sheet…
repeat 20 times
if exists sheet 1 of window w then
click button 2 of sheet 1 of window w (*
"Ne pas consulter " dans éventuel rapport d'anomalies
• "Don't review" in sheet reporting possible export anomalies *)
exit repeat
end if
delay 0.1
end repeat
end tell -- to process … System Events
if dossierDeStockage is not dossierParDefaut then (* we must move the file from folder dossierParDefaut to folder dossierDeStockage *)
set p_xport to dossierDeStockage & nomdep & "." & newExt
tell application "System Events" to if exists (file p_xport) then set name of file p_xport to nomdep & my horoDateur(modification date of file p_xport) & "." & newExt
tell application "Finder" to duplicate file nouveauChemin to folder dossierDeStockage (*
• before 10.5, System Events is unable to move *)
my wait4File(p_xport)
tell application "System Events" to if exists file nouveauChemin then delete file nouveauChemin
end if -- dossierDeStockage is not…
my ferme1fenetre()
on error
set rapport to rapport & msg96 & p & return
end try
end export2Doc
(* =====
• Build a stamp from the modification date_time
on horoDateur(dt)
local annee, mois, jour, lHeure, lesSecondes, lesMinutes
set annee to year of dt
set mois to month of dt as number (* existe depuis 10.4 *)
set jour to day of dt
set lHeure to time of dt
set lesSecondes to (lHeure mod 60)
set lHeure to round (lHeure div 60)
set lesMinutes to (lHeure mod 60)
set lHeure to round (lHeure div 60)
return "_" & annee & text -2 thru -1 of ("00" & mois) & text -2 thru -1 of ("00" & jour) & "-" & text -2 thru -1 of ("00" & lHeure) & text -2 thru -1 of ("00" & lesMinutes) & text -2 thru -1 of ("00" & lesSecondes) (*
• Here, the stamp is "_YYYYMMDD-hhmmss" *)
end horoDateur
(* =====
• Take care, the front window may be an Inspector or a dialog one.
on getFrontWindow()
local namesOfWindows, w, flag
tell application theApp to activate
set flag to false
tell application "System Events" to tell application process theApp
set namesOfWindows to name of every window
repeat with w in namesOfWindows
if subrole of (get properties of window w) is "AXStandardWindow" then
set flag to true
exit repeat
end if
end repeat
end tell
return {w, flag} (*
• w is the name of the front document's window *)
end getFrontWindow
(* =====
• Wait that the file is completely written on disk
on wait4File(p) (*
• p must be Unicode text *)
local oldSize, nnn, newSize
set oldSize to 0
tell application "System Events" to set nnn to name of file p
repeat
try
tell application "System Events" to set newSize to physical size of file p
if oldSize < newSize then
set oldSize to newSize
else
exit repeat
end if
end try
end repeat
end wait4File
--=====
on activateTheApp()
local bof, status
tell application theApp to activate
if my getStartingStatus() is false then tell application "System Events" to tell application process theApp to keystroke return
repeat
set {bof, status} to my getFrontWindow()
if status is true then exit repeat
end repeat
end activateTheApp
(* =====
• Close existing open windows *)
on fermeFenetres()
repeat while my getNbWindows() > 0
my ferme1fenetre()
end repeat (*
• Now there is no open window *)
end fermeFenetres
--=====
on ferme1fenetre()
tell application theApp to activate
tell application "System Events" to tell application process theApp to keystroke "w" using {command down}
end ferme1fenetre
--=====
on getPlistValue(valName, default)
local thePlist, u
set thePlist to (path to preferences folder as Unicode text) & "com.apple.iWork." & theApp & ".plist"
tell application "System Events"
if exists file thePlist then
tell contents of property list file thePlist
try
set u to (value of property list item valName) (* Unicode Text *)
on error (*
On est là si Pages n'a rien enregistré avec des préférences neuves
• Here if Pages never saved with the new preferences file. *)
set u to default
end try
end tell -- to contents of…
else (*
On est là s'il n'y a pas de fichier de préférences
• Here if there is no preferences file. *)
set u to default
end if
end tell -- to system events
return u
end getPlistValue
--=====
on getStartingStatus()
return my getPlistValue("LSDefaultsUseDefaultStartingPoint", false)
end getStartingStatus
--=====
on getDefaultExport()
local u
(* son of a *****, I forgot that they don't use the same name !! *)
if theApp contains "Pages" then
set u to my getPlistValue("SLDocumentDefaultExportDirectory", "~/Documents")
else if theApp contains "Numbers" then
set u to my getPlistValue("LSDocumentDefaultExportDirectory", "~/Documents")
else
error "I didn't coded a Keynote version !"
end if
set u to (POSIX file (do shell script "echo " & u)) as text
if u ends with ":" then
return u
else
return (u & ":")
end if
end getDefaultExport
--=====
on getNbWindows()
tell application "System Events" to tell application process theApp to return count of windows
end getNbWindows
--=====
on getLocale(a, x)
tell application a to return localized string x
end getLocale
--=====
on getVersion()
try
tell application theApp to return version
on error
return "1"
end try
end getVersion
--=====
on parleAnglais()
local z
try
tell application theApp to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
on prepareMessages()
if my parleAnglais() then
set msg1 to "Don’t click when the script is running." & return & "Except, of course, if it ask for."
set msg90 to "No problem during the export process."
set msg91 to "Package"
set msg92 to "Not a " & theApp & "’s document"
set msg94 to theApp & " can’t read it"
set msg95 to "Not open"
set msg96 to "Not copied."
set msg99 to "Oops"
else
set msg1 to "Éviter de cliquer durant l’exécution du script" & return & "sauf s’il le demande."
set msg90 to "Exportation réussie sans incident."
set msg91 to "Package"
set msg92 to "Pas un document " & theApp
set msg94 to theApp & " n’a pas pu le lire"
set msg95 to "Pas ouvert"
set msg96 to "Pas copié."
set msg99 to " Vu "
end if
set msg91 to "### " & msg91 & " ### "
set msg92 to "### " & msg92 & " ### "
set msg94 to "### " & msg94 & " ### "
set msg95 to "### " & msg95 & " ### "
set msg96 to "### " & msg96 & " ### "
end prepareMessages
--=====
--[/SCRIPT]
I don't know why, under 10.5.x
the instruction which match every requirements:
set p2d to path to desktop
tell application "Pages"
save document 1 as "SLDocumentTypeMSWord" in alias ("""&p2d&"wasPagesnowdoc:Grenelle 2.doc")
returns :
"Erreur dans Pages : The document cannot be exported to the "Document Microsoft Word" format."
So, I replaced it by a code triggering the Export menu item thru GUI scripting.
Yvan KOENIG (VALLAURIS, France) 1 septembre 2010 12:00:00

Similar Messages

  • Batch convert Pages files to Doc and stay in the same folder?

    Hi there,
    I use iWork '09 on Mountain Lion. I recently switched to Microsoft Word and prefer it over Pages (personal preference). However, I have nearly 1000 files on my computer that are in Pages format. I have extensively searched this issue in the Apple Support Communities and it appears that there are scripts that DO EXIST that batch convert Pages files into Word files. However, it appears that many of these scripts were built for older versions of iWork and therefore I run into various errors. For example, I used the script available at http://pagesfaq.blogspot.com/2008/01/export-folder-to-word-rtf-pdf-txt-or.html and click run but nothing actually happens (the script runs for less than a second, then I can click run again). I was able to use one script successfully (pasted below), but the only reason I can't use it is because it saves ALL my converted documents in one folder on my desktop and I would like a script that can save them in the original file were the Pages document is located.
    So, is there an iWork '09 compatible script that can convert my Pages documents to Word documents and save them in the same folder as the original? Oh, and for an added bonus, it'd be cool if the script also deleted my Pages version after it was done with the conversion
    --[SCRIPT batch_exportPages2DOC] (* Enregistrer ce script en tant que script ou progiciel. Exécuter ce script ou déposer l'icône d'un dossier sur son icône. Il ouvre tout document Pages du dossier et l' enregistre en fichier DOC  dans le dossier "was_Pages_now_DOC". Celui-ci peut être sur le bureau ou dans le dossier "~/Documents". Si le GUIscripting n'est pas activé le script demande votre mot de passe pour l'activer. Le script récupère le dossier d'exportation par défaut dans le fichier de préférences de Pages. Éviter de cliquer durant l'exécution du script sauf évidemment pour sélectionner le dossier source. ************* Save the script as script or application bundle. Run it or drag and drop a folder icon on its icon. It opens every Pages's documents stored in the folder and save it as DOC file in a folder named "was_Pages_now_DOC". This one may be on the desktop or in the "~/Documents" folder. according to the property storeOnDesktop. If GUIscripting is disabled the script ask for your password to enable it. The script extract the default export path from the Pages's preferences file. Don't click when the script is running. Except, of course, to select the source folder. ************* Yvan KOENIG (VALLAURIS, France) 2008/04/20 2009/06/17 adapté pour format .doc 2009/12/13 updated for MacOs 10.6… *) property theApp : "Pages" property theExt : "pages" property nomDuRapport : "report_Pages2DOC.txt" property nom_du_dossier : "was_Pages_now_DOC" property storeOnDesktop : true (* true = dest folder will be on Desktop false = dest folder will be in "~/Documents" *) property msg1 : "" -- globale property msg90 : "" -- globale property msg91 : "" -- globale -- property msg92 : "" -- globale property msg94 : "" -- globale property msg96 : "" -- globale property msg99 : "" -- globale property rapport : "" -- globale property dossierDeStockage : "" -- globale property dossierParDefaut : "" -- globale property localExport : "" -- globale property newExt : "" -- globale property newType : "" -- globale property isOs4 : missing value -- globale property isOs5 : missing value -- globale property theMenu : missing value -- globale property menuExport : missing value -- globale property types : {{"doc", "SLDocumentTypeMSWord", 2}, {"pdf", "SLDocumentTypePDF", 1}, {"txt", "SLDocumentTypePlainText", 4}, {"rtf", "SLDocumentTypeRichText", 3}, {"rtfd", "SLDocumentTypeRichTextBundle"}, 3} --===== (* our settings *) property typeNum : 1 (* 1 = WORD, 2 = PDF, 3 = Txt, 4 = rtf, 5 = rtfd *) property theButton : missing value (* 1          button PDF 2          button Word 3          button RTF 4 button Standard *) --===== on run (* lignes exécutées si on double clique sur l'icône du script application • lines executed if one double click the application script's icon *)             tell application "System Events" to set dossier to choose folder (* dans un bloc System Events pour avoir un titre de dialogue "localisé" • in a System Events block to get a localized dialog title. *)           my commun({dossier})             --          my commun({"Macintosh HD:Users:yvan_koenig:Desktop:for_see:" as alias}) end run --===== 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) *)           my commun(sel) end open --===== on commun(elems)           my nettoie()           my prepareMessages()             tell application "System Events"                     if not (UI elements enabled) then set (UI elements enabled) to true (* Active le GUI scripting • Enable GUI scripting *)                     set titres to title of processes           end tell -- to System Events             if theApp is not in titres then my activateTheApp() (* Active et ferme la fenêtre du document créé à l'ouverture • Activate and close the doc's window created at opening *)           set {newExt, newType, theButton} to item typeNum of types (* item 1 = {"doc", "SLDocumentTypeMSWord",2} item 2 = {"pdf", "SLDocumentTypePDF",1} item 3 = {"txt", "SLDocumentTypePlainText",4} item 4 = {"rtf", "SLDocumentTypeRichText",3} item 5 = {"rtfd", "SLDocumentTypeRichTextBundle",3} *)           set sysAtt to (system attribute "sys2")           if 4 > sysAtt then                     if my parleAnglais() then                               error "This script requires MacOs X 10.4 or higher !"                     else                               error "Ce script requiert MacOs X 1.4 ou ultérieur !"                     end if           else if 5 > sysAtt then                     set isOs4 to true                     set isOs5 to false                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 9                     end if           else if 6 > sysAtt then                     set isOs4 to false                     set isOs5 to true                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 8 (* was a wrong 9 *)                     end if           else                     set isOs4 to false                     set isOs5 to false                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 8 (* was a wrong 9 *)                     end if           end if           my fermeFenetres() (* • Close existing windows *)             my afficheLeMessage(msg1) (* Éviter de cliquer… • Don't click… *)           tell application theApp to set localExport to localized string "Export"           set dossierParDefaut to my getDefaultExport() as text           set rapport to ""           set dossierDeStockage to my creeDossierDeStockage(nom_du_dossier) (* Unicode text *)             try                     repeat with elem in elems                               try                                         my exploreTraite(elem as alias, "")                               end try                     end repeat                       if rapport = "" then set rapport to msg90                     -- crée un fichier texte sur le Bureau                     set p2d to path to desktop                     set p2r to (p2d as Unicode text) & nomDuRapport                     tell application "System Events"                               if exists (file p2r) then delete (file p2r)                               make new file at end of p2d with properties {name:nomDuRapport}                     end tell                     set rapport to rapport as text                     write rapport to (p2r as alias)             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             my nettoie()           if my parleAnglais() then                     my afficheLeMessage("Export done.")           else                     my afficheLeMessage("Traitement terminé.")           end if end commun --===== on nettoie() (* pour ne pas stocker dans le fichier script • So it will not be stored in the script file *)           set dossierDeStockage to ""           set dossierParDefaut to ""           set rapport to ""             set localExport to ""           set newExt to ""           set newType to ""           set isOs4 to missing value           set isOs5 to missing value           set theMenu to missing value           set menuExport to missing value           set theButton to missing value           set msg1 to ""           set msg90 to ""           set msg91 to ""           set msg92 to ""           --           set msg94 to ""           set msg96 to ""           set msg99 to " " end nettoie --=====  on afficheLeMessage(m)           beep 1           tell application (path to frontmost application as string)                     activate                     if my parleAnglais() then                               display dialog m buttons {" OK "} default button 1 giving up after 10                     else                               display dialog m buttons {" Vu "} default button 1 giving up after 10                     end if           end tell end afficheLeMessage --===== on creeDossierDeStockage(Nom) (* S'il n'existe pas, construit un dossier destination sur le bureau ou dans "~/Documents" • If does not exist, create a destination folder on the desktop or in "~/Documents" *)           local dd, dds           if storeOnDesktop is true then                     set dd to path to desktop as Unicode text           else                     set dd to path to documents folder as Unicode text           end if             if Nom ends with ":" then                     set dds to dd & Nom           else                     set dds to dd & Nom & ":"           end if           (* dossierDeStockage n'existe pas, on le crée • dossierDeStockage is not available, build it *)           tell application "System Events" to if not (exists item dds) then make new folder at end of folder dd with properties {name:Nom}           return dds as Unicode text end creeDossierDeStockage --===== on exploreTraite(elem, ptree) (* elem est un alias • elem is an alias *)           local elem_, cl_, type_Id           set elem_ to elem as Unicode text           tell application "System Events" to tell disk item elem_                     set cl_ to class                     if cl_ is folder then                               set type_Id to ""                     else                               set type_Id to type identifier                     end if           end tell --  "System Events"           set cl_ to cl_ as Unicode text             if type_Id is in {"com.apple.iwork.pages.pages", "com.apple.iwork.pages.sffpages"} then (* C'est un fichier Pages. • It's a Pages document *)                     my TraiteUnDocument(elem_)           else if cl_ is in {"file package", "«class cpkg»"} then                     set rapport to rapport & msg91 & elem_ & return (* "Package", Attention, un package EST un dossier "spécial". • Caution, a package IS a "special" folder. *)           else if cl_ is in {"folder", "«class cfol»"} then                     my ExploreUnDossier(elem_, ptree)           else                     set rapport to rapport & msg92 & elem_ & return (*  "Pas un document Pages". • "Not a Pages's document" *)           end if -- typeId_ is … end exploreTraite --===== on ExploreUnDossier(dossier, ptree)           local nomElement, cheminElement, c           repeat with nomElement in list folder dossier without invisibles                     set cheminElement to dossier & nomElement                     tell application "System Events" to set c to name of (dossier as alias)                     my exploreTraite(cheminElement as alias, ptree & c & ":")           end repeat end ExploreUnDossier --===== on TraiteUnDocument(leCheminOriginal_UniText)           my export2Doc(leCheminOriginal_UniText as alias, leCheminOriginal_UniText) end TraiteUnDocument --===== on export2Doc(p, leCheminOriginal_UniText) (* • here p is the path as alias *)           local flag, nom_de_p, nouveauChemin, w, bof, x, p_xport           try                     tell application theApp                               open p                               set flag to false                               repeat 300 times (* Attends que le fichier soit réellement ouvert. • Wait until the file is really open *)                                         if my getNbWindows() > 0 then                                                   set flag to true                                                   exit repeat                                         end if                               end repeat                     end tell -- to theApp                     if flag is false then error number 8888 (* Le fichier n'a pu être ouvert. • The file can't be open. *)           on error MsgErr number NroErr                     if NroErr = 8888 then                               set rapport to rapport & msg94 & leCheminOriginal_UniText & return                     else                               set rapport to rapport & "### " & MsgErr & " ### " & errNbr & return                     end if                     return (* can't do the remaining tasks *)           end try             tell application "System Events" to tell file leCheminOriginal_UniText                     set nom_de_p to name           end tell -- System Events             if nom_de_p ends with theExt then set nom_de_p to text 1 thru -(2 + (length of theExt)) of nom_de_p           set nouveauChemin to dossierParDefaut & nom_de_p & "." & newExt           --log nouveauChemin           tell application "System Events" to if exists (file nouveauChemin) then set name of file nouveauChemin to nom_de_p & my horoDateur(modification date of file nouveauChemin) & "." & newExt (* name stamped *)           try                     set {w, bof} to my getFrontWindow()                       tell application "System Events" to tell application process theApp                               click menu item menuExport of menu 1 of menu bar item theMenu of menu bar 1 (* Exporter… *)                               repeat until exists sheet 1 of window w                                         delay 0.1                               end repeat                               tell sheet 1 of window w (* sheet containing the buttons PDF, Word, RTF, Standard *)                                         --          get properties of UI elements of radio group 1                                         if isOs4 then                                                   click button theButton of radio group 1                                         else if isOs5 then                                                   click checkbox theButton of radio group 1                                         else                                                   click radio button theButton of radio group 1 (* I hope that they will no longer change it *)                                         end if -- isOs4 is true                                         (*                                         if typeNum is 2 then                                                   delay 0.2                                                   tell pop up button 1                                                             click                                                             click menu item quality of menu 1                                                   end tell                                                   delay 0.2                                         end if                                         *)                                         click button 1 (* Suivant… *)                                         repeat until exists button localExport                                                   delay 0.1                                         end repeat                                         click button localExport (* Exporter… *)                               end tell -- to sheet…                                 repeat 20 times                                         if exists sheet 1 of window w then                                                   click button 2 of sheet 1 of window w (* "Ne pas consulter " dans éventuel rapport d'anomalies • "Don't review" in sheet reporting possible export anomalies *)                                                   exit repeat                                         end if                                         delay 0.1                               end repeat                     end tell -- to process … System Events                       if dossierDeStockage is not dossierParDefaut then (* we must move the file from folder dossierParDefaut to folder dossierDeStockage *)                                 set p_xport to dossierDeStockage & nom_de_p & "." & newExt                                 tell application "System Events" to if exists (file p_xport) then set name of file p_xport to nom_de_p & my horoDateur(modification date of file p_xport) & "." & newExt                               tell application "Finder" to duplicate file nouveauChemin to folder dossierDeStockage (*                               • before 10.5, System Events is unable to move *)                                 my wait4File(p_xport)                                 tell application "System Events" to if exists file nouveauChemin then delete file nouveauChemin                     end if -- dossierDeStockage is not…                     my ferme1fenetre()             on error errMsg number errNbr                     set rapport to rapport & msg96 & p & return & errMsg & " ### " & errNbr & return           end try end export2Doc (* ===== • Build a stamp from the modification date_time *) on horoDateur(dt)           local annee, mois, jour, lHeure, lesSecondes, lesMinutes           set annee to year of dt           set mois to month of dt as number (* existe depuis 10.4 *)           set jour to day of dt           set lHeure to time of dt           set lesSecondes to (lHeure mod 60)           set lHeure to round (lHeure div 60)           set lesMinutes to (lHeure mod 60)           set lHeure to round (lHeure div 60)           return "_" & annee & text -2 thru -1 of ("00" & mois) & text -2 thru -1 of ("00" & jour) & "-" & text -2 thru -1 of ("00" & lHeure) & text -2 thru -1 of ("00" & lesMinutes) & text -2 thru -1 of ("00" & lesSecondes) (* • Here, the stamp is  "_YYYYMMDD-hhmmss" *) end horoDateur (* ===== • Take care, the front window may be an Inspector or a dialog one. *) on getFrontWindow()           local namesOfWindows, w, flag           tell application theApp to activate           set flag to false           tell application "System Events" to tell application process theApp                     set namesOfWindows to name of every window                     repeat with w in namesOfWindows                               if subrole of (get properties of window w) is "AXStandardWindow" then                                         set flag to true                                         exit repeat                               end if                     end repeat           end tell           return {w, flag} (* • w is the name of the front document's window *) end getFrontWindow (* ===== • Wait that the file is completely written on disk *) on wait4File(p) (* • p must be Unicode text *)           local oldSize, nnn, newSize           set oldSize to 0           tell application "System Events" to set nnn to name of file p             repeat                     try                               tell application "System Events" to set newSize to physical size of file p                               if oldSize < newSize then                                         set oldSize to newSize                               else                                         exit repeat                               end if                     end try           end repeat end wait4File --===== on activateTheApp()           local bof, status           tell application theApp to activate           if my getStartingStatus() is false then tell application "System Events" to tell application process theApp to keystroke return           repeat                     set {bof, status} to my getFrontWindow()                     if status is true then exit repeat           end repeat end activateTheApp (* ===== • Close existing open windows *) on fermeFenetres()           repeat while my getNbWindows() > 0                     my ferme1fenetre()           end repeat (* • Now there is no open window *) end fermeFenetres --===== on ferme1fenetre()           tell application theApp to activate           tell application "System Events" to tell application process theApp to keystroke "w" using {command down} end ferme1fenetre --===== on getPlistValue(valName, default)           local thePlist, u           set thePlist to (path to preferences folder as Unicode text) & "com.apple.iWork." & theApp & ".plist"           tell application "System Events"                     if exists file thePlist then                               tell contents of property list file thePlist                                         try                                                   set u to (value of property list item valName) (* Unicode Text *)                                         on error (* On est là si Pages n'a rien enregistré avec des préférences neuves • Here if Pages never saved with the new preferences file. *)                                                   set u to default                                         end try                               end tell -- to contents of…                     else (* On est là s'il n'y a pas de fichier de préférences • Here if there is no preferences file. *)                               set u to default                     end if           end tell -- to system events           return u end getPlistValue --===== on getStartingStatus()           return my getPlistValue("LSDefaultsUseDefaultStartingPoint", false) end getStartingStatus --===== on getDefaultExport()           local u           (* son of a *****, I forgot that they don't use the same name !! *)           if theApp contains "Pages" then                     set u to my getPlistValue("SLDocumentDefaultExportDirectory", "~/Documents")           else if theApp contains "Numbers" then                     set u to my getPlistValue("LSDocumentDefaultExportDirectory", "~/Documents")           else                     error "I didn't coded a Keynote version !"           end if             set u to (POSIX file (do shell script "echo " & u)) as text           if u ends with ":" then                     return u           else                     return (u & ":")           end if end getDefaultExport --===== on getNbWindows()           tell application "System Events" to tell application process theApp to return count of windows end getNbWindows --===== on getLocale(a, x)           tell application a to return localized string x end getLocale --===== on getVersion()           try                     tell application theApp to return version           on error                     return "1"           end try end getVersion --===== on parleAnglais()           local z           try                     tell application theApp to set z to localized string "Cancel"           on error                     set z to "Cancel"           end try           return (z is not "Annuler") end parleAnglais --===== on prepareMessages()           if my parleAnglais() then                     set msg1 to "Don’t click when the script is running." & return & "Except, of course, if it ask for."                     set msg90 to "No problem during the export process."                     set msg91 to "Package"                     set msg92 to "Not a " & theApp & "’s document"                     --                     set msg94 to theApp & " can’t read it"                     set msg96 to "Not copied."                     set msg99 to "Oops"           else                     set msg1 to "Éviter de cliquer durant l’exécution du script" & return & "sauf s’il le demande."                     set msg90 to "Exportation réussie sans incident."                     set msg91 to "Package"                     set msg92 to "Pas un document " & theApp                     --                     set msg94 to theApp & " n’a pas pu le lire"                     set msg96 to "Pas copié."                     set msg99 to " Vu "           end if           set msg91 to "### " & msg91 & " ###  "           set msg92 to "### " & msg92 & " ###  "           --           set msg94 to "### " & msg94 & " ###  "           set msg96 to "### " & msg96 & " ###  " end prepareMessages --===== --[/SCRIPT]

    Try this app: http://tyorex.com/iWorkConverter
    Batch convert Pages files to doc and pdf.

  • How can you convert a pages file to a PDF?

    I am trying to convert my pages file to a PDF or word document to turn it into a teacher's website so she can check for plagerism.  I have tried changing it and pressing the export button, but I can't ever find it in documents or files after that.

    What does it say for "Where" when you do Export > Word?

  • How do I convert a Pages file (a form) into another programme like Word or InDesign? I do not have Pages

    how do I convert a Pages file (a form) into another programme like Word or InDesign? I do not have Pages

    In OS X Pages '09 v4.3, do not be tempted to File > Save... copy as Word document. Instead, you want to export (or Share as Mail), both the PDF and the Word Documents.
    If you choose Share > Send as Mail > PDF (and/or Word), make sure that in Apple Mail, that your composition window has Send Windows-Friendly Attachments selected. You can enable this from the paper-clip icon on the Mail composition window toolbar.

  • Why is one TIFF pixelated when saving .pages file as .doc?

    Hi, when I save my Pages file as Word '.doc' format (using the standard 'save copy as' method, OR exporting as .doc) one of the high resolution TIFFs in the file always shows up pixelated, the other is sharp.
    Do you know why one TIFF would be pixelated, and how to get them both showing sharp after saving the file as a Word .doc?
    Both TIFFs are 300dpi CMYK, but are different sizes (the sharp one is smaller).
    Thanks!

    when I save my Pages file as Word '.doc' format (using the standard 'save copy as' method, OR exporting as .doc) one of the high resolution TIFFs in the file ... Both TIFFs are 300dpi CMYK, but are different sizes
    The thing is that .DOC is the file format for versions of Microsoft Word which were developed to work with the Windows GDI Graphics Device Interface, the counterpart of QuickDraw in Mac OS 9.2 and lower.
    Neither GDI nor QuickDraw are capable of colourant formats other than RGB. There are tried and true ways around this in prepress,
    1. do not pick TIFF, JPEG, PICT or BMP file formats that are processed by GDI and QuickDraw, but pick a file format that is not processed by GDI and QuickDraw (EPS, PDF).
    2. pick a colour managed path through GDI and QuickDraw so that CMYK tagged with a source ICC colour space is converted into some form of colour managed RGB which in turn can be converted back into some form of colour managed CMYK for whatever printing condition is to be chosen (whether by a third party driver installed in the OS or by other means).
    There are other possibilities, as Peter mentioned, but transparency isn't supported in GDI and DOC any more than CMYK is supported. And to go back to the beginning, why in the world are you trying to work in CMYK when you in all likelihood have no knowledge of the ink limit, graybalance and paper for the intended printing condition? You should be working in ICC colour managed RGB.
    /hh

  • I changed pages file to .doc

    and now all i can access is a .jpg of the file. is everything else lost?
    ack! help!
    I am new to Pages and obviously have a lot to learn

    Changing the extension - the part after the period ( . )  - does _nothing_ to the file itself.  If you want to make a pages file into a .doc file,do this: 
    Open Pages, export it (Menu>Export> choose Word doc) as a Word doc.  Since the file name is different, you can save it in the same folder as the original, with the same name, and all will be well.
    Extensions are an _indicator_ of the file structure - the metadata & organization of the 0's and 1's of the file content.  "Metadata" - the information about the app that made the file, release # of the app, and other information that the machine needs to have, but you didn't put into it directly.
    IN some computers (old Windows machines for one group), the extension told the machine what app was used.  Macs went directly to the metadata, so extensions were not needed.  Which is why Mac apps can use any old extension they like - ".pages"  ".ezdraw" ".numbers" and the like.
    So don't bother changing the extension - it's only a visible (to you) indicator, not the real change.

  • When converting my pages file to epub, I get an "unknown fault". The file is 2.99GB with movies imbedded. What to do??

    I have been able to vonvert the pages file to epub prior to embedding the movies. They are all text bound and in .mov format.

    So you have tried removing/trashing your iPod's photo cache? See here for more information on where to find this file.
    iTunes: Understanding the iPod Photo Cache folder
    B-rock

  • I converted by PDF files to Doc files.  How can I download them to my desktop?

    I need to update the .doc files.  How can I download them to my desktop?  It should be simple  but I can't figure it out.

    HI DaiseyBabii,
    Sign in to cloud.acrobat.com with your Adobe ID and password.
    Click the Files tab, and you'll see a list of all the files you've converted.
    Click the file that you want to download, and then click Download in the upper-right corner.
    Let us know if that doesn't do the trick.
    Best,
    Sara

  • How do I convert a .pages file to a  .word file that is not "too small" to open?

    I create a newsletter, make a copy for the printer as .pdf and another as .doc for a web site manager.The .doc I have been told cannot be opened and is listed as quit small. I have no idea if .doc is being "zipped"  when I prepare to send, which the receiver claims is the problem. Help please and thanks.

    In OS X Pages '09 v4.3, do not be tempted to File > Save... copy as Word document. Instead, you want to export (or Share as Mail), both the PDF and the Word Documents.
    If you choose Share > Send as Mail > PDF (and/or Word), make sure that in Apple Mail, that your composition window has Send Windows-Friendly Attachments selected. You can enable this from the paper-clip icon on the Mail composition window toolbar.

  • How do I convert a .rtf file to .doc

    I'm using TextEdit and I need to send my resumé in .doc format.
    Is there any way I can convert it?

    www.zamzar.com/
    www.online-convert.com/
    www.freefileconvert.com/
    www.cometdocs.com/

  • Convert/join multiple file formats (doc, pdf, text) into 1 single PDF/A using web services

    We would like to purchase LiveCycle for the PDF Generator feature, but we want to know if it will meet our technical requirements.
    We would like to convert a PDF, an HTML, a DOCX, and some custom text into 1 single PDF/A. Basically: joining 3 different files types and some text into 1 very long PDF/A file. Can we do this type of join?
    Also, we would like to install LiveCycle on a central server and then call a web service or use an API where we can input the 3 different files and the text and as output we would get 1 PDF/A back. Obviously there might be intermediary steps, but in essence we need to be able to do this conversion from our custom code by calling some LiveCycle API.
    Thanks!

    You can use Assembler service with PDFGenerator. There is support for Web Service endpoints(SOAP). Please go through this for details : http://help.adobe.com/en_US/livecycle/11.0/Overview/lc_overview_ds.pdf
    Thanks,
    Wasil

  • Converting corrupted pages file to PDF - URGENT :c

    Ive got a very important work file i need to either be de-corrupted or have the PDF file pulled out (as I've heard some people can do).
    It has at least 100-200 hours of work in and I just don't think I can go on with my work course without it, ill have to redo a whole year.
    If there is anyone who can help me, Ill get you a link for the file in question.
    cheers

    It it is a Pages '09 package format file — you can use the Finder to right-click on this document, choose Show Package Contents, and then navigate down into its QuickLook directory. There, the Preview.pdf document can be copied elsewhere, or simply opened in Preview for subsequent copy/paste into a new Pages document.
    If it is the default Pages '09 single format file ( a compressed and zipped Pages package format file) then the following Terminal command sequence will get you access to the Preview.pdf document inside the archive, and write it into the current directory location as Preview.pdf. You can subsequently access and process it as you did with Preview in the first paragraph.
    unzip -j filename.pages QuickLook/Preview.pdf
    If your document is a Pages v5 (any version variation), there is no PDF stored inside the document, and the preview.jpg is only the very first page. All of the document content is in *.iwa files that only Pages v5 knows how to open. I suspect that they are at minimum compressed, and probably seeded with an encryption key that only Pages knows about. At any rate, there is no way to recover your document from them.

  • I cant convert my pages into word docs

    Help, none of my pages documents will convert to word docs

    What are you doing to convert them?
    Any error messages?
    Open Console, select All Messages, and try to convert again. Post any messages related to Pages that appear when you try.

  • Pages in iCloud cannot edit a converted MS Word to Pages file

    For our monitoring program we use some MS Word documents converted to Pages. Using the local Pages app these converted to Pages file works perfectly on our Mac. Life is good.
    What we cannot do is edit with the Safari iCloud Pages. It appears these forms were created using MS Word Tables. Yes it opens, but the body of the form is a table, wherein the entire table border is highlighted in blue thus we cannot edit the table as we can using the local Pages.
    Other than recreating this and other forms is there something we can do? We want others to be able to fill in these forms from within iCloud Pages in their browser.
    MBP, Mavericks.
    Cordially,
    RicD

    The following is from an older post:
    You can do this from icloud.com  (using a web browser on a Mac or PC). iCloud.com will give you the choice to download a Pages document as a Pages, PDF or Word document.
    Please read Apple's Support document titled iCloud: Get documents stored on icloud.com.
    HOWEVER, while I can download a word file on icloud as a word file, one of my Pages files can only come back as a Pages file.  Perhaps the advice above is no longer appropriate given the changes on iCloud.

  • Pages file on a Windows PC (crap)

    Hi Everyone--
    Here's my situation. I have a Mini at home which I adore and use for pretty much everything. I am out of town this weekend and I am traveling with my office ThinkPad.
    I had saved a file that I've been working on (in Pages) to a usb drive and forgotten completely to convert it to something PC-friendly. Unfortunately, I really need to find a way to open this file today, or get started recreating it.
    Is there any way to convert a pages file to something that a PC can read USING a PC? Or else is there a viewer that I could use to open it? It isn't critical that I be able to edit it, I just need to be able to read over the information.
    Any advice would be very much appreciated!! Thanks in advance!!
    -KET
    Intel Core Duo Mini   Mac OS X (10.4.8)  

    There's no way to get formatted text out of a Pages document without using Pages. There's also no easy way to get the unformatted text out of a Pages document, although that is at least in principle doable.
    To access the text, you need to open the document "package", the collection of files that make up the document, and find the "index.xml.gz" file. This is the XML file that contains the text and formatting information, compressed in .gz format. You should be able to uncompress it using most ZIP uncompressors. Once uncompressed, it is now just an XML text file, which means that your raw text is now readable, but it is embedded in all the XML tags. You should be able to open the XML file up in any text editor, and the document text will be towards the bottom of the file.
    Alternatively, you can try opening the file in a web browser -- depending on how it parses tags, it will either ignore them completely, and only show you text (which is what Safari does), or it will display the tags as if they were text, but in a formatted fashion which is easier to read than in a text editor (what Internet Explorer on the Mac does). Either way, you can dig the text out, but it ain't pretty.

Maybe you are looking for

  • Any way to keep track of which pages use templates in dreamweaver?

    So this site I am working on uses a template for most of the html pages but not all of them. A few of them have been detached from the template and will remain detached since they are not the same as the others. The only way I can see to check which

  • Need Help Recording Programs from my DVR to my VCR

    Can someone please tell to reocrd a program from DVR to my VCR without getting  all snow Here is my set up  TV- Sony VCR/DVD- Sony  SLV-D300P DVR- QIP7200

  • Urgent How to connect sql plus from spx network

    My lsnrctrl is giving error show below Starting tnslsnr: please wait... TNSLSNR for 32-bit Windows: Version 2.3.2.1.0 - Production System parameter file is D:\ORAWIN95\network\admin\listener.ora Log messages written to D:\ORAWIN95\network\log\listene

  • How to view the messages stored in my memory card

    hey.. i have just bought the c6-01..and my prev memory card has my messages which are imp ..is there a way frm which i can view those messages  thank u

  • Re-linking SmoothCam clips???

    Many SmoothCam clips in this film.  All have been analyzed.  Everything looking good.  Then I open FCP this morning and ALL the SmoothCam clips now say 'un-analyzed' ... a yellow bar over top. Where might be analyzed files be found, and is there a wa