An AppleScript to append the containing folder for each selected record to the existing tag set -- "container-to-tag":
tell application "EagleFiler"
set _records to selected records of browser window 1
repeat with _record in _records
if _record's container's name is not "Files" then
set _record's assigned tag names to (_record's assigned tag names & _record's container's name)
end if
end repeat
end tell
An elaborated version that appends the complete hierarchy of containing folders -- "container-hierarchy-to-tags":
tell application "EagleFiler"
set _records to selected records of browser window 1
repeat with _record in _records
get name of _record
set _container to container of _record
set _containerName to _container's name
repeat until _containerName is "Files"
set _record's assigned tag names to (_record's assigned tag names & _containerName)
set _container to container of _container
set _containerName to _container's name
end repeat
end repeat
end tell
Suggested workflow:
- Run script.
- Move records to higher level (highest if running on all records).
- If all records from containing folders have been so moved, trash containing folder(s).
Usage notes:
- [NTIM] Folders are assigned tags.
- [IIMAD] Subfolders with identical names in different folders will be given identical tags.
- [FYI] Spaces in folder names are converted to underscores.