Question About Variants
In Applescript, we can ask either the application or the collection about variants, and get entire list, the list of names or the list of IDs as an identifier.
For example, this code works:
However, asking CaptureOne to find a variant whose name or ID is a certain value doesn't seem to work. The code below crashes. All the variations that I have tried also crash.
Has anybody found a way to make this kind of request work?
For example, this code works:
tell application "Capture One 11" to set selectedVariantsList to every variant whose selected is true
tell application "Capture One 11" to set selectedVariantsIDList to the id of every variant whose selected is true
repeat with thisvariant in selectedVariantsList
tell application "Capture One 11" to tell thisvariant
set {variantName, variantID} to {name, id}
end tell
.......
end repeat
However, asking CaptureOne to find a variant whose name or ID is a certain value doesn't seem to work. The code below crashes. All the variations that I have tried also crash.
tell application "Capture One 11" to set selectedVariantsIDList to the id of every variant whose selected is true
repeat with thisvariantID in selectedVariantsIDList
tell application "Capture One 11" to set thisvariant to the variant whose ID is thisvariantID
........
end repeat
Has anybody found a way to make this kind of request work?
0
-
Just for my understanding. You have an external list of names or IDs and you want to reduce your actual selection to those images from that list?
Regards,
Hans0 -
[quote="HansB" wrote:
Just for my understanding. You have an external list of names or IDs and you want to reduce your actual selection to those images from that list?
Regards,
Hans
It's more like this.
Sometimes I want scripts to run on every variant in my catalog, sometimes on every variant in an album or project or folder, and sometimes on just those variants which I have selected. It depends on what the script does - it may update metadata or keywords, or it may find variants with missing files, or find which collections the variants are contained in. And in the future, other actions.
However, when COP sends information about a variant, it sends quite a lot of data. Many properties and values are sent, most of which are not required for the script.
In the case of a small number of variants (in collection or selected) this does not matter.
Asking COP for many variants, in case of a large collection or a large number of selected variants, requests a very large amount of data in total, which can cause the use of a great deal of RAM, and it can cause an Apple Event time out after about 2 minutes, which causes the Applescript to stop (crash, actually)
For example, I am updating the Metadata in my catalog which contains 15000 images. All of the images which come from one camera type is about 7100. I want to update the metadata in each one. Before COP can finish sending "every variant" the Apple Script crashes due to an Apple Event timeout (about 2 minutes)
It would require less RAM and take a shorter time to send just the ID of the 7100 variants. But then once you have the list of variant IDs, as the script goes through them 1 at a time, it must find the variant with that ID.
So then the logical thing to ask COP to return "the variant whose ID is 'xxxx' ". After all, what is the purpose of an ID except to uniquely identify a variant? (The name is not unique) But either I am requesting the information incorrectly, or COP does not support such a query.
I am not sure which is the answer.0 -
Did you ever find an answer to this problem? I'm struggling with exactly the same "I have the image ID, I'd like to manipulate it" problem, and am stymied by this "I can get its ID but not use it" issue...
0
Post is closed for comments.
Comments
3 comments