在 Google 簡報中顯示進度列
程式設計程度:中級
時間長度:15 分鐘
專案類型:編輯器外掛程式
目標
- 瞭解解決方案的功能。
- 瞭解 Apps Script 服務在解決方案中的作用。
- 設定指令碼。
- 執行指令碼。
認識這項解決方案
使用這個解決方案,即可在簡報的投影片底部新增進度列。

運作方式
腳本會計算簡報中的投影片數,並在每張投影片的底部新增矩形形狀。這個指令碼會增加每個矩形形狀的寬度,以便在簡報中顯示進度。
Apps Script 服務
本解決方案會使用下列服務:
- 簡報服務:取得簡報的投影片,並為每張投影片新增矩形形狀。
必要條件
如要使用這個範例,您必須具備下列先決條件:
- Google 帳戶 (Google Workspace 帳戶可能需要管理員核准)。
- 可連上網際網路的網路瀏覽器。
設定指令碼
- 點選下方按鈕,複製「進度列」幻燈片簡報。這項解決方案的 Apps Script 專案已附加至簡報。
「建立副本」
- 在簡報中,依序點選「Extensions」>「Progress bar」>「Show progress bar」。
出現提示時,請授權執行指令碼。如果 OAuth 同意畫面顯示「This app isn't verified」警告,請依序選取「Advanced」「Go to {Project Name} (unsafe)」(前往「{Project Name}」(不安全))。
再次依序點選「Extensions」>「Progress bar」>「Show progress bar」。
如要移除進度列,請依序按一下「Extensions」>「Progress bar」>「Hide progress bar」。
查看程式碼
如要查看這個解決方案的 Apps Script 程式碼,請按一下下方的「查看原始碼」:
貢獻者
這個範例是由 Google 維護,並由 Google 開發人員專家提供協助。
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-22 (世界標準時間)。
[null,null,["上次更新時間:2024-12-22 (世界標準時間)。"],[[["This Google Apps Script solution adds a progress bar to the bottom of Google Slides presentations to visually track progress through the slides."],["The script uses the Slides service to calculate the number of slides, add a rectangle shape to each slide, and dynamically adjust the rectangle's width to represent progress."],["Users can easily install the script by making a copy of the provided presentation and authorizing the script to access their Google Slides."],["The progress bar can be shown or hidden using the \"Progress bar\" menu found under \"Extensions\" in Google Slides after installation."],["Developers can review and modify the source code, which is publicly available on GitHub, for customization or further development."]]],["This solution adds a progress bar to Google Slides presentations using Apps Script. The script calculates the total slides and adds a rectangle to the bottom of each slide, increasing the rectangle's width to visually represent progress. Users copy a sample presentation, authorize the script, and then run it to create or remove the progress bars via the \"Extensions\" menu. It utilizes the Slides service to manipulate slides and shapes, adding and deleting these elements.\n"]]