Class EditorFileScopeActionResponseBuilder
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Documentazione dettagliata
requestFileScopeForActiveDocument()
Richiede l'ambito drive.file
per il documento di Editor attualmente attivo.
// 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();
Nota: per chiamare questo metodo, devi aggiungere l'ambito drive.file
al manifest del componente aggiuntivo.
Invio
EditorFileScopeActionResponseBuilder
: questo oggetto, per l'accodamento.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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."]]