Skip to content

Instantly share code, notes, and snippets.

@emorydunn
Created July 8, 2024 23:45
Show Gist options
  • Save emorydunn/2a6c4e6b75f1687194ac27d811184512 to your computer and use it in GitHub Desktop.
Save emorydunn/2a6c4e6b75f1687194ac27d811184512 to your computer and use it in GitHub Desktop.
An script for Capture One which creates monthly collections for the current year.
tell front document of application "Capture One 22"
set theYear to year of (current date) as string
--set theYear to "2012"
-- Make year group
set theYearGroup to make new collection with properties {name:theYear, kind:group}
-- Make month groups
repeat with i from 1 to 12
-- Update date for month in the loop
set theDate to current date
set month of theDate to i
-- Pad the month to two digits
set paddedMonth to text -2 thru -1 of ("00" & i)
-- Make the collection
set collectionName to (paddedMonth & " " & month of theDate) as string
my makeMonth(collectionName, theYearGroup)
end repeat
end tell
on makeMonth(collectionName, parentCollection)
tell front document of application "Capture One 22"
tell parentCollection
set monthGroup to make new collection with properties {name:collectionName, kind:group}
tell monthGroup to make new collection with properties {name:"Misc. Street", kind:album}
end tell
end tell
end makeMonth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment