Creating smart album from AppleScript: syntax reference?
Hello.
Looking at some samples posted on this forum time ago I was able to use AppleScript to create smart albums that filter by year and date, that is using this chunk of XML as the smart album rules:
<?xml version="1.0" encoding="UTF-8"?>
<MatchOperator Kind="AND">
<Condition Enabled="YES">
<Key>_date_yearMonth</Key>
<Operator>0</Operator>
<Criterion>2021-07</Criterion>
</Condition>
</MatchOperator>
Now I wold like to create smart album that filter by keyword; I guessed something like that:
<Condition Enabled="YES">
<Key>_keywords</Key>
<Operator>0</Operator>
<Criterion>foo bar</Criterion>
</Condition>
but it doesn't work. Is there a syntax reference for all the kinds of rules one could implement?
Thanks.
-
Ok... looking at the database dump I was able to guess the proper key, it's IB_S_CONTENT_KEYWORDS.
Nevertheless: is there a syntax reference?
0 -
I've not ever found one. I just create a smart album in the UI with the sort of criteria I'm interested in creating in code and examine the result with something like this:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "Capture One 20"
tell current document
set aSmartAlbum to some collection whose name is "<test album name>"
log rules of aSmartAlbum as text
end tell
end tell<test album name> will be the name of the smart album you created in the UI.
0 -
Thanks for the tip, it makes sense and it is faster than dumping the database and inspecting it.
0
Post ist für Kommentare geschlossen.
Kommentare
3 Kommentare