# 取得数据

你可以通过 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-cn/api/library.md)
* [项目](/plugin-api/zh-cn/api/item.md)
* [文件夹](/plugin-api/zh-cn/api/folder.md)
* [应用](/plugin-api/zh-cn/api/app.md)
* [操作系统](/plugin-api/zh-cn/api/os.md)
* [通知](/plugin-api/zh-cn/api/notification.md)
* [对话框](/plugin-api/zh-cn/api/dialog.md)
* [剪切板](/plugin-api/zh-cn/api/clipboard.md)
* [日志](/plugin-api/zh-cn/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-cn/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.
