tag
The eagle.tag API allows easy access to the tags in the current application.
// Get all tags
const tags = await eagle.tag.get();
// Filter tags by name
const designTags = await eagle.tag.get({ name: "design" });
// Get recently used tags
const recents = await eagle.tag.getRecentTags();
// Get starred tags
const starred = await eagle.tag.getStarredTags();Methods
get(options)
Retrieves tags with optional filtering.
optionsObject (optional) - Query conditionsnamestring (optional) - Filter tags by name with fuzzy search, case-insensitive
Returns
Promise<tags: Object[]>- the query result for tags.
getRecentTags()
Retrieves the most recently used tags.
Returns
Promise<tags: Object[]>- the query result for tags.
getStarredTags()
Retrieves starred tags (user's favorite tags).
Returns
Promise<tags: Object[]>- the query result for tags.
merge(options)
Merges tags: renames the source tag to the target tag, automatically updating all items using the source tag.
optionsObject - Option parameterssourcestring - Source tag name (will be removed)targetstring - Target tag name (will be kept after merge)
Returns
Promise<Object>- Merge resultaffectedItemsnumber - Number of affected itemssourceRemovedboolean - Whether the source tag was removed
Class: Tag
Object type returned by Eagle API get, providing modification and save functionality.
Instance Methods
save()
Save tag modifications. Currently only supports modifying tag names.
Returns
Promise<result: boolean>-resultwhether the modification was successful
Instance Properties
name string
Tag name. This property can be modified and saved through the save() method.
count number
Read-only, number of files using this tag.
color string
Tag color.
groups string[]
Read-only, groups the tag belongs to.
pinyin string
Read-only, pinyin of tag name (for search and sorting).
Last updated