> ## Documentation Index
> Fetch the complete documentation index at: https://docs.farmsync.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Thêm Script

> Hướng dẫn tạo và quản lý Script trong FarmSync

## Giới thiệu

Trang này hướng dẫn bạn tạo một Script mới trong hệ thống Automation của FarmSync. Bạn sẽ biết cách truy cập trang quản lý, tạo script, đặt tên, thêm nội dung và lưu lại.

<Info>
  Bạn có thể truy cập trực tiếp trang Scripts Manager tại
  `https://app.farmsync.cloud/dashboard/automation/scripts/`.
</Info>

## Tạo Script mới

<Steps>
  <Step title="Truy cập trang Scripts">
    Bạn có 2 cách:

    1. Mở đường dẫn: `https://app.farmsync.cloud/dashboard/automation/scripts/`
    2. Hoặc vào mục Automation > Scripts như trong ảnh bên dưới.

    <Frame>
      <img src="https://mintcdn.com/farmsync-bb893348/04MM8D0921TGN18C/images/automation/scripts/automation-section.png?fit=max&auto=format&n=04MM8D0921TGN18C&q=85&s=b3ef4f9ebd7c5ee839c6c1131e289667" alt="Đi tới mục Automation Scripts trong dashboard" width="283" height="125" data-path="images/automation/scripts/automation-section.png" />
    </Frame>
  </Step>

  <Step title="Trang Scripts Manager">
    Sau khi truy cập, bạn sẽ thấy trang Scripts Manager.

    <Frame>
      <img src="https://mintcdn.com/farmsync-bb893348/04MM8D0921TGN18C/images/automation/scripts/script-manager.png?fit=max&auto=format&n=04MM8D0921TGN18C&q=85&s=9f605ee05fa76921936c852a66b252b4" alt="Giao diện Scripts Manager" width="1578" height="692" data-path="images/automation/scripts/script-manager.png" />
    </Frame>

    Nếu bạn là người dùng mới, danh sách sẽ trống (chưa có script nào).
  </Step>

  <Step title="Tạo Script mới">
    Nhấn nút **New Script** để bắt đầu tạo mới.

    <Frame>
      <img src="https://mintcdn.com/farmsync-bb893348/04MM8D0921TGN18C/images/automation/scripts/new-script-button.png?fit=max&auto=format&n=04MM8D0921TGN18C&q=85&s=dba78e7a9b89a381499f9842e0d12269" alt="Nút New Script" width="146" height="54" data-path="images/automation/scripts/new-script-button.png" />
    </Frame>

    Đặt tên cho script mà bạn mong muốn (ví dụ: `tutorial`) rồi bấm **Create**.

    <Frame>
      <img src="https://mintcdn.com/farmsync-bb893348/04MM8D0921TGN18C/images/automation/scripts/input-script-name.png?fit=max&auto=format&n=04MM8D0921TGN18C&q=85&s=3f725c698d090cb532115f417190b05b" alt="Đặt tên script và bấm Create" width="891" height="240" data-path="images/automation/scripts/input-script-name.png" />
    </Frame>
  </Step>

  <Step title="Thêm nội dung và lưu">
    Sau khi tạo xong, giao diện sẽ hiển thị:

    * Bên trái: danh sách các script của bạn (mới tạo sẽ xuất hiện ở đây)
    * Bên phải: vùng soạn thảo nội dung script

    <Frame>
      <img src="https://mintcdn.com/farmsync-bb893348/04MM8D0921TGN18C/images/automation/scripts/created-script.png?fit=max&auto=format&n=04MM8D0921TGN18C&q=85&s=434117b35537b940253649793daa94fd" alt="Script vừa tạo hiển thị trong danh sách" width="1536" height="682" data-path="images/automation/scripts/created-script.png" />
    </Frame>

    Nhập nội dung script của bạn vào khung soạn thảo.

    <Frame>
      <img src="https://mintcdn.com/farmsync-bb893348/04MM8D0921TGN18C/images/automation/scripts/add-script.png?fit=max&auto=format&n=04MM8D0921TGN18C&q=85&s=d2845b6bc3d1e46b0925885256f2cc51" alt="Thêm nội dung script và lưu lại" width="995" height="650" data-path="images/automation/scripts/add-script.png" />
    </Frame>

    Nhấn **Save** để lưu (hoặc bật **Auto-save** để lưu tự động).

    <Check>
      Bạn đã hoàn thành việc tạo Script thành công.
    </Check>
  </Step>
</Steps>

<Tip>
  Đặt tên script ngắn gọn, dễ nhớ và có ngữ nghĩa để thuận tiện quản lý về sau.
</Tip>
