# 取得數據

你可以透過 Eagle Plugin API 提供的方法存取儲存在 Eagle 應用的各種數據，比如`檔案`、`資料夾`、`資源庫`等，這裏有一些簡單的範例：

## **範例一：取得當前應用選中的檔案**

```javascript
let selected = await eagle.item.getSelected();
console.log(selected);
```

## **範例二：取得指定條件之檔案**

```javascript
let items = await eagle.item.get({
    ids: [],
    isSelected: true,
    isUnfiled: true,
    isUntagged: true,
    keywords: [""],
    ext: "",
    tags: [],
    folders: [],
    shape: "square",
    rating: 5,
    annotation: "",
    url: ""
});

```

## **範例三：取得當前應用選中的資料夾**

```javascript
let folders = await eagle.folder.getSelected();
```

除上述外，Eagle Plugin API 還提供許多不同的 API 取得資訊，請點擊下方連結查看完整資訊：

* [資源庫](/plugin-api/zh-tw/api/library.md)
* [項目](/plugin-api/zh-tw/api/item.md)
* [資料夾](/plugin-api/zh-tw/api/folder.md)
* [應用](/plugin-api/zh-tw/api/app.md)
* [作業系統](/plugin-api/zh-tw/api/os.md)
* [通知](/plugin-api/zh-tw/api/notification.md)
* [對話框](/plugin-api/zh-tw/api/dialog.md)
* [剪貼板](/plugin-api/zh-tw/api/clipboard.md)
* [日誌](/plugin-api/zh-tw/api/log.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.eagle.cool/plugin-api/zh-tw/tutorial/get-eagle-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
