Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Erstellen und führen Sie eine einfache Automatisierung aus, die ein Google Docs-Dokument erstellt und Ihnen einen Link zum Dokument per E-Mail sendet.
Ziele
Richten Sie das Skript ein.
Führen Sie das Skript aus.
Vorbereitung
Für dieses Beispiel müssen die folgenden Voraussetzungen erfüllt sein:
Ein Google-Konto (für Google Workspace-Konten ist möglicherweise die Genehmigung durch den Administrator erforderlich).
Ein Webbrowser mit Internetzugriff.
Skript einrichten
So erstellen Sie die Automatisierung:
Rufen Sie script.google.com auf, um den Apps Script-Editor zu öffnen. Wenn Sie script.google.com zum ersten Mal aufrufen, klicken Sie auf Dashboard ansehen.
Klicken Sie auf Neues Projekt.
Löschen Sie jeglichen Code im Skripteditor und fügen Sie den unten angegebenen Code ein.
/** * Creates a Google Doc and sends an email to the current user with a link to the doc. */functioncreateAndSendDocument(){try{// Create a new Google Doc named 'Hello, world!'constdoc=DocumentApp.create('Hello, world!');// Access the body of the document, then add a paragraph.doc.getBody().appendParagraph('This document was created by Google Apps Script.');// Get the URL of the document.consturl=doc.getUrl();// Get the email address of the active user - that's you.constemail=Session.getActiveUser().getEmail();// Get the name of the document to use as an email subject line.constsubject=doc.getName();// Append a new string to the "url" variable to use as an email body.constbody='Link to your doc: '+url;// Send yourself an email with a link to the document.GmailApp.sendEmail(email,subject,body);}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed with error %s',err.message);}}
Klicken Sie auf „Speichern“ .
Klicken Sie auf Unbenanntes Projekt.
Geben Sie einen Namen für das Script ein und klicken Sie auf Umbenennen.
Skript ausführen
So führen Sie das Skript aus:
Klicken Sie auf Ausführen.
Autorisieren Sie das Skript, wenn Sie dazu aufgefordert werden.
Wenn auf dem OAuth-Zustimmungsbildschirm die Warnung Diese App ist nicht verifiziert angezeigt wird, wählen Sie Erweitert>Zu {Projektname} (unsicher) aus.
Wenn die Ausführung des Skripts abgeschlossen ist, suchen Sie in Ihrem Gmail-Posteingang nach der E‑Mail.
Öffnen Sie die E‑Mail und klicken Sie auf den Link, um das von Ihnen erstellte Dokument zu öffnen.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-12 (UTC)."],[[["\u003cp\u003eThis script automates the creation of a Google Doc and emails you a link for access.\u003c/p\u003e\n"],["\u003cp\u003eYou'll need a Google Account and web browser to use this automation script.\u003c/p\u003e\n"],["\u003cp\u003eThe script involves pasting provided code into the Apps Script editor and running it after authorization.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful execution, you'll receive an email containing the link to your newly created Google Doc.\u003c/p\u003e\n"],["\u003cp\u003eExplore further options to extend functionalities with Google Docs, Sheets, and Slides or learn basic JavaScript.\u003c/p\u003e\n"]]],[],null,[]]