File
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ไฟล์แต่ละไฟล์ภายในโปรเจ็กต์สคริปต์ ไฟล์คือซอร์สโค้ดของบุคคลที่สามที่สร้างขึ้นโดยนักพัฒนาซอฟต์แวร์อย่างน้อย 1 คน ซึ่งอาจเป็นโค้ด JS ฝั่งเซิร์ฟเวอร์, HTML หรือไฟล์การกำหนดค่า โปรเจ็กต์สคริปต์แต่ละโปรเจ็กต์มีไฟล์ได้หลายไฟล์
การแสดง JSON |
{
"name": string,
"type": enum (FileType ),
"source": string,
"lastModifyUser": {
object (User )
},
"createTime": string,
"updateTime": string,
"functionSet": {
object (FunctionSet )
}
} |
ช่อง |
name |
string
ชื่อไฟล์ นามสกุลไฟล์ไม่ได้เป็นส่วนหนึ่งของชื่อไฟล์ ซึ่งระบุได้จากฟิลด์ประเภท
|
type |
enum (FileType )
ประเภทของไฟล์
|
source |
string
เนื้อหาของไฟล์
|
lastModifyUser |
object (User )
ผู้ใช้ที่แก้ไขไฟล์ล่าสุด รายละเอียดที่มองเห็นได้ในออบเจ็กต์นี้จะควบคุมโดยการตั้งค่าระดับการมองเห็นโปรไฟล์ของผู้ใช้ที่แก้ไขล่าสุด
|
createTime |
string (Timestamp format)
การประทับเวลาวันที่สร้าง การประทับเวลาจะอยู่ในรูปแบบ RFC3339 UTC "Zulu" ที่มีความละเอียดเป็นหน่วยนาโนวินาทีและมีตัวเลขเศษส่วนได้สูงสุด 9 หลัก ตัวอย่างเช่น "2014-10-02T15:01:23Z" และ "2014-10-02T15:01:23.045123456Z"
|
updateTime |
string (Timestamp format)
การประทับเวลาของวันที่แก้ไขล่าสุด การประทับเวลาจะอยู่ในรูปแบบ RFC3339 UTC "Zulu" ที่มีความละเอียดเป็นหน่วยนาโนวินาทีและมีตัวเลขเศษส่วนได้สูงสุด 9 หลัก ตัวอย่างเช่น "2014-10-02T15:01:23Z" และ "2014-10-02T15:01:23.045123456Z"
|
functionSet |
object (FunctionSet )
ชุดฟังก์ชันที่กำหนดไว้ในไฟล์สคริปต์ (หากมี)
|
FileType
Enum |
ENUM_TYPE_UNSPECIFIED |
ประเภทไฟล์ที่ยังไม่ระบุ ไม่เคยมีการใช้งานจริง |
SERVER_JS |
ไฟล์โค้ดฝั่งเซิร์ฟเวอร์ของ Apps Script |
HTML |
ไฟล์ที่มี HTML ฝั่งไคลเอ็นต์ |
JSON |
ไฟล์ในรูปแบบ JSON ประเภทนี้ใช้สำหรับไฟล์ Manifest ของโปรเจ็กต์สคริปต์เท่านั้น เนื้อหาไฟล์ Manifest ต้องตรงกับโครงสร้างของ ScriptManifest ที่ถูกต้อง |
FunctionSet
ชุดฟังก์ชัน ไม่อนุญาตให้มีรายการซ้ำ
การแสดง JSON |
{
"values": [
{
object (Function )
}
]
} |
ช่อง |
values[] |
object (Function )
รายการฟังก์ชันที่ประกอบเป็นชุด
|
ฟังก์ชัน
แสดงฟังก์ชันในโปรเจ็กต์สคริปต์
การแสดง JSON |
{
"name": string,
"parameters": [
string
]
} |
ช่อง |
name |
string
ชื่อฟังก์ชันในโปรเจ็กต์สคริปต์
|
parameters[] |
string
รายการชื่อพารามิเตอร์ของฟังก์ชันในโปรเจ็กต์สคริปต์ที่เรียงตามลำดับ
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-17 UTC
[null,null,["อัปเดตล่าสุด 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. |"]]