problem with save a Pages document under 10.5
problem with save a Pages document under 10.5
- Subject: problem with save a Pages document under 10.5
- From: KOENIG Yvan <email@hidden>
- Date: Tue, 24 Jun 2008 21:21:57 +0200
Hello
Here is a stripped script which opens a .doc file in Pages and save
it aas Pages and as Pdf.
It works flawlessly under 10.4.11.
Under 10.5, the instruction
save front document as "com.apple.iwork.pages.pages" in
nouveauChemin0 (* Must save as .pages before exporting *)
fails with error -50
"The document cannot be saved in the "Pages document" format!"
I don't understand why and of course I don't find any workaround.
May I get some help ?
--[SCRIPT]
property theApp : "Pages"
property theExt : "pages"
property Stockage : "wasDoc_nowPdf"
property oldExt : "doc"
property newType : "SLDocumentTypePDF"
property newExt : "pdf"
tell application "System Events" to set leDocument to (choose file of
type {"com.microsoft.word.doc"}) as Unicode text
set dd to path to desktop as Unicode text
if Stockage ends with ":" then
set dossierDeStockage to dd & Stockage
else
set dossierDeStockage to dd & Stockage & ":"
end if
tell application "System Events"
if not (exists item dossierDeStockage) then make new folder at end
of folder dd with properties {name:Stockage} (*
• dossierDeStockage is not available, build it *)
end tell -- to System Events
tell application "System Events" to tell disk item leDocument
set dossierSource to (path of container) as Unicode text
set nomSource to name as Unicode text
end tell -- System Events
if nomSource ends with oldExt then set nomSource to (text 1 thru -(2
+ (length of oldExt)) of nomSource)
set nouveauChemin0 to dossierDeStockage & nomSource & "." & theExt
set nouveauChemin to dossierDeStockage & nomSource & "." & newExt
try
tell application theApp
open leDocument as alias
log "point 1"
save front document as "com.apple.iwork.pages.pages" in
nouveauChemin0 (* Must save as .pages before exporting *)
log "point 2"
save front document as newType in nouveauChemin
log "point 3"
close front document saving no (* Already saved *)
end tell -- Pages
on error MsgErr number NroErr
log MsgErr
log NroErr
end try
--[SCRIPT]
Yvan KOENIG (from FRANCE mardi 24 juin 2008 21:21:52)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden