How to add Variants to an Album??

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

How to add Variants to an Album??

Postby Eric Nepean » Sun Jul 02, 2017 9:11 pm

Does anybody know how to use Applescript to move variants or images into an album?? I'm tearing my hair out trying to get this to work.

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

Code: Select all
   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

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

Re: How to add Variants to an Album??

Postby Eric Nepean » Tue Jul 11, 2017 3:05 am

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

Re: How to add Variants to an Album??

Postby SeanMurp » Wed Jul 12, 2017 7:41 pm

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:
Code: Select all
   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.
SeanMurp
 
Posts: 28
Joined: Wed Nov 02, 2016 4:30 am

Re: How to add Variants to an Album??

Postby Eric Nepean » Wed Jul 12, 2017 10:44 pm

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 AppleScript
Cheers
Eric
(OSX 10.11, iMac and MacBook Air, Panasonic GX7,GM5,G5, Olympus E-M1)
Eric Nepean
 
Posts: 315
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 2 guests