Requests the drive.file scope for the current active Editor document.
// 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();
Note: To call this method, you must add the drive.file scope to the add-on's manifest.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 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,["EditorFileScopeActionResponseBuilder\n\nA builder for [EditorFileScopeActionResponse](/apps-script/reference/card-service/editor-file-scope-action-response) objects. \n\nMethods\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`build()` \nBuilds the current Editor action response.\n\nReturn\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()` \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\nReturn\n\n\n[EditorFileScopeActionResponseBuilder](#) --- This object, for chaining."]]