Class EditorFileScopeActionResponseBuilder
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מסמכים מפורטים
requestFileScopeForActiveDocument()
הבקשה מתייחסת להיקף drive.file
של המסמך הפעיל הנוכחי ב-Editor.
// Display a permissions dialog to the user, requesting `drive.file` scope for
// the current document on behalf of this add-on.
CardService.newEditorFileScopeActionResponseBuilder()
.requestFileScopeForActiveDocument()
.build();
הערה: כדי לקרוא ל-method הזה, צריך להוסיף את ההיקף drive.file
למניפסט של התוסף.
חזרה
EditorFileScopeActionResponseBuilder
– האובייקט הזה, לצורך קישור.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003e\u003ccode\u003eEditorFileScopeActionResponseBuilder\u003c/code\u003e helps create responses for actions within Google Editors (Docs, Sheets, Slides).\u003c/p\u003e\n"],["\u003cp\u003eIt primarily offers two methods: \u003ccode\u003ebuild()\u003c/code\u003e to finalize the response and \u003ccode\u003erequestFileScopeForActiveDocument()\u003c/code\u003e to request necessary file access permissions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003erequestFileScopeForActiveDocument()\u003c/code\u003e specifically asks for 'drive.file' scope, enabling the add-on to interact with the user's current document.\u003c/p\u003e\n"],["\u003cp\u003eTo use this functionality, you need to declare the 'drive.file' scope in your add-on's manifest file.\u003c/p\u003e\n"]]],["The `EditorFileScopeActionResponseBuilder` creates `EditorFileScopeActionResponse` objects. It offers two methods: `build()`, which finalizes and validates the response, and `requestFileScopeForActiveDocument()`, which prompts the user for `drive.file` scope permission for the active document. Using `requestFileScopeForActiveDocument()` requires declaring the `drive.file` scope in the add-on's manifest. These methods facilitate the creation and management of actions related to file scope permissions within an editor.\n"],null,["# Class EditorFileScopeActionResponseBuilder\n\nEditorFileScopeActionResponseBuilder\n\nA builder for [EditorFileScopeActionResponse](/apps-script/reference/card-service/editor-file-scope-action-response) objects. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|\n| [build()](#build()) | [EditorFileScopeActionResponse](/apps-script/reference/card-service/editor-file-scope-action-response) | Builds the current Editor action response. |\n| [requestFileScopeForActiveDocument()](#requestFileScopeForActiveDocument()) | [EditorFileScopeActionResponseBuilder](#) | Requests the `drive.file` scope for the current active Editor document. |\n\nDetailed documentation\n----------------------\n\n### `build()`\n\nBuilds the current Editor action response.\n\n#### Return\n\n\n[EditorFileScopeActionResponse](/apps-script/reference/card-service/editor-file-scope-action-response) --- A validated [EditorFileScopeActionResponse](/apps-script/reference/card-service/editor-file-scope-action-response).\n\n*** ** * ** ***\n\n### `request``File``Scope``For``Active``Document()`\n\nRequests the `drive.file` scope for the current active Editor document.\n\n```javascript\n// Display a permissions dialog to the user, requesting `drive.file` scope for\n// the current document on behalf of this add-on.\nCardService.newEditorFileScopeActionResponseBuilder()\n .requestFileScopeForActiveDocument()\n .build();\n```\n\nNote: To call this method, you must add the `drive.file` scope to the add-on's\nmanifest.\n\n#### Return\n\n\n[EditorFileScopeActionResponseBuilder](#) --- This object, for chaining."]]