File
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Một tệp riêng lẻ trong dự án tập lệnh. Tệp là mã nguồn bên thứ ba do một hoặc nhiều nhà phát triển tạo ra. Đó có thể là mã JS phía máy chủ, HTML hoặc tệp cấu hình. Mỗi dự án tập lệnh có thể chứa nhiều tệp.
Biểu diễn dưới dạng JSON |
{
"name": string,
"type": enum (FileType ),
"source": string,
"lastModifyUser": {
object (User )
},
"createTime": string,
"updateTime": string,
"functionSet": {
object (FunctionSet )
}
} |
Trường |
name |
string
Tên của tệp. Phần mở rộng của tệp không thuộc tên tệp và có thể được xác định từ trường loại.
|
type |
enum (FileType )
Loại tệp.
|
source |
string
Nội dung tệp.
|
lastModifyUser |
object (User )
Người dùng đã sửa đổi tệp gần đây nhất. Thông tin chi tiết mà bạn thấy trong đối tượng này được kiểm soát theo chế độ cài đặt về khả năng hiển thị hồ sơ của người dùng sửa đổi gần đây nhất.
|
createTime |
string (Timestamp format)
Dấu thời gian của ngày tạo. Dấu thời gian ở định dạng "Zulu" RFC3339 UTC, có độ phân giải nano giây và tối đa 9 chữ số thập phân. Ví dụ: "2014-10-02T15:01:23Z" và "2014-10-02T15:01:23.045123456Z" .
|
updateTime |
string (Timestamp format)
Dấu thời gian của ngày sửa đổi gần đây nhất. Dấu thời gian ở định dạng "Zulu" RFC3339 UTC, có độ phân giải nano giây và tối đa 9 chữ số thập phân. Ví dụ: "2014-10-02T15:01:23Z" và "2014-10-02T15:01:23.045123456Z" .
|
functionSet |
object (FunctionSet )
Tập hợp các hàm được xác định trong tệp tập lệnh (nếu có).
|
FileType
Một bảng liệt kê các loại tệp.
Enum |
ENUM_TYPE_UNSPECIFIED |
Loại tệp chưa xác định; chưa bao giờ được sử dụng thực tế. |
SERVER_JS |
Tệp mã phía máy chủ Apps Script. |
HTML |
Một tệp chứa HTML phía máy khách. |
JSON |
Một tệp ở định dạng JSON. Loại này chỉ được dùng cho tệp kê khai của dự án tập lệnh. Nội dung tệp kê khai phải khớp với cấu trúc của một ScriptManifest hợp lệ |
FunctionSet
Một tập hợp các hàm. Không được phép có nội dung trùng lặp.
Biểu diễn dưới dạng JSON |
{
"values": [
{
object (Function )
}
]
} |
Trường |
values[] |
object (Function )
Danh sách các hàm tạo nên tập hợp.
|
Chức năng
Biểu thị một hàm trong dự án tập lệnh.
Biểu diễn dưới dạng JSON |
{
"name": string,
"parameters": [
string
]
} |
Trường |
name |
string
Tên hàm trong dự án tập lệnh.
|
parameters[] |
string
Danh sách tên tham số có thứ tự của hàm trong dự án tập lệnh.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-17 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-17 UTC."],[[["\u003cp\u003eA file in a script project represents third-party source code and can be server-side JS, HTML, or a configuration file.\u003c/p\u003e\n"],["\u003cp\u003eEach script project can contain multiple files, each with properties like name, type, source code, and modification details.\u003c/p\u003e\n"],["\u003cp\u003eFiles can contain a set of functions, each defined by its name and parameters, contributing to the script's functionality.\u003c/p\u003e\n"],["\u003cp\u003eFiles can be of various types, including server-side JavaScript, HTML, JSON for the project manifest, ensuring diverse script capabilities.\u003c/p\u003e\n"]]],[],null,["# File\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [FileType](#FileType)\n- [FunctionSet](#FunctionSet)\n - [JSON representation](#FunctionSet.SCHEMA_REPRESENTATION)\n- [Function](#Function)\n - [JSON representation](#Function.SCHEMA_REPRESENTATION)\n\nAn individual file within a script project. A file is a third-party source code created by one or more developers. It can be a server-side JS code, HTML, or a configuration file. Each script project can contain multiple files.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"type\": enum (/apps-script/api/reference/rest/v1/File#FileType), \"source\": string, \"lastModifyUser\": { object (/apps-script/api/reference/rest/v1/projects#User) }, \"createTime\": string, \"updateTime\": string, \"functionSet\": { object (/apps-script/api/reference/rest/v1/File#FunctionSet) } } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The name of the file. The file extension is not part of the file name, which can be identified from the type field. |\n| `type` | `enum (`[FileType](/apps-script/api/reference/rest/v1/File#FileType)`)` The type of the file. |\n| `source` | `string` The file content. |\n| `lastModifyUser` | `object (`[User](/apps-script/api/reference/rest/v1/projects#User)`)` The user who modified the file most recently. The details visible in this object are controlled by the profile visibility settings of the last modifying user. |\n| `createTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` Creation date timestamp. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\n| `updateTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` Last modified date timestamp. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\n| `functionSet` | `object (`[FunctionSet](/apps-script/api/reference/rest/v1/File#FunctionSet)`)` The defined set of functions in the script file, if any. |\n\nFileType\n--------\n\nAn enumeration of different types of files.\n\n| Enums ||\n|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ENUM_TYPE_UNSPECIFIED` | Undetermined file type; never actually used. |\n| `SERVER_JS` | An Apps Script server-side code file. |\n| `HTML` | A file containing client-side HTML. |\n| `JSON` | A file in JSON format. This type is only used for the script project's manifest. The manifest file content must match the structure of a valid [ScriptManifest](/apps-script/concepts/manifests) |\n\nFunctionSet\n-----------\n\nA set of functions. No duplicates are permitted.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------|\n| ``` { \"values\": [ { object (/apps-script/api/reference/rest/v1/File#Function) } ] } ``` |\n\n| Fields ||\n|------------|------------------------------------------------------------------------------------------------------------------|\n| `values[]` | `object (`[Function](/apps-script/api/reference/rest/v1/File#Function)`)` A list of functions composing the set. |\n\nFunction\n--------\n\nRepresents a function in a script project.\n\n| JSON representation |\n|------------------------------------------------------|\n| ``` { \"name\": string, \"parameters\": [ string ] } ``` |\n\n| Fields ||\n|----------------|-------------------------------------------------------------------------------------|\n| `name` | `string` The function name in the script project. |\n| `parameters[]` | `string` The ordered list of parameter names of the function in the script project. |"]]