There’s a private api called “indexInGroup()” you can use on a layer object. Try that out and let me know if it works for what you’re trying to do. If it does, I’ll add it to the official API (or come up with another way to get what you’re after).
(The non-private way is to loop through a group’s layer and increment some value until you come across the layer you’re curious about)
That looks a bit cocoascripty. I should add that I don’t have a clue about CocoaScript and instead spend time torturing myself with AppleScript Syntax.
So is that private API available there?
Thanks
Rob
tell application "Acorn"
tell front document
set this_layer to indexingroup
end tell
end tell
this_layer
I just put up a new build of Acorn, where the paste command returns the layer if a layer was created. You can grab it from here: Latest Builds from Flying Meat
Here’s a sample script which will do what you’re after (and let me know if not!)
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "Acorn"
tell document 1
set curLayer to current layer
copy
set newLayer to paste
set current layer to curLayer
deselect
tell layer 1
load filter preset name "Exposure Preset"
end tell
set current layer to newLayer
end tell
end tell
apologies for the delay in responding. Thanks for that.
that appears to do the trick, nice!!! I changed the script ever so slightly.
Thanks
use scripting additions
tell application "Acorn"
tell document 1
set curLayer to current layer
copy
set newLayer to paste
set current layer to curLayer
deselect
load filter preset name "exposure_down_6"
end tell
end tell