Bug Report - Get Every Collection

Discussion regarding all scripting related questions
Please DO NOT post to this thread anything that is not directly related to scripting of Capture One.

Bug Report - Get Every Collection

Postby Eric Nepean » Sat Jul 01, 2017 10:42 pm

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.

Code: Select all
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
Cheers
Eric
(OSX 10.12, iMac and MacBook Air, Panasonic GX7,GM5,G5, Olympus E-M1)
Eric Nepean
 
Posts: 385
Joined: Sat Jun 28, 2014 8:54 pm
Location: Ontario, Canada

Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest