item(項目)
eagle.item APIを使用すると、現在のリソースリポジトリの内容を簡単に検索したり、新しい内容をリソースリポジトリに追加することができます。
eagle.onPluginCreate(async (plugin) => {
// Eagle アプリで現在選択されているファイルを取得
let items = await eagle.item.getSelected();
let item = items[0];
// 属性を変更する
item.name = 'New Name';
item.tags = ['tag1', 'tag2'];
// 変更を保存する
await item.save();
});メソッド
get(options)
getAll()
getById(itemId)
getByIds(itemIds)
getSelected()
count(options)
countAll()
countSelected()
select(itemIds)
getIdsWithModifiedAt()
addFromURL(url, options)
addFromBase64(base64, options)
addFromPath(path, options)
addBookmark(url, options)
open(itemId, options)
クラス:Item
インスタンスメソッド
save()
moveToTrash()
replaceFile(filePath)
refreshThumbnail()
setCustomThumbnail(thumbnailPath)
open(options)
select()
インスタンス属性
id string
id stringname string
name stringext string
ext stringwidth Interger
width Intergerheight Interger
height Intergerurl string
url stringisDeleted boolean
isDeleted booleanannotation string
annotation stringtags string[]
tags string[]folders string[]
folders string[]palettes Object[]
palettes Object[]size Interger
size Intergerstar Interger
star IntergerimportedAt Interger
importedAt IntergermodifiedAt Interger
modifiedAt IntergernoThumbnail boolean
noThumbnail booleannoPreview boolean
noPreview booleanfilePath string
filePath stringfileURL string
fileURL stringthumbnailPath string
thumbnailPath stringthumbnailURL string
thumbnailURL stringmetadataFilePathstring
metadataFilePathstring最終更新