D
DvdH1979
Mitglied
Thread Starter
- Dabei seit
- 03.06.2020
- Beiträge
- 51
- Reaktionspunkte
- 16
Hallo zusammen,
nachdem ich mich ein wenig mit dem Automator beschäftigt habe, bekomme ich richtig Spaß daran.
Habe mir ein kleines Script gebastelt, das mit Klick auf einen Ordner als Schnellaktion neue Office-Dokumente anlegen soll.
Excel und Word funktionieren wie gewünscht, aber PowerPoint will einfach nicht den Dateinamen übernehmen, den ich angebe - es wird einfach "Präsentation1" usw. genannt.
Hier das Script:
PowerPoint scheint eine extra Behandlung zu brauchen bzgl. Speichern, damit es mit dem Namen funktioniert, aber welche?
Danke schon einmal für jeden Tipp!
nachdem ich mich ein wenig mit dem Automator beschäftigt habe, bekomme ich richtig Spaß daran.
Habe mir ein kleines Script gebastelt, das mit Klick auf einen Ordner als Schnellaktion neue Office-Dokumente anlegen soll.
Excel und Word funktionieren wie gewünscht, aber PowerPoint will einfach nicht den Dateinamen übernehmen, den ich angebe - es wird einfach "Präsentation1" usw. genannt.
Hier das Script:
AppleScript:
on run {input, parameters}
---- Office-Applikation auswählen
set applicationList to {"Excel", "Word", "PowerPoint"}
activate
choose from list applicationList with prompt "Applikation auswählen" default items "Word"
set applicationChoice to result as text
set docbasename to text returned of (display dialog "Dateiname:" default answer "")
set folderPath to POSIX path of input
---- Dateiname abhängig von gewählter Applikation setzen
if applicationChoice = "Excel" then set savePath to (folderPath & docbasename & ".xlsx") as string
if applicationChoice = "Word" then set savePath to (folderPath & docbasename & ".docx") as string
if applicationChoice = "PowerPoint" then set savePath to (folderPath & docbasename & ".pptx") as string
--- neues Dokument in Abhängigkeit von gewählter Applikation erzeugen
if applicationChoice = "Excel" then
tell application "Microsoft Excel"
activate
make new workbook
save active workbook in savePath
end tell
end if
if applicationChoice = "Word" then
tell application "Microsoft Word"
activate
make new document
save active document in savePath
end tell
end if
if applicationChoice = "PowerPoint" then
tell application "Microsoft PowerPoint"
activate
set docbasename to make new presentation
save active presentation in savePath
end tell
end if
end run
Danke schon einmal für jeden Tipp!
Zuletzt bearbeitet von einem Moderator: