Meminta cakupan drive.file untuk dokumen Editor yang aktif saat ini.
// 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();
Catatan: Untuk memanggil metode ini, Anda harus menambahkan cakupan drive.file ke manifes add-on.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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."]]