Dienst: pages nach doc konvertieren

msg

msg

Aktives Mitglied
Thread Starter
Dabei seit
31.07.2005
Beiträge
1.975
Reaktionspunkte
32
hallo Leute,

ich benötige bitte eure Hilfe für die Erstellung eines Dienstes, der in jedem Ordner unter dem Dienste-Punkt aufscheinen soll: nämlich ein Skript, das ein Pages- in ein Word.doc umwandeln soll.
(ich habe eine umfangreiche Sammlung an pages-Dokumenten, die in verschiedenen Hyrarchien meines Dateisystems liegen, die ich mit schnellem Rechtsklick-Klick in das universellere .doc konvertieren will.)

Ein Skript, das ich im www gefunden habe, das eigentlich diese Aufgabe erfüllt, scheint aber nicht als Dienst verwendet werden zu können.

--{code}
(*
Grabs the path of the Pages document.
Yes, to save as .doc, the document must be already saved as .pages
*)
tell application "Pages"
set chemin_pages to path of document 1
end tell
(*
Grabs the document's name and the path to the folder where it is stored
*)
tell application "System Events" to tell disk item chemin_pages
set nom_pages to name
set le_dossier to path of container
end tell
(*
builds the name of the .doc file to create
*)
if nom_pages ends with ".pages" then
set nom_doc to text 1 thru -7 of nom_pages & ".doc"
else
set nom_doc to nom_pages & ".doc"
end if
(*
Create the .doc file
*)
tell application "System Events"
if not (exists (disk item nom_doc of folder le_dossier)) then make new file at end of folder le_dossier with properties {name:nom_doc}
end tell
(*
take care to coerce it as alias
*)
set chemin_doc to (le_dossier & nom_doc) as alias
(*
Now we may save it.
CAUTION, Pages no longer use the old ID "SLDocumentTypeMSWord"
it uses "Microsoft Word 97 - 2004 document"
*)
tell application "Pages"
save document nom_pages as "Microsoft Word 97 - 2004 document" in chemin_doc
end tell
--{code}

Kann mir bitte jemand helfen, das Skript so umzuändern, dass ich es als Dienst einrichten kann? Das wäre sehr toll, danke!

GLG
msg
 
hat da jemand eine Idee?
 
Einen Dienst kannst du mit dem Automator erstellen. Probier's mal so:

attachment.php


Code:
[COLOR=#000000][FONT=Verdana][B]on[/B] [/FONT][/COLOR][COLOR=#0433FF][FONT=Verdana][B]run[/B][/FONT][/COLOR][COLOR=#000000][FONT=Verdana] {[/FONT][/COLOR][COLOR=#4F8F00][FONT=Verdana]input[/FONT][/COLOR][COLOR=#000000][FONT=Verdana], [/FONT][/COLOR][COLOR=#4F8F00][FONT=Verdana]parameters[/FONT][/COLOR][COLOR=#000000][FONT=Verdana]}[/FONT][/COLOR][FONT=Verdana]    
[/FONT]
[FONT=Verdana]    [B]repeat[/B] [B]with[/B] [COLOR=#4f8f00]anItem[/COLOR] [B]in[/B] [COLOR=#4f8f00]input[/COLOR][/FONT]
[FONT=Verdana]        [B]set[/B] [COLOR=#4f8f00]theDoc[/COLOR] [B]to[/B] [COLOR=#0433ff][I]items[/I][/COLOR] 1 [B]thru[/B] -7 [B]of[/B] ([COLOR=#4f8f00]anItem[/COLOR] [B]as[/B] [COLOR=#0433ff][I]text[/I][/COLOR]) & ".doc" [B]as[/B] [COLOR=#0433ff][I]text[/I][/COLOR][/FONT]
[FONT=Verdana]        [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Pages"[/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]            [/COLOR][COLOR=#0433ff][B]open [/B][/COLOR]anItem[/FONT][/COLOR]
[FONT=Verdana]            [COLOR=#0433ff][B]save[/B][/COLOR] [COLOR=#0433ff][I]document[/I][/COLOR] 1 [COLOR=#0433ff]as[/COLOR] "Microsoft Word 97 - 2004 document" [COLOR=#0433ff]in[/COLOR] [COLOR=#4f8f00]theDoc[/COLOR][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]close [/B][I]document[/I][COLOR=#000000] 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]        [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]    [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana]    [/FONT]
[B]end [/B][COLOR=#0433FF][FONT=Verdana][B]run[/B][/FONT][/COLOR]
 

Anhänge

  • Bildschirmfoto 2013-04-15 um 11.41.58.png
    Bildschirmfoto 2013-04-15 um 11.41.58.png
    64,8 KB · Aufrufe: 207
  • Gefällt mir
Reaktionen: msg
vielen lieben dank, das funktioniert ja prima!
 
Zurück
Oben Unten