How to add Variants to an Album??
I need to make an Applescript to do some image sorting.
I can get Applescript to tell Capture One to make a new project or album where ever I want. That part works fine.
However, I cannot for the life of me get Applescript to tell Capture One to actually put variants or images into the new collection.
Manually adding variants works, but not via Applescript.
When I run the code below (or variations of it) I get the message
error "Capture One 10 got an error: You cannot set or change this property of this object." number -10006
tell application "Capture One 10"
tell Current_Doc
set theNewColl to make new collection with properties {kind:album, name:new_collection_name}
set theImageList to get images of Current_Collection_ref
set theVariantList to get variants of Current_Collection_ref
tell the theNewColl
repeat with ctr from 1 to count of theVariantList
move (get item ctr of theVariantList) to theNewColl
end repeat
end tell
end tell
end tell
I've tried
- Creating Projects or Albums
- Different places in the collection hierarchy
- Moving variants or images
- Telling Document or Collection
The move action removes the variant from the source collection, but its unsuccessful in putting it into the target selection.
I get a similar result if I try to move a collection. The collection disapeears from its original location, but doesn't appear at the destination, and I get the same error message.
I've also tried the following, but I get a different error message:
error "Capture One 10 got an error: AppleEvent handler failed." number -10000
ell application "Capture One 10"
tell Current_Doc
set theNewColl to make new collection with properties {kind:album, name:new_collection_name}
set theImageList to get images of Current_Collection_ref
set theVariantList to get variants of Current_Collection_ref
set theNewColl to make new collection with properties {kind:album, name:new_collection_name} with data theVariantList
end tell
end tell
I'd be quite happy to use a copy or duplicate action, but I can't figure that out either.
-
I opened a support ticket on both these items.
Capture One support confirms that moving a variant into a collection is known not to be working in this release but they may be able to add that in the next release.
The problem with not being able to create a new album containing variants has been added to the bug list.
Once I can create a new collection and add variants or images to it I can write some really useful scripts.0 -
Hi Eric,
Are you able to automate smart albums? If so, as a workaround, could you create a smart album that looks for items with a specific metadata tag? Automating the addition of metadata is very easy. A script could add some chosen metadata value and the smart album would see variants with that value added. I guess this would not remove them from the default view but would at least get the selected variants into a separate album.
You may even be the one that helped me get the metadata applied. Here is what we are using:tell application "Capture One 10"
set selectedVariants to (get selected variants)
tell current document
if selectedVariants is {} then
display notification "No images selected - select one or more images"
else
repeat with |counter| from 1 to count of selectedVariants
set thisVariant to item |counter| of selectedVariants
set oldStource to get status source of thisVariant
set contact creator of thisVariant to shootName
set contact creator job title of thisVariant to shootDate
set contact address of thisVariant to modelname
set contact city of thisVariant to timeOfDay
set contact state of thisVariant to baynumber
set contact postal code of thisVariant to photographerName
set contact country of thisVariant to businessunit
end repeat
end if
end tell
end tell
end renameBSC
**Variables being set in a different part of our script.0 -
Thank you Sean, that's a good idea, I'll give it a shot.
It may break when I make too many Smart albums, but I can see it as a useful tool in a number of ways.
I think the key factor here is being able to create part of the rule in AppleScript0 -
Hello Eric,
I read the above post from you and are wondering if you managed to figure this out?
In other words, how to add an image or variant to an Album via Script?I am trying to write my own script where I try to add an image to a custom Album, but I cannot get it to work.
And you wrote then that Capture One confirmed then it was not possible.
The post is five years old, so maybe this have been been fixed, or?
Is it possible to do today?Please advise
Thanks for your help.
Lars
0 -
It is still the case that you can't add only some variants to an album. You can. however, add them to smart albums. So for instance you can add perhaps a green tag to just some of the variants and then only those would appear in a smart album of green-tagged images.
Ian
0 -
Hello Ian,
Thanks for your answer.
Much appreciated!And thanks for the tip regarding using a Smart Album. I will look into that, but at this moment I would like to use normal Albums and add images to that. But I guess I will not succeed that route, so I might have to use Smart Albums ;-)
I saw that I can sort of workaround the whole thing an insert “Group Names” into one of the IPTC fields, and then use rules to get those images into each Smart Album.Can I script Smart Albums?
In other words, can I via scripting create custom Smart Albums and both via scripting custom name them as well as create the rules via script?I do not want to manually create each Smart Album and name that Smart Album and also do not want to manually set up the rules for each Smart Album, but instead do that by code. I am sure I will figure it out if is possible.
But the main question is - if it is even possible to handle those two parts for Smart Albums by code? In other words, does the CO scripting have support for that?Thanks for the help.
Kind regards
Lars
0 -
When it comes to the actual scripting, I can't help, as it is not something I do. I don't know whether someone else will be able to suggest something.
Ian
0 -
Hi Lars,
You can create regular albums easily:
tell application "Capture One 21"
tell current document
make new collection with properties {kind:album, file:"/Users/USERNAME/Folder_Location/", name:"Album Name"}
end tell
end tellAnd looking through the CO21 (v14.4.1) AppleScript dictionary it looks like there is a method for adding variants to albums:
As well as Move Inside:
I assume Add is a copy. I've never done this but that is where I'd start looking for moving files into Albums.
0 -
Hello,
Thanks for your answer.
Much appreciated!I will look into this and see if that will work.
Regards
Lars
0
Post is closed for comments.
Comments
9 comments