Zum Hauptinhalt gehen

⚠️ Please note that this topic or post has been archived. The information contained here may no longer be accurate or up-to-date. ⚠️

Adding an image to an album

Kommentare

5 Kommentare

  • Eric Valk
    From the Capture One Dictionary (As reported by scriopt Debugger) I get the following listing:

    add inside
    add inside (verb)Add one or more variants to an album collection. (from Capture One Suite)
    COMMAND SYNTAX
    add inside collection ¬
    variants list of variant
    PARAMETERS
    Parameter
    Required
    Type
    Description
    direct parameter required collection An album collection to add the variants to
    variants required list of variant One or more variants to be added
    CLASSES
    The following classes respond to the add inside command:
    collection

    The last two lines are key. Based on this, you can't direct this commmand to the application, you have to direct it to a collection

    So I think your code needs to read:

    tell application "Capture One 12" to to tell _collection to add inside _collection variants {_image}
    0
  • Thanks Eric, silly me.

    But even with the fix I get the error (probably there's another issue).

    This is what I read in the event log:


    tell application "Capture One 12"
    add inside collection id "8459" of collection id "8458" of collection id "8457" of collection id "8456" of collection id "8455" of document "Fabrizio's Catalog" variants {image id "19016" of collection id "2" of document "Fabrizio's Catalog"}
    --> error number -10000
    Result:
    error "Capture One 12 got an error: AppleEvent handler failed." number -10000


    The collection ids make sense - it's a branch of four groups plus a final album, just created.
    0
  • Eric Valk
    I think that I have given bad advice.

    Your code seems to match my working code. I've seen this error 10000 recently and got round it, but I can't quite remember the details..

    I checked my working code (a script that marks image sequences) , and found this (checked it just now)

    tell application "Capture One 12"
    add inside refSequenceAlbum variants selVariantsRefL
    end tell

    The event is this (there was no reply)

    add inside collection id "1633" of collection id "1629" of collection id "100" of document "TestStacks" variants {variant id "979" of collection id "101" of collection id "100" of document "TestStacks", variant id "980" of collection id "101" of collection id "100" of document "TestStacks", variant id "981" of collection id "101" of collection id "100" of document "TestStacks", variant id "982" of collection id "101" of collection id "100" of document "TestStacks", variant id "983" of collection id "101" of collection id "100" of document "TestStacks"}

    I then created this test code, which works

    use AppleScript version "2.4" -- Yosemite (10.10) or later
    use scripting additions
    tell application "Capture One 12"
    tell current document to set theTargetAlbum to collection "Album2" of collection "GroupA"
    tell current document to set selVariantsRefL to {variant 1} of collection "all Images"
    add inside theTargetAlbum variants selVariantsRefL
    end tell

    Its unclear to me what the problem with your code is.
    0
  • I suspect that the _image is not what is supposed to be, even though if it get logged as being the same.
    I did a little change:


    tell application "Capture One 12" to set _imagesToAdd to {_image as image}
    tell application "Capture One 12" to add inside _collection variants _imagesToAdd


    That is, basically I forced a cast "as image" (I'm also using a temporary collection, but I suppose it doesn't matter). Now I'm getting:


    error "Can’t make image id "41488" of collection id "188" of collection id "186" of collection id "47" of collection id "35" of document "Fabrizio's Catalog" into type image." number -1700 from «class cimg» id "41488" of «class COcl» id "188" of «class COcl» id "186" of «class COcl» id "47" of «class COcl» id "35" of document "Fabrizio's Catalog" to «class cimg»


    I don't know what «class cimg» is, but I presume - for analogy - that I should have a «class COimg», or something like that?
    0
  • Ok, found it: my _image must be a variant, not an image... The command, after all, mention 'variants'.
    0

Post ist für Kommentare geschlossen.