Class DocumentTriggerBuilder
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.
Trình tạoĐiều kiện kích hoạt tài liệu
Trình tạo cho trình kích hoạt tài liệu.
Tài liệu chi tiết
create()
Tạo và trả về điều kiện kích hoạt mới.
Cầu thủ trả bóng
Trigger
– Điều kiện kích hoạt mới.
onOpen()
Chỉ định một điều kiện kích hoạt sẽ kích hoạt khi tài liệu được mở.
const document = DocumentApp.getActiveDocument();
ScriptApp.newTrigger('myFunction').forDocument(document).onOpen().create();
Cầu thủ trả bóng
DocumentTriggerBuilder
— DocumentTriggerBuilder
này, để tạo chuỗi.
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-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],["The `DocumentTriggerBuilder` class facilitates the creation of triggers for Google Documents. Key actions include `create()`, which generates and returns a new `Trigger` object, and `onOpen()`, which configures the trigger to activate when the document is opened. The `onOpen()` method returns the `DocumentTriggerBuilder` instance, allowing method chaining. The provided example demonstrates creating a trigger that runs \"myFunction\" upon document opening.\n"],null,[]]