Bug Report - Get Every Collection
It's unclear to me if this is a bug or an intended change. Either way, it will likely cause bugs in Applescripts that access Capture One Collections.
If you execute the the code below, Capture One returns an unexpectedly long list of collections.
Not only does the list include the top level collections of the Capture One document (as expected), it includes an item called "Catalog" and recursively lists every folder connected to Capture One's "Folder" item. In my case about 110 folders.
The last item on the list is the current collection.
This also has an effect on Applescript error messages that refer to collections. No longer do you get a message that refers to "collection 4 of collection 8 of collection 2 of MY_DOCUMENT of application Capture One 10". You get an error message that refers to "collection N of MY_DOCUMENT of application Capture One 10", where N is the length of the list I refer to above, and so N is the same no matter which collection you have chosen. (in my case 116).
There is another more subtle effect. Suppose an Applescript obtains a reference to the current collection. Let's say the Applescript runs for a while, a few seconds or minutes. While it is running suppose the user clicks on a different collection.
Now, even thought the Applescript doesn't obtain a new reference to the collection, the reference it has already obtained now points at a different collection (the one the user has selected). The Applescript has no way of discovering that the reference it is using now points to a different object.
This is also affects images and variants. The user clicks on a new album, and suddenly the reference obtained as image 1 of current collection points to a different image.
This can get crazy real fast if the Applescript is doing useful thinfgs like changing the properties of images and variants.
If you execute the the code below, Capture One returns an unexpectedly long list of collections.
Not only does the list include the top level collections of the Capture One document (as expected), it includes an item called "Catalog" and recursively lists every folder connected to Capture One's "Folder" item. In my case about 110 folders.
The last item on the list is the current collection.
This also has an effect on Applescript error messages that refer to collections. No longer do you get a message that refers to "collection 4 of collection 8 of collection 2 of MY_DOCUMENT of application Capture One 10". You get an error message that refers to "collection N of MY_DOCUMENT of application Capture One 10", where N is the length of the list I refer to above, and so N is the same no matter which collection you have chosen. (in my case 116).
There is another more subtle effect. Suppose an Applescript obtains a reference to the current collection. Let's say the Applescript runs for a while, a few seconds or minutes. While it is running suppose the user clicks on a different collection.
Now, even thought the Applescript doesn't obtain a new reference to the collection, the reference it has already obtained now points at a different collection (the one the user has selected). The Applescript has no way of discovering that the reference it is using now points to a different object.
This is also affects images and variants. The user clicks on a new album, and suddenly the reference obtained as image 1 of current collection points to a different image.
This can get crazy real fast if the Applescript is doing useful thinfgs like changing the properties of images and variants.
tell application "Capture One 10"
set Current_Doc to current document
tell Current_Doc
get every collection
get name of every collection
end tell
end tell
0
Post is closed for comments.
Comments
0 comments