メインコンテンツへスキップ

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

Copy and Apply adjustments

コメント

1件のコメント

  • Eric Valk
    Apple's Script Editor has such a lousy debugging interface. Script debugger gives so much more information.

    This works, the extra word "to" is the problem:

    tell application "Capture One 20"
    tell current document
    set theVariant to the last variant
    apply adjustments theVariant
    end tell
    end tell

    What you are really working with is the variants that Capture One is showing, so tell current document isn't needed:

    tell application "Capture One 20"
    set theVariant to the last variant
    apply adjustments theVariant
    end tell

    You could actually just write it like this

    tell application "Capture One 12" to apply adjustments (last variant)

    It isn't immediately obvious that this should work, but it does, and is easier to read:

    tell application "Capture One 12" to tell last variant to apply adjustments

    When Applescript sees this construct: tell zzz to yyy it interprets this as: execute the verb yyy onto the object zzz

    In the above line
    tell application "Capture One 12" --> set the default target of following commands to "Capture One 12"
    to tell last variant --> set the default target of following commands to last variant (of Capture One 12)
    to apply adjustments --> apply adjustments, since the target isn't specified after the command, use the default target

    One thing that is really difficult to learn in Applescript is the object model e.g. Application "Capture One" contains variants, and variants are also contained by collections which are contained by documents which are contined by the application.

    Script Debugger has a very useful Object Explorer which shows the object hierarchy, and what's in it for the running application.
    0

投稿コメントは受け付けていません。