Pages zu Word

Icetheman

Icetheman

Aktives Mitglied
Thread Starter
Dabei seit
31.08.2002
Beiträge
2.031
Reaktionspunkte
26
Hi,
ich habe 10.6.1 und versuche vergeblich mehrere 100 Pages Dokumente in Word umzuwandeln mit folgendem Script:
http://www.iworkcommunity.com/content/iwork-droplet-pack-v2
Bekomme aber immer die Meldung "Selected Document must be Pages"
Kann das mal bitte jemand testen ob das nur bei mir so ist oder ob das Script unter SchneeLeo oder Pages 09 nicht funktioniert.
Danke
 
Kann denn keiner mal testen??
 
Mayday Mayday:rolleyes:
 
Also bei mir funktioniert das Script.
 
Ich muss da nix ausprobieren um dir zu sagen was schief läuft. Wenn du das aktuelle Pages hat, dann kommt das Skript nicht mit dem Format klar.
jede Pages Version hat ihr eigenes Format. Das unterscheidet sich zwar nur im kleinen, ist aber dennoch ein Unterschied.

Das Skript ist von 08.2008… du kannst ja mal testweise ein Pages Dokument als iWork '08 Version speichern und gucken was passiert.
 
Ja mit 08 funktioniert es hier, Danke für die Antworten weiss jemand wie man das Script umschreibt damit es mit 09 funktioniert?
 
na, als erstes fällt mir auf, dass ein pages-dokument offensichtlich kein bundle mehr ist. die zeile, die den error auslöst, prüft, ob der dateiname mit ".pages:" endet, was bei einem package zutrifft. nimm an der stelle mal den doppelpunkt weg und teste, ob's läuft. ob diese anpassung reicht, ist natürlich zweifelhaft:
statt
      if (file_ as text) does not end with ".pages:" then
also
      if (file_ as text) does not end with ".pages" then
 
Hi iScript,
ich hab das mal getestet funktioniert leider nicht. Komisch das es noch kein angepasstes script gibt 09 ist doch schon eine weile auf dem markt.
 
Hallo Icetheman!

Neben der Anpassung von iScript ersetze noch
"SLDocumentTypeMSWord" durch "Microsoft Word 97 - 2004 document"


Grüße
varuna
 
Hallo varuna,
scheint nicht zu klappen wenn ich "SLDocumentTypeMSWord" durch "Microsoft Word 97 - 2004 document" einfüge und versuche zu speichern kommt die Fehlermeldung "Syntaxfehler" und wenn ich mit Word 2008 arbeite muss es dann 2008 statt 2004 heissen?
Mich wundert nur das noch niemand das Script fürs neue Pages angepasst hat.
 
heheh ja aber wie man sieht ohne Erfolg:shame:
 
Hier das Skript mit den zwei Änderungen

Code:
--(SCRIPT Pages->Word Droplet.app]
(*
You may set the script so it creates uniques time stamped names.
You may set the timestamp with or without the seconds.
*)
property theApp : "Pages"
property types : {{".doc", "Microsoft Word 97 - 2004 document"}, {".pdf", "SLDocumentTypePDF"}, {".txt", "SLDocumentTypePlainText"}, {".rtf", "SLDocumentTypeRichText"}, {".rtfd", "SLDocumentTypeRichTextBundle"}}

property withSeconds : false (*
false --> #YYYYMMDD-hhmm
true --> #YYYYMMDD-hhmmss 
*)
property uniqueName : false (*
false --> myFile.doc
true --> myFile#YYYYMMDD-hhmm.doc 
or myFile#YYYYMMDD-hhmmss.doc 
*)

--=============

on open files_
	repeat with file_ in files_
		if (file_ as text) does not end with ".pages" then
			error "Selected document must be a Pages document"
		end if
		tell application "Finder"
			set extension hidden of file_ to true
		end tell
		set {newExt, newType} to item 1 of types (* 
item 1 = doc
item 2 = pdf
item 3 = txt
item 4 = rtf
item 5 = rtfd *)
		tell application theApp
			open file_
			set thePath to path of document 1
			try
				copy thePath to thePath
			on error (* 
The document has not been saved.  Before proceeding, please save as a Pages Pages document *)
				tell application theApp
					save front document
					(*
			Saving the open document as a Pages Document is possible only in Mac OS X 10.4 or higher
			*)
					delay 0.2
					set thePath to path of document 1
				end tell -- theApp
			end try
		end tell --theApp
		tell application theApp to set theName to name of document 1
		if uniqueName then
			set newName to (text 1 thru -7 of theName) & (my horodate()) & newExt (* Insert unique ID and replace the "pages" extension by the newExt one *)
		else
			set newName to (text 1 thru -1 of theName) & newExt (* Replace the "pages" extension by the newExt one *)
		end if
		tell application "System Events" to set theCont to (path of container of disk item thePath) as Unicode text
		(* CAUTION, When saving, Pages does not backup the existing document.
It overwrites it with the new document. *)
		tell application theApp to save front document as newType in (theCont & newName) (* save as newType document *)
		tell application theApp
			tell document 1
				if not modified then
					close
				end if
			end tell
		end tell
		--tell application "Finder"
		--set extension hidden of item (newName) to true
		--end tell
	end repeat
end open

--=============

on horodate()
	if withSeconds then
		return (do shell script "date " & quote & "+%Y%m%d-%H%M%S" & quote) & "." (* period required *)
	else
		return (do shell script "date " & quote & "+%Y%m%d-%H%M" & quote) & "." (* period required *)
	end if
end horodate

--=============
--[/SCRIPT]


Zur Frage (Word 2008): Nein, es muss 2004 heißen :)

Übrigens ist das kein Rätselraten meinerseits, sondern ich habe mal nachgeschaut ;) - Siehe Screenshot
 

Anhänge

  • Bild 1.jpg
    Bild 1.jpg
    45 KB · Aufrufe: 79
  • Gefällt mir
Reaktionen: Icetheman
HI varuna,
DU BIST ECHT SPITZE:D
VIELEN VIELEN DANK FÜR DEINE MÜHEN!!:freu:
 
Hallo Icetheman und varuna!
Wie kann ich denn das Skript öffnen, um die geänderte Version von varuna einzufügen?

67Bart67
 
Hi Bart67 und Willkommen im Forum;)
Mit dem AppleScript Editor kannst Du es öffnen, der liegt in Programme>Dienstprogramme
Grüße
 
Danke für dein nettes Willkomm :). Heißt das, ich muss "Droplet" mit dem AppleScript Editor öffnen? Bart67
 
Hat funktioniert! Danke Icetheman! Nun habe ich aber eine größere Anzahl kennwortgeschützter Pages-Dokumente, die ich gerne in Word abspeichern würde. Muss ich dazu jedes einzelne erst öffnen und dann in Pages als Word-Dokument abspeichern oder kann ich auch alle zusammen auf einen Rutsch konvertieren?
Bart67
 
Wie es bei Passwort geschützten Dateien ist weiss ich nicht einfach mal testen, ungeschützte gehen auch mehrere auf einmal.:)
 
Zurück
Oben Unten