สคริปต์แบบเดี่ยวๆ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สคริปต์แบบสแตนด์อโลนคือสคริปต์ที่ไม่ได้เชื่อมโยงกับไฟล์ Google ชีต, เอกสาร, สไลด์ หรือฟอร์ม สคริปต์เหล่านี้จะปรากฏ
ในไฟล์
ใน Google ไดรฟ์
การสร้างสคริปต์แบบสแตนด์อโลน
วิธีที่ง่ายที่สุดในการสร้างสคริปต์แบบสแตนด์อโลนคือไปที่
script.google.com
แล้วคลิกaddโปรเจ็กต์ใหม่ที่ด้านซ้ายบน
นอกจากนี้ คุณยังสร้างสคริปต์แบบสแตนด์อโลนจาก Google ไดรฟ์ได้ด้วย ไปที่ Google ไดรฟ์
แล้วคลิกใหม่ > เพิ่มเติม > Google Apps Script
การเรียกใช้สคริปต์แบบสแตนด์อโลน
หากต้องการเรียกใช้ฟังก์ชันจากตัวแก้ไขสคริปต์ ให้เลือกชื่อ
ของฟังก์ชันที่ต้องการเรียกใช้ที่ด้านบน แล้วคลิกเรียกใช้
การใช้สคริปต์แบบสแตนด์อโลน
สคริปต์แบบสแตนด์อโลนจำนวนมากเป็นสคริปต์ยูทิลิตี เช่น เพื่อค้นหาไฟล์เก่าใน Google ไดรฟ์ที่มีชื่อ "ไม่มีชื่อ"
เพื่อให้คุณลบไฟล์เหล่านั้นได้
นอกจากนี้ คุณยังสามารถนำสคริปต์แบบสแตนด์อโลนไปใช้เป็นเว็บแอป
หรือตั้งค่าให้ทำงานโดยอัตโนมัติจากทริกเกอร์ที่ติดตั้งได้
สคริปต์แบบสแตนด์อโลนของ Apps Script เหมาะสำหรับการพัฒนาส่วนเสริมที่มีน้ำหนักเบาสำหรับตัวคุณเอง ทีม หรือองค์กร สำหรับโปรเจ็กต์ขนาดใหญ่ ให้ลองสร้างส่วนเสริม Google Workspace
ในสภาพแวดล้อมรันไทม์อื่น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eStandalone Google Apps Scripts are independent scripts not tied to any specific Google file like Sheets, Docs, or Slides, and they reside in your Google Drive.\u003c/p\u003e\n"],["\u003cp\u003eYou can effortlessly create a standalone script by visiting script.google.com or through Google Drive by navigating to New > More > Google Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eStandalone scripts are often utilized as utilities to automate tasks, such as searching and deleting files, or deployed as web apps or triggered automatically.\u003c/p\u003e\n"],["\u003cp\u003eThey can be run directly from the script editor by selecting the desired function and clicking Run.\u003c/p\u003e\n"],["\u003cp\u003eAdditionally, add-ons for Google Workspace can now be published using standalone scripts.\u003c/p\u003e\n"]]],[],null,["# Standalone Scripts\n\nA standalone script is any script that is not\n[bound to a Google Sheets, Docs, Slides, or\nForms file](/apps-script/guides/bound). These scripts appear\namong your files\nin Google Drive.\n\nCreating a standalone script\n----------------------------\n\nThe easiest way to create a standalone script is to visit\n[`script.google.com`](https://script.google.com)\nand at the top left, click add**New project**.\n\nYou can also create standalone scripts from Google Drive. Go to [Google Drive](https://drive.google.com)\nand click **New \\\u003e More \\\u003e Google Apps Script**.\n\nRunning a standalone script\n---------------------------\n\nTo run a function from the script editor, at the top, select the name\nof the function you want to execute and click **Run**.\n\nUsing a standalone script\n-------------------------\n\nMany standalone scripts are utility scripts --- for example, to\n[search your Google Drive for old files whose name contains \"untitled\"](/apps-script/reference/drive/drive-app#searchFiles(String))\nso that you can delete them.\n\nA standalone script can also be deployed as a [web app](/apps-script/guides/web)\nor set up to run automatically from an\n[installable trigger](/apps-script/guides/triggers/installable).\n\nApps Script standalone scripts are suitable for lightweight\nadd-on development for yourself, your team, or your\norganization. For larger projects, consider building a Google Workspace\nadd-on on a [different runtime](/workspace/add-ons/guides/alternate-runtimes)\nenvironment."]]