Drive

This service lets scripts create, find, and modify files and folders in
Google Drive. Although the built-in Drive service is easier to use, it has some limitations.
For the most
up-to-date features and support, and to access files or folders in shared drives, use the
[advanced Drive service](https://developers.google.com/apps-script/advanced/drive).

If your script uses a
[standard Cloud project](https://developers.google.com/apps-script/guides/cloud-platform-projects#standard)
instead of a default Cloud project, you must
manually turn on the Drive API. In your standard Cloud project, turn on the Drive API:

[Turn on the Drive API](https://console.cloud.google.com/apis/enableflow?apiid=drive.googleapis.com)
The following code sample shows how to log the names of each file in the user's My Drive folder:

    // Logs the name of every file in the user's Drive.
    var files = DriveApp.getFiles();
    while (files.hasNext()) {
      var file = files.next();
      console.log(file.getName());
    }

> [!NOTE]
> **Note:** Google Workspace Administrators
> can turn off the [Drive SDK](https://developers.google.com/drive)
> for their domain, which prevents their users from installing and using Google
> Drive apps. This setting also prevents users from using
> Apps Script scripts, web apps and add-ons that use the [Drive
> service](https://developers.google.com/apps-script/reference/drive) or [Advanced Drive Service](https://developers.google.com/apps-script/advanced/drive)
> (even if the add-on or web app was installed before the admin turned off the
> [Drive SDK](https://developers.google.com/drive)).
>
> However, if an add-on using the Drive service is published for domain-wide installation
> and is installed by the administrator for some or all users in the domain, or any script that
> has its [OAuth client allowlisted](https://support.google.com/a/answer/162106)
> by the domain administrator, the add-on functions for those users even if the
> [Drive SDK](https://developers.google.com/drive) is turned off in the domain.

## Classes

| Name | Brief description |
|---|---|
| `https://developers.google.com/apps-script/reference/drive/access` | An enum representing classes of users who can access a file or folder, besides any individual users who have been explicitly given access. |
| `https://developers.google.com/apps-script/reference/drive/drive-app` | Allows scripts to create, find, and modify files and folders in Google Drive. |
| `https://developers.google.com/apps-script/reference/drive/file` | A file in Google Drive. |
| `https://developers.google.com/apps-script/reference/drive/file-iterator` | An iterator that allows scripts to iterate over a potentially large collection of files. |
| `https://developers.google.com/apps-script/reference/drive/folder` | A folder in Google Drive. |
| `https://developers.google.com/apps-script/reference/drive/folder-iterator` | An object that allows scripts to iterate over a potentially large collection of folders. |
| `https://developers.google.com/apps-script/reference/drive/permission` | An enum representing the permissions granted to users who can access a file or folder, besides any individual users who have been explicitly given access. |
| `https://developers.google.com/apps-script/reference/drive/user` | A user associated with a file in Google Drive. |

## `https://developers.google.com/apps-script/reference/drive/access`

### Properties

| Property | Type | Description |
|---|---|---|
| `ANYONE` | `Enum` | Anyone on the Internet can find and access. |
| `ANYONE_WITH_LINK` | `Enum` | Anyone who has the link can access. |
| `DOMAIN` | `Enum` | People in your domain can find and access. |
| `DOMAIN_WITH_LINK` | `Enum` | People in your domain who have the link can access. |
| `PRIVATE` | `Enum` | Only people explicitly granted permission can access. |

## `https://developers.google.com/apps-script/reference/drive/drive-app`

### Properties

| Property | Type | Description |
|---|---|---|
| `Access` | `https://developers.google.com/apps-script/reference/drive/access` | An enum representing classes of users who can access a file or folder, besides any individual users who have been explicitly given access. |
| `Permission` | `https://developers.google.com/apps-script/reference/drive/permission` | An enum representing the permissions granted to users who can access a file or folder, besides any individual users who have been explicitly given access. |

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/drive/drive-app#continueFileIterator(String)` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Resumes a file iteration using a continuation token from a previous iterator. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#continueFolderIterator(String)` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Resumes a folder iteration using a continuation token from a previous iterator. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#createFile(BlobSource)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a file in the root of the user's Drive from a given `Blob` of arbitrary data. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#createFile(String,String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a text file in the root of the user's Drive with the given name and contents. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#createFile(String,String,String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a file in the root of the user's Drive with the given name, contents, and MIME type. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#createFolder(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Creates a folder in the root of the user's Drive with the given name. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#createShortcut(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a shortcut to the provided Drive item ID, and returns it. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#createShortcutForTargetIdAndResourceKey(String,String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a shortcut to the provided Drive item ID and resource key, and returns it. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#enforceSingleParent(Boolean)` | `void` | Enables or disables enforceSingleParent behavior for all calls affecting item parents. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFileById(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Gets the file with the given ID. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFileByIdAndResourceKey(String,String)` | `https://developers.google.com/apps-script/reference/drive/file` | Gets the file with the given ID and resource key. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFiles()` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all files in the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFilesByName(String)` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all files in the user's Drive that have the given name. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFilesByType(String)` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all files in the user's Drive that have the given MIME type. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFolderById(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Gets the folder with the given ID. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFolderByIdAndResourceKey(String,String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Gets the folder with the given ID and resource key. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFolders()` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of all folders in the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getFoldersByName(String)` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of all folders in the user's Drive that have the given name. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getRootFolder()` | `https://developers.google.com/apps-script/reference/drive/folder` | Gets the folder at the root of the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getStorageLimit()` | `Integer` | Gets the number of bytes the user is allowed to store in Drive. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getStorageUsed()` | `Integer` | Gets the number of bytes the user is currently storing in Drive. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getTrashedFiles()` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all the files in the trash of the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#getTrashedFolders()` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of all the folders in the trash of the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#searchFiles(String)` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all files in the user's Drive that match the given search criteria. |
| `https://developers.google.com/apps-script/reference/drive/drive-app#searchFolders(String)` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of all folders in the user's Drive that match the given search criteria. |

## `https://developers.google.com/apps-script/reference/drive/file`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/drive/file#addCommenter(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Add the given user to the list of commenters for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#addCommenter(User)` | `https://developers.google.com/apps-script/reference/drive/file` | Add the given user to the list of commenters for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#addCommenters(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Add the given array of users to the list of commenters for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#addEditor(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Adds the given user to the list of editors for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#addEditor(User)` | `https://developers.google.com/apps-script/reference/drive/file` | Adds the given user to the list of editors for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#addEditors(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Adds the given array of users to the list of editors for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#addViewer(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Adds the given user to the list of viewers for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#addViewer(User)` | `https://developers.google.com/apps-script/reference/drive/file` | Adds the given user to the list of viewers for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#addViewers(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Adds the given array of users to the list of viewers for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#getAccess(String)` | `https://developers.google.com/apps-script/reference/drive/permission` | Gets the permission granted to a specific user. |
| `https://developers.google.com/apps-script/reference/drive/file#getAccess(User)` | `https://developers.google.com/apps-script/reference/drive/permission` | Gets the permission granted to a specific user. |
| `https://developers.google.com/apps-script/reference/drive/file#getAs(String)` | `https://developers.google.com/apps-script/base/blob.html` | Return the data inside this object as a blob converted to the specified content type. |
| `https://developers.google.com/apps-script/reference/drive/file#getBlob()` | `https://developers.google.com/apps-script/base/blob.html` | Return the data inside this object as a blob. |
| `https://developers.google.com/apps-script/reference/drive/file#getDateCreated()` | `Date` | Gets the date the `https://developers.google.com/apps-script/reference/drive/file` was created. |
| `https://developers.google.com/apps-script/reference/drive/file#getDescription()` | `String` | Gets the description for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#getDownloadUrl()` | `String` | Gets the URL that can be used to download the file. |
| `https://developers.google.com/apps-script/reference/drive/file#getEditors()` | `https://developers.google.com/apps-script/reference/drive/user` | Gets the list of editors for this `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#getId()` | `String` | Gets the ID of the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#getLastUpdated()` | `Date` | Gets the date the `https://developers.google.com/apps-script/reference/drive/file` was last updated. |
| `https://developers.google.com/apps-script/reference/drive/file#getMimeType()` | `String` | Gets the MIME type of the file. |
| `https://developers.google.com/apps-script/reference/drive/file#getName()` | `String` | Gets the name of the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#getOwner()` | `https://developers.google.com/apps-script/reference/drive/user` | Gets the file owner. |
| `https://developers.google.com/apps-script/reference/drive/file#getParents()` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of folders that are immediate parents of the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#getResourceKey()` | `String` | Gets the resource key of the `https://developers.google.com/apps-script/reference/drive/file` that is required to access items that have been shared using a link. |
| `https://developers.google.com/apps-script/reference/drive/file#getSecurityUpdateEligible()` | `Boolean` | Gets whether this `https://developers.google.com/apps-script/reference/drive/file` is eligible to apply the security update that requires a resource key for access when it's shared using a link. |
| `https://developers.google.com/apps-script/reference/drive/file#getSecurityUpdateEnabled()` | `Boolean` | Gets whether this `https://developers.google.com/apps-script/reference/drive/file` requires a resource key for access when it's shared using a link. |
| `https://developers.google.com/apps-script/reference/drive/file#getSharingAccess()` | `https://developers.google.com/apps-script/reference/drive/access` | Gets which class of users can access the `https://developers.google.com/apps-script/reference/drive/file`, besides any individual users who have been explicitly given access. |
| `https://developers.google.com/apps-script/reference/drive/file#getSharingPermission()` | `https://developers.google.com/apps-script/reference/drive/permission` | Gets the permission granted to those users who can access the `https://developers.google.com/apps-script/reference/drive/file`, besides any individual users who have been explicitly given access. |
| `https://developers.google.com/apps-script/reference/drive/file#getSize()` | `Integer` | Gets the number of bytes used to store the `https://developers.google.com/apps-script/reference/drive/file` in Drive. |
| `https://developers.google.com/apps-script/reference/drive/file#getTargetId()` | `String|null` | If this is a Shortcut, returns the ID of the item it points to. |
| `https://developers.google.com/apps-script/reference/drive/file#getTargetMimeType()` | `String|null` | If this is a Shortcut, returns the mime type of the item it points to. |
| `https://developers.google.com/apps-script/reference/drive/file#getTargetResourceKey()` | `String|null` | If the file is a shortcut, returns the resource key of the item it points to. |
| `https://developers.google.com/apps-script/reference/drive/file#getThumbnail()` | `https://developers.google.com/apps-script/base/blob.html|null` | Gets a thumbnail image for the file, or `null` if no thumbnail exists. |
| `https://developers.google.com/apps-script/reference/drive/file#getUrl()` | `String` | Gets the URL that can be used to open the `https://developers.google.com/apps-script/reference/drive/file` in a Google App like Drive or Docs. |
| `https://developers.google.com/apps-script/reference/drive/file#getViewers()` | `https://developers.google.com/apps-script/reference/drive/user` | Gets the list of viewers and commenters for this `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#isShareableByEditors()` | `Boolean` | Determines whether users with edit permissions to the `https://developers.google.com/apps-script/reference/drive/file` are allowed to share with other users or change the permissions. |
| `https://developers.google.com/apps-script/reference/drive/file#isStarred()` | `Boolean` | Determines whether the `https://developers.google.com/apps-script/reference/drive/file` has been starred in the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/file#isTrashed()` | `Boolean` | Determines whether the `https://developers.google.com/apps-script/reference/drive/file` is in the trash of the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/file#makeCopy()` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a copy of the file. |
| `https://developers.google.com/apps-script/reference/drive/file#makeCopy(Folder)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a copy of the file in the destination directory. |
| `https://developers.google.com/apps-script/reference/drive/file#makeCopy(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a copy of the file and names it with the name provided. |
| `https://developers.google.com/apps-script/reference/drive/file#makeCopy(String,Folder)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a copy of the file in the destination directory and names it with the name provided. |
| `https://developers.google.com/apps-script/reference/drive/file#moveTo(Folder)` | `https://developers.google.com/apps-script/reference/drive/file` | Moves this item to the provided destination folder. |
| `https://developers.google.com/apps-script/reference/drive/file#removeCommenter(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Removes the given user from the list of commenters for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#removeCommenter(User)` | `https://developers.google.com/apps-script/reference/drive/file` | Removes the given user from the list of commenters for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#removeEditor(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Removes the given user from the list of editors for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#removeEditor(User)` | `https://developers.google.com/apps-script/reference/drive/file` | Removes the given user from the list of editors for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#removeViewer(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Removes the given user from the list of viewers and commenters for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#removeViewer(User)` | `https://developers.google.com/apps-script/reference/drive/file` | Removes the given user from the list of viewers and commenters for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#revokePermissions(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Revokes the access to the `https://developers.google.com/apps-script/reference/drive/file` granted to the given user. |
| `https://developers.google.com/apps-script/reference/drive/file#revokePermissions(User)` | `https://developers.google.com/apps-script/reference/drive/file` | Revokes the access to the `https://developers.google.com/apps-script/reference/drive/file` granted to the given user. |
| `https://developers.google.com/apps-script/reference/drive/file#setContent(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Overwrites the content of the file with a given replacement. |
| `https://developers.google.com/apps-script/reference/drive/file#setDescription(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Sets the description for the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#setName(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Sets the name of the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#setOwner(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Changes the owner of the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#setOwner(User)` | `https://developers.google.com/apps-script/reference/drive/file` | Changes the owner of the `https://developers.google.com/apps-script/reference/drive/file`. |
| `https://developers.google.com/apps-script/reference/drive/file#setSecurityUpdateEnabled(Boolean)` | `https://developers.google.com/apps-script/reference/drive/file` | Sets whether the `https://developers.google.com/apps-script/reference/drive/file` requires a resource key for access when it's shared using a link. |
| `https://developers.google.com/apps-script/reference/drive/file#setShareableByEditors(Boolean)` | `https://developers.google.com/apps-script/reference/drive/file` | Sets whether users with edit permissions to the `https://developers.google.com/apps-script/reference/drive/file` are allowed to share with other users or change the permissions. |
| `https://developers.google.com/apps-script/reference/drive/file#setSharing(Access,Permission)` | `https://developers.google.com/apps-script/reference/drive/file` | Sets which class of users can access the `https://developers.google.com/apps-script/reference/drive/file` and what permissions those users are granted, besides any individual users who have been explicitly given access. |
| `https://developers.google.com/apps-script/reference/drive/file#setStarred(Boolean)` | `https://developers.google.com/apps-script/reference/drive/file` | Sets whether the `https://developers.google.com/apps-script/reference/drive/file` is starred in the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/file#setTrashed(Boolean)` | `https://developers.google.com/apps-script/reference/drive/file` | Sets whether the `https://developers.google.com/apps-script/reference/drive/file` is in the trash of the user's Drive. |

## `https://developers.google.com/apps-script/reference/drive/file-iterator`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/drive/file-iterator#getContinuationToken()` | `String` | Gets a token that can be used to resume this iteration at a later time. |
| `https://developers.google.com/apps-script/reference/drive/file-iterator#hasNext()` | `Boolean` | Determines whether calling `https://developers.google.com/apps-script/reference/drive/file-iterator#next()` returns an item. |
| `https://developers.google.com/apps-script/reference/drive/file-iterator#next()` | `https://developers.google.com/apps-script/reference/drive/file` | Gets the next item in the collection of files or folders. |

## `https://developers.google.com/apps-script/reference/drive/folder`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/drive/folder#addEditor(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Adds the given user to the list of editors for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#addEditor(User)` | `https://developers.google.com/apps-script/reference/drive/folder` | Adds the given user to the list of editors for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#addEditors(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Adds the given array of users to the list of editors for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#addViewer(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Adds the given user to the list of viewers for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#addViewer(User)` | `https://developers.google.com/apps-script/reference/drive/folder` | Adds the given user to the list of viewers for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#addViewers(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Adds the given array of users to the list of viewers for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#createFile(BlobSource)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a file in the current folder from a given `Blob` of arbitrary data. |
| `https://developers.google.com/apps-script/reference/drive/folder#createFile(String,String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a text file in the current folder with the given name and contents. |
| `https://developers.google.com/apps-script/reference/drive/folder#createFile(String,String,String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a file in the current folder with the given name, contents, and MIME type. |
| `https://developers.google.com/apps-script/reference/drive/folder#createFolder(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Creates a folder in the current folder with the given name. |
| `https://developers.google.com/apps-script/reference/drive/folder#createShortcut(String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a shortcut to the provided Drive item ID, and returns it. |
| `https://developers.google.com/apps-script/reference/drive/folder#createShortcutForTargetIdAndResourceKey(String,String)` | `https://developers.google.com/apps-script/reference/drive/file` | Creates a shortcut to the provided Drive item ID and resource key, and returns it. |
| `https://developers.google.com/apps-script/reference/drive/folder#getAccess(String)` | `https://developers.google.com/apps-script/reference/drive/permission` | Gets the permission granted to a specific user. |
| `https://developers.google.com/apps-script/reference/drive/folder#getAccess(User)` | `https://developers.google.com/apps-script/reference/drive/permission` | Gets the permission granted to a specific user. |
| `https://developers.google.com/apps-script/reference/drive/folder#getDateCreated()` | `Date` | Gets the date the `https://developers.google.com/apps-script/reference/drive/folder` was created. |
| `https://developers.google.com/apps-script/reference/drive/folder#getDescription()` | `String` | Gets the description for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#getEditors()` | `https://developers.google.com/apps-script/reference/drive/user` | Gets the list of editors for this `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#getFiles()` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all files that are children of the current folder. |
| `https://developers.google.com/apps-script/reference/drive/folder#getFilesByName(String)` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all files that are children of the current folder and have the given name. |
| `https://developers.google.com/apps-script/reference/drive/folder#getFilesByType(String)` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all files that are children of the current folder and have the given MIME type. |
| `https://developers.google.com/apps-script/reference/drive/folder#getFolders()` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of all folders that are children of the current folder. |
| `https://developers.google.com/apps-script/reference/drive/folder#getFoldersByName(String)` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of all folders that are children of the current folder and have the given name. |
| `https://developers.google.com/apps-script/reference/drive/folder#getId()` | `String` | Gets the ID of the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#getLastUpdated()` | `Date` | Gets the date the `https://developers.google.com/apps-script/reference/drive/folder` was last updated. |
| `https://developers.google.com/apps-script/reference/drive/folder#getName()` | `String` | Gets the name of the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#getOwner()` | `https://developers.google.com/apps-script/reference/drive/user` | Gets the owner of this `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#getParents()` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of folders that are immediate parents of the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#getResourceKey()` | `String` | Gets the resource key of the `https://developers.google.com/apps-script/reference/drive/folder` that is required to access items that have been shared using a link. |
| `https://developers.google.com/apps-script/reference/drive/folder#getSecurityUpdateEligible()` | `Boolean` | Gets whether this `https://developers.google.com/apps-script/reference/drive/folder` is eligible to apply the security update that requires a resource key for access when it's shared using a link. |
| `https://developers.google.com/apps-script/reference/drive/folder#getSecurityUpdateEnabled()` | `Boolean` | Gets whether this `https://developers.google.com/apps-script/reference/drive/folder` requires a resource key for access when it's shared using a link. |
| `https://developers.google.com/apps-script/reference/drive/folder#getSharingAccess()` | `https://developers.google.com/apps-script/reference/drive/access` | Gets which class of users can access the `https://developers.google.com/apps-script/reference/drive/folder`, besides any individual users who have been explicitly given access. |
| `https://developers.google.com/apps-script/reference/drive/folder#getSharingPermission()` | `https://developers.google.com/apps-script/reference/drive/permission` | Gets the permission granted to those users who can access the `https://developers.google.com/apps-script/reference/drive/folder`, besides any individual users who have been explicitly given access. |
| `https://developers.google.com/apps-script/reference/drive/folder#getSize()` | `Integer` | Gets the number of bytes used to store the `https://developers.google.com/apps-script/reference/drive/folder` in Drive. |
| `https://developers.google.com/apps-script/reference/drive/folder#getUrl()` | `String` | Gets the URL that can be used to open the `https://developers.google.com/apps-script/reference/drive/folder` in a Google App like Drive or Docs. |
| `https://developers.google.com/apps-script/reference/drive/folder#getViewers()` | `https://developers.google.com/apps-script/reference/drive/user` | Gets the list of viewers and commenters for this `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#isShareableByEditors()` | `Boolean` | Determines whether users with edit permissions to the `https://developers.google.com/apps-script/reference/drive/folder` are allowed to share with other users or change the permissions. |
| `https://developers.google.com/apps-script/reference/drive/folder#isStarred()` | `Boolean` | Determines whether the `https://developers.google.com/apps-script/reference/drive/folder` has been starred in the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/folder#isTrashed()` | `Boolean` | Determines whether the `https://developers.google.com/apps-script/reference/drive/folder` is in the trash of the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/folder#moveTo(Folder)` | `https://developers.google.com/apps-script/reference/drive/folder` | Moves this item to the provided destination folder. |
| `https://developers.google.com/apps-script/reference/drive/folder#removeEditor(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Removes the given user from the list of editors for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#removeEditor(User)` | `https://developers.google.com/apps-script/reference/drive/folder` | Removes the given user from the list of editors for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#removeViewer(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Removes the given user from the list of viewers and commenters for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#removeViewer(User)` | `https://developers.google.com/apps-script/reference/drive/folder` | Removes the given user from the list of viewers and commenters for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#revokePermissions(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Revokes the access to the `https://developers.google.com/apps-script/reference/drive/folder` granted to the given user. |
| `https://developers.google.com/apps-script/reference/drive/folder#revokePermissions(User)` | `https://developers.google.com/apps-script/reference/drive/folder` | Revokes the access to the `https://developers.google.com/apps-script/reference/drive/folder` granted to the given user. |
| `https://developers.google.com/apps-script/reference/drive/folder#searchFiles(String)` | `https://developers.google.com/apps-script/reference/drive/file-iterator` | Gets a collection of all files that are children of the current folder and match the given search criteria. |
| `https://developers.google.com/apps-script/reference/drive/folder#searchFolders(String)` | `https://developers.google.com/apps-script/reference/drive/folder-iterator` | Gets a collection of all folders that are children of the current folder and match the given search criteria. |
| `https://developers.google.com/apps-script/reference/drive/folder#setDescription(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Sets the description for the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#setName(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Sets the name of the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#setOwner(String)` | `https://developers.google.com/apps-script/reference/drive/folder` | Changes the owner of the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#setOwner(User)` | `https://developers.google.com/apps-script/reference/drive/folder` | Changes the owner of the `https://developers.google.com/apps-script/reference/drive/folder`. |
| `https://developers.google.com/apps-script/reference/drive/folder#setSecurityUpdateEnabled(Boolean)` | `https://developers.google.com/apps-script/reference/drive/folder` | Sets whether the `https://developers.google.com/apps-script/reference/drive/folder` requires a resource key for access when it's shared using a link. |
| `https://developers.google.com/apps-script/reference/drive/folder#setShareableByEditors(Boolean)` | `https://developers.google.com/apps-script/reference/drive/folder` | Sets whether users with edit permissions to the `https://developers.google.com/apps-script/reference/drive/folder` are allowed to share with other users or change the permissions. |
| `https://developers.google.com/apps-script/reference/drive/folder#setSharing(Access,Permission)` | `https://developers.google.com/apps-script/reference/drive/folder` | Sets which class of users can access the `https://developers.google.com/apps-script/reference/drive/folder` and what permissions those users are granted, besides any individual users who have been explicitly given access. |
| `https://developers.google.com/apps-script/reference/drive/folder#setStarred(Boolean)` | `https://developers.google.com/apps-script/reference/drive/folder` | Sets whether the `https://developers.google.com/apps-script/reference/drive/folder` is starred in the user's Drive. |
| `https://developers.google.com/apps-script/reference/drive/folder#setTrashed(Boolean)` | `https://developers.google.com/apps-script/reference/drive/folder` | Sets whether the `https://developers.google.com/apps-script/reference/drive/folder` is in the trash of the user's Drive. |

## `https://developers.google.com/apps-script/reference/drive/folder-iterator`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/drive/folder-iterator#getContinuationToken()` | `String` | Gets a token that can be used to resume this iteration at a later time. |
| `https://developers.google.com/apps-script/reference/drive/folder-iterator#hasNext()` | `Boolean` | Determines whether calling `https://developers.google.com/apps-script/reference/drive/folder-iterator#next()` returns an item. |
| `https://developers.google.com/apps-script/reference/drive/folder-iterator#next()` | `https://developers.google.com/apps-script/reference/drive/folder` | Gets the next item in the collection of files or folders. |

## `https://developers.google.com/apps-script/reference/drive/permission`

### Properties

| Property | Type | Description |
|---|---|---|
| `VIEW` | `Enum` | Users who can access the file or folder are able only to view it or copy it. |
| `EDIT` | `Enum` | Users who can access the file or folder are able to edit it. |
| `COMMENT` | `Enum` | Users who can access the file or folder are able only to view it, copy it, or comment on it. |
| `OWNER` | `Enum` | The user owns the file or folder. |
| `ORGANIZER` | `Enum` | Users who can organize files and folders within a shared drive. |
| `FILE_ORGANIZER` | `Enum` | Users who can edit, trash, and move content within a shared drive. |
| `NONE` | `Enum` | The user does not have any permissions for the file or folder. |

## `https://developers.google.com/apps-script/reference/drive/user`

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/drive/user#getDomain()` | `String|null` | Gets the domain name associated with the user's account. |
| `https://developers.google.com/apps-script/reference/drive/user#getEmail()` | `String|null` | Gets the user's email address. |
| `https://developers.google.com/apps-script/reference/drive/user#getName()` | `String|null` | Gets the user's name. |
| `https://developers.google.com/apps-script/reference/drive/user#getPhotoUrl()` | `String|null` | Gets the URL for the user's photo. |