Anyone managed to add a session favorite or album?
Anyone managed to add a session favorite or album?
CODE: SELECT ALL
set newCol to make new collection of document 1 with properties {kind:album, name:"selected"}
just results in missing value error....?
CODE: SELECT ALL
set newCol to make new collection of document 1 with properties {kind:album, name:"selected"}
just results in missing value error....?
0
-
The working code that I use is this:
repeat
tell application "Capture One 12" to tell ref2ResultProject
if not (exists collection named (get nameResultAlbum & coll_ctr)) then
set nameResultAlbum to (get nameResultAlbum & coll_ctr)
set ref2ResultAlbum to make new collection with properties {kind:album, name:nameResultAlbum}
exit repeat
else
set coll_ctr to coll_ctr + 1
end if
end tell
end repeat
This based on this post
I think what might work for you is this:
tell application "Capture One 12" to tell document 1 to set ref2NewAlbum to make new collection with properties {kind:album, name:"selected"}
I think its useful and important to take note of Capture One's Applescript dictionary entry for Make
make v : Create a new object.
make
new type : The class of the new object.
[at location specifier] : The location at which to insert the object.
[with data any] : The initial contents of the object.
[with properties record] : The initial values for properties of the object.
→ specifier : The new object.
You can probably include something like this to add the selected variants when you create the collections:
with data (every variant whose selected is true)
For a session, if you use favorite instead of album then you likely have to specify the folder property, since a favorite cannot exist without a folder. This might either come as a property, as in:or perhaps with the the [at location specifier] clause as in
set ref2NewAlbum to make new collection with properties {kind:favorite, name:"selected", folder:someFolderRef}
set ref2NewAlbum to make new collection with properties at someFolderRef with properties {kind:favorite, name:"selected"}
I have not tried using the [at location specifier] clause. Mostly I use catalogs, perhaps if the location is not specified, a default location is used.
As always, proceed one step at a time. Get something that works, the minimum function. Then add stuff one step at a time.0
Post is closed for comments.
Comments
1 comment