Copy and Apply adjustments
Hi there! I'm trying to apply adjustments to the last variant in a folder in C1 using a script. Currently I'm able to apply a user style, but I cant find any examples of how to apply settings from the Adjustments Clipboard. Ideally I'd like to be able to copy settings to clipboard from an image with a script, and then apply them to the last variant with another like the one below:
The dictionary shows "copy adjustments" and "apply adjustments" as options, but "apply adjustments to theVariant" doesn't work, and I have no idea how to figure out the proper syntax. Can someone point me in the right direction?
Thanks!
Priam
tell application "Capture One 20"
tell current document
set theVariant to the last variant
apply adjustments to theVariant
end tell
end tell
The dictionary shows "copy adjustments" and "apply adjustments" as options, but "apply adjustments to theVariant" doesn't work, and I have no idea how to figure out the proper syntax. Can someone point me in the right direction?
Thanks!
Priam
0
-
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
投稿コメントは受け付けていません。
コメント
1件のコメント