Re-Setting Favorites folder

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

Re-Setting Favorites folder

Postby NN635011283150781994UL » Mon Jul 01, 2019 6:46 pm

Q: Where are favorites saved in Capture One?

Trying to find ways around favorites both during capture and after the fact when processing files. Curious if anyone has any scripting suggestions to add capture folders to a session album (Not favorites) or remove all items from favorites once a shoot is wrapped.
NN635011283150781994UL
 
Posts: 1
Joined: Tue Apr 09, 2013 7:18 pm

Re: Re-Setting Favorites folder

Postby emorydunn » Tue Jul 09, 2019 6:48 pm

You can remove favorites with the following script:

Code: Select all
tell front document of application "Capture One 12"
   delete (every collection whose kind is favorite and user is true)
end tell


This one will create create an album for the capture folder and add all of the variants. However, Capture One throws an error when making an album with the same name as the Capture Folder even though adding an album from C1 works. This might be a bug in how C1 handles making new collection from AppleScript. As a work around the album gets " 1" at the end.

Code: Select all
tell front document of application "Capture One 12"
   
   set captureCollection to item 1 of (collections whose kind is favorite and id is "capture")
   log name of captureCollection as string
   set captureDir to captures
   
   tell application "Finder" to set captureName to (name of folder captureDir)
   
   try
      -- C1 throws an error when making an album with the same name as the Capture Folder
      -- even though adding an album from C1 works
      set tempName to captureName & " 1"
      if (count of (collections whose kind is album and name is tempName)) is equal to 0 then
         set newAlbum to make collection with properties {name:tempName, kind:album}
         add inside newAlbum variants every variant of captureCollection
      end if
   on error errMsg
      log errMsg
      display dialog errMsg buttons {"OK"} default button "OK"
   end try
   
end tell
User avatar
emorydunn
 
Posts: 17
Joined: Fri Jun 14, 2013 7:36 am
Location: San Francisco, California


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest