Editor में मौजूदा दस्तावेज़ के लिए, drive.file स्कोप का अनुरोध करता है.
// 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();
ध्यान दें: इस तरीके को कॉल करने के लिए, आपको ऐड-ऑन के मेनिफ़ेस्ट में drive.file स्कोप जोड़ना होगा.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 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,["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."]]