Script to Copy from Layer One to Layer Two
Hello C1 Forum Geniuses!
Was hoping one of you Lords could help me write a script to perform a process that I do repeatedly every day - copy a mask from Layer 1, apply to Layer 2, and invert.
As a complete Wally, I'm at the stage of watching YouTube videos entitled 'AppleScript for n00bs' which isn't giving me much joy. Any assistance you could provide would be greatly appreciated,
Thanks,
Tim
Was hoping one of you Lords could help me write a script to perform a process that I do repeatedly every day - copy a mask from Layer 1, apply to Layer 2, and invert.
As a complete Wally, I'm at the stage of watching YouTube videos entitled 'AppleScript for n00bs' which isn't giving me much joy. Any assistance you could provide would be greatly appreciated,
Thanks,
Tim
0
-
Hi Tim
You should only spend so long watching those videos. The best way, and actually the only way, to learn Applescript is learn by doing.
Write a simple script. Then try to add something to it. It's broken. Google the command and the error message. Read the Applescript Dictionary. Open the Script Editor Log window. Check the Applescript events and replies. Fix it.
One of the key things is that when you are writing an Applescript, you should refer to the dictionary. Frequently.
Script Editor has a handy link to the Applescript Language guide. Here, click on the index, click on the first letter of a command, and then you will find all the references to a command. A normal human being can't possibly absorb the entire language reference, but individual sections pertaining to a command are very informative.
You have nothing to loose but your sanity 😄
So:- Make a folder for your Applescripts
- Open up script editor
- Open up the log Window
- Make a new empty script
- Open Up the Applescript dictionary for CaptureOne.
Try this, and compare very line to the Dictionarytell application "Capture One 11"
set theVariantName to name of primary variant
log theVariantName
set theVariant to get primary variant
tell theVariant
set theLayerList to get every layer
repeat with theLayer in theLayerList
log {(get name of theLayer), (get kind of theLayer as text)}
end repeat
invert mask of layer "Layer 1"
set theFirstLayer to get layer "Layer 1"
set theSecondLayer to get layer "Layer 2"
copy mask theFirstLayer to layer theSecondLayer
invert mask of theSecondLayer
end tell
end tell
Do come back and tell us how its going.0 -
Good on you, Eric, that's awesome advice! Thank you - I'm going to have a crack at this now and get back to you.
t0 -
Oh man, that's beautiful! Thanks so much!
(But, one small note for anyone else trying to do this - I had to delete the first 'invert' line otherwise it inverts the first layer rather than the second)
Really appreciate that Eric.0 -
[quote="NN635934285532082544UL" wrote:
Oh man, that's beautiful! Thanks so much!
(But, one small note for anyone else trying to do this - I had to delete the first 'invert' line otherwise it inverts the first layer rather than the second)
Really appreciate that Eric.
You're quite welcome Tim
I wrote it more as an example than as an application. I built it in my usual way, get one action working at a time.
You will probably want to fix it up a bit to choose the layers in more sensible way according to how you use layers, and perhaps you will want it to work on selected variants instead of the primary variant. And you probably don't want all those log messages in the end.0
Post ist für Kommentare geschlossen.
Kommentare
4 Kommentare