چرخه زندگی به روز رسانی ارائه
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
سه مرحله اصلی در چرخه زندگی یک شیء ارائه وجود دارد: باز کردن، ویرایش و ذخیره.
باز کردن یک ارائه
هنگام استفاده از سرویس اسلایدها، اولین قدم بارگذاری یک ارائه است. روشهایی مانند SlidesApp.openById() و SlidesApp.getActivePresentation() یک ارائه Slides موجود را بارگیری میکنند، در حالی که SlidesApp.create() یک ارائه جدید ایجاد میکند. این متدها یک شی Presentation را برمیگردانند که نمایش بارگذاری شده را نشان میدهد.
پس از باز شدن یک ارائه، هیچ به روز رسانی بیشتری از همکاران دریافت نمی کند. ارائه ها معمولاً در آخرین نسخه خود که در Drive ذخیره شده است باز می شوند. با این حال، اگر یک اسکریپت به یک ارائه محدود شده باشد، آن ارائه در همان نسخه ویرایشگر اسلایدهای همراه بارگیری می شود.
اصلاح یک ارائه
پس از باز شدن یک ارائه، یک اسکریپت می تواند آن را بخواند و تغییر دهد. هر گونه تغییری که اسکریپت در ارائه ایجاد میکند در خواندنها و اصلاحات بعدی در طول مدت اجرای اسکریپت منعکس میشود.
ذخیره تغییرات
پس از ایجاد تغییرات در یک ارائه، هنگامی که اجرای اسکریپت کامل می شود، یا زمانی که ()Presentation.saveAndClose فراخوانی می شود، تغییرات به یکباره ذخیره می شوند. پس از ذخیره تغییرات، به صورت ناهمزمان در ویرایشگر کاربر منتشر می شوند، گویی تغییرات توسط یک همکار انجام شده است.
پس از بسته شدن یک ارائه با استفاده از Presentation.saveAndClose()
، می توان آن را برای ویرایش با استفاده از یکی از روش های بارگیری ارائه باز کرد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]