מחזור החיים של עדכון מצגת
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יש שלושה שלבים עיקריים במחזור החיים של אובייקט Presentation: פתיחה, עריכה ושמירה.
פתיחת מצגת
כשמשתמשים בשירות Slides, השלב הראשון הוא טעינת מצגת. שיטות כמו SlidesApp.openById() ו-SlidesApp.getActivePresentation() טוענות מצגת קיימת ב-Slides, ואילו SlidesApp.create() יוצרת מצגת חדשה. השיטות האלה מחזירות אובייקט Presentation שמייצג את המצגת שנטענה.
אחרי שפותחים מצגת, היא לא מקבלת יותר עדכונים משותפי העריכה. בדרך כלל, המצגות נפתחות בגרסה האחרונה שלהן שנשמרה ב-Drive. עם זאת, אם סקריפט קשור למצגת, המצגת תיטען באותה גרסה של כלי העריכה הנלווה של Slides.
שינוי מצגת
אחרי שפותחים מצגת, תסריט יכול לקרוא ולשנות אותה. כל שינוי שהסקריפט מבצע במצגת משתקף בקריאות ובשינויים הבאים למשך הביצוע של הסקריפט.
שמירת השינויים מתבצעת
אחרי שמבצעים שינויים במצגת, השינויים נשמרים בבת אחת בסיום ההרצה של הסקריפט או כשקוראים ל-Presentation.saveAndClose(). אחרי שהשינויים נשמרים, הם מועברים באופן אסינכרוני לעורך של המשתמש, כאילו השינויים בוצעו על ידי שותף עריכה.
אחרי שסוגרים מצגת באמצעות Presentation.saveAndClose()
, אפשר לפתוח אותה מחדש לעריכה באמצעות אחת מהשיטות לטעינת מצגות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-31 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-31 (שעון UTC)."],[[["\u003cp\u003eThe Slides service allows you to open existing or create new Google Slides presentations for manipulation within Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eScripts can modify presentations, with changes reflected immediately within the script but saved and propagated to the editor upon script completion or explicit save.\u003c/p\u003e\n"],["\u003cp\u003eSaving changes to a presentation is done automatically at the end of script execution or manually using \u003ccode\u003ePresentation.saveAndClose()\u003c/code\u003e, after which the presentation can be reopened.\u003c/p\u003e\n"]]],[],null,["# Life cycle of a presentation update\n\nThere are three main phases in the life cycle of a\n[Presentation](/apps-script/reference/slides/presentation) object: opening,\nediting, and saving.\n\nOpening a presentation\n----------------------\n\nWhen using the Slides Service, the first step is to load a presentation. Methods\nlike [SlidesApp.openById()](/apps-script/reference/slides/slides-app#openbyidid)\nand [SlidesApp.getActivePresentation()](/apps-script/reference/slides/slides-app#getactivepresentation)\nload an existing Slides presentation, while\n[SlidesApp.create()](/apps-script/reference/slides/slides-app#createname)\ncreates a new presentation. These methods return a\n[Presentation](/apps-script/reference/slides/presentation) object that\nrepresents the loaded presentation.\n\nOnce a presentation is open, it does not receive any further updates from\ncollaborators. Presentations are usually opened at their latest version that has\nbeen saved in Drive. However, if a script is container-bound to a presentation,\nthat presentation will be loaded at the same version as the accompanying Slides\neditor.\n\nModifying a presentation\n------------------------\n\nOnce a presentation is open, a script can read and modify it. Any changes that\nthe script makes to the presentation are reflected in subsequent reads and\nmodifications for the duration of the script execution.\n\nSaving changes\n--------------\n\nAfter making changes to a presentation, the changes are saved all at once\nwhen the script execution completes, or when [Presentation.saveAndClose()](/apps-script/reference/slides/presentation#saveandclose) is\ncalled. After changes are saved, they propagate asynchronously to the\nuser's editor, as if the changes were made by a collaborator.\n\nAfter a presentation is closed using `Presentation.saveAndClose()`, it can be\nreopened for editing using one of the presentation loading methods."]]