Dokument aus dem Dienstmenue erstellen

RD11

Aktives Mitglied
Thread Starter
Dabei seit
03.08.2006
Beiträge
1.119
Reaktionspunkte
811
Hallo zusammen,

ich suche eine Möglichkeit ähnlich wie bei Windows mit einem Rechtsklick eine Aktion in einem Ordner "Neues (Word) Dokument erstellen" auszulösen. Das sollte über Dienste gehen.
Einige Versuche mit dem Automator gingen schief. Ich bekomme zwar Word mit einem neuen Dokument geöffnet, muss dann aber beim Speichern immer noch selbst entscheiden, wo es hin soll.
Ich arbeite unter 10.8.x mit Office 2011.

Der Ablauf sollte so sein:
- Ordner im Finder markieren
- Aus "Dienste" eine aktion "neues Word Dokument" auswählen
- Beim Speichern sollte Word dann den vorher ausgewählten Ordner kennen und das Dokument dort ablegen.

Vielleicht bin ich ja auch einfach zu blöd. Kann ja sein.

Danke schon mal,
Reinhold
 
Hi, das geht am Besten mit AppleScript. Versuch das mal:

attachment.php


Bildschirmfoto 2013-04-16 um 13.54.42.jpg

Code:
[B]property [/B][COLOR=#4F8F00][FONT=Verdana]theName[/FONT][/COLOR][FONT=Verdana] : "Neues Dokument"
[/FONT][FONT=Verdana][B]property[/B] [COLOR=#4f8f00]theExtension[/COLOR] : ".docx"[/FONT]
[FONT=Verdana]
[/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000][B]on[/B] [/COLOR][COLOR=#0433ff][B]run[/B][/COLOR][COLOR=#000000] {[/COLOR]input[COLOR=#000000], [/COLOR]parameters[COLOR=#000000]}[/COLOR][/FONT][/COLOR]
[FONT=Verdana]    [B]set[/B] [COLOR=#4f8f00]theCount[/COLOR] [B]to[/B] ""[/FONT]
[FONT=Verdana]    [B]set[/B] [COLOR=#4f8f00]theSpace[/COLOR] [B]to[/B] ""[/FONT]
[FONT=Verdana]    [B]repeat[/B] [B]with[/B] [COLOR=#4f8f00]anFolder[/COLOR] [B]in[/B] [COLOR=#4f8f00]input[/COLOR][/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]        [B]repeat[/B] [B]until[/B] [B]not[/B] ([/COLOR][COLOR=#0433ff][B]exists [/B][/COLOR][COLOR=#0433ff][I]file[/I][/COLOR][COLOR=#000000] ([/COLOR]theName[COLOR=#000000] & [/COLOR]theSpace[COLOR=#000000] & [/COLOR]theCount[COLOR=#000000] & [/COLOR]theExtension[COLOR=#000000]) [B]of[/B] [/COLOR]anFolder[COLOR=#000000])[/COLOR][/FONT][/COLOR]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]            [B]set[/B] [/COLOR]theCount[COLOR=#000000] [B]to[/B] [/COLOR]theCount[COLOR=#000000] + 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]            [B]set[/B] [COLOR=#4f8f00]theSpace[/COLOR] [B]to[/B] " "[/FONT]
[FONT=Verdana]        [B]end[/B] [B]repeat[/B][/FONT]
[FONT=Verdana]        [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Finder"[/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]            [B]set[/B] [/COLOR]theFile[COLOR=#000000] [B]to[/B] ([/COLOR][COLOR=#0433ff][B]make [/B][/COLOR][COLOR=#0433ff]new [/COLOR][COLOR=#0433ff][I]file [/I][/COLOR][COLOR=#0433ff]at [/COLOR][COLOR=#812fdc]desktop [/COLOR][COLOR=#0433ff]with properties[/COLOR][COLOR=#000000] {[/COLOR][COLOR=#812fdc]name[/COLOR][COLOR=#000000]:[/COLOR]theName[COLOR=#000000] & [/COLOR]theSpace[COLOR=#000000] & [/COLOR]theCount[COLOR=#000000] & [/COLOR]theExtension[COLOR=#000000]})[/COLOR][/FONT][/COLOR]
[FONT=Verdana]        [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]        [B]set[/B] [COLOR=#4f8f00]theCount[/COLOR] [B]to[/B] ""[/FONT]
[FONT=Verdana]        [B]set[/B] [COLOR=#4f8f00]theSpace[/COLOR] [B]to[/B] ""[/FONT]
[FONT=Verdana]        [B]return[/B] [COLOR=#4f8f00]theFile[/COLOR][/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]
 
Hallo,

danke schon mal für eure Antworten. Bin noch bei der Arbeit und probiere es heute Abend mal aus.

Gruss,
Reinhold
 
Hallo,
das würde schon mit dem Automator allein gehen ... zumindest fast so, wie du dir das gedacht hast.
Man könnte ein Dokument in dem ausgewählten Ordner erstellen und vorerst unter einem beliebigen Namen speichern (*)
Sehr ähnlich, wie in dem geposteten Skript.

(*) der Ablauf wäre
-Wert der Variablen festlegen ("Speicher")
-Neues Word-Dokument erstellen
-Word-Dokument speichern (unter Dateiname "xyz" Ort: hierher die Variable "Speicher" hineinziehen)

Das ist aber eben nicht genau das, was du erfragt hast.

Ohne zu wissen, wie dein Word beim Start eingestellt ist:

Dienst empfängt Ordner in Finder
Aktion AppleScript

on run {input, parameters}
tell application "Microsoft Word"
activate
--create new document new document type new blank document
set default file path file path type documents path path input as string
end tell
end run


Die -- im Skript deaktivieren die nachfolgende Zeile, welche ein neues leeres Dokument erstellt.
Bei Bedarf die -- entfernen.

Gruß
 
Hallo Varuna,

das klappt. so habe ich mir das vorgestellt.
Muss noch ein paar Einstellung beim Start von word anpassen, aber der Pfad stimmt.
Jetzt fühle ich mich wohl.

Eigentlich könnte das als Standard mitkommen. Ich fand es immer nervig, erst ein Dokument anzulegen und dann erst festzulegen, wo es hin soll.

Aber das "set default file path file path type documents path path input as string" muss ich mir erst mal auseinanderdröseln ;-)

Danke schön!
Reinhold
 
Zurück
Oben Unten