selectAllEntries, addTags

This commit is contained in:
2021-06-27 23:33:49 -06:00
parent c1860d9200
commit a3b64f6477

View File

@@ -140,6 +140,9 @@
(defcommand selectEntries [entries (Entries null null)]
(set selectedEntries entries) [])
(defcommand selectAllEntries []
(set selectedEntries (for =>id e archive.entries e)) [])
(defcommand selectLastChangeSet []
(set selectedEntries lastChangeSet) [])
@@ -152,4 +155,14 @@
(defcommand createEntries [names (VarText null)]
(flatten (for name names
(createEntry name)))))
(createEntry name))))
(defcommand addTags [entries (SelectedEntries 1 null)
tagsToAdd (VarText null)]
(doFor e entries
(withWritableEntry archive e
(if (hasComponent e Tags)
(withWritableComponents archive e [tags Tags]
(doFor tag tagsToAdd (dictSet tags tag 1)))
(addComponent archive e Tags (for tag tagsToAdd =>tag 1)))))
entries))