Copy link to clipboard
Copied
I'm just beginning to learn how to script for Photoshop, and I'm running into an issue I can't find an answer to anywhere. I'm using Applescript, since I'm a scripting novice. The problem is that I can't get scripts to work if the target layer is contained within an artboard. For example, take the following simple test script that hides any layer named "Test":
tell application "Adobe Photoshop CC 2019"
set myDoc to current document
tell myDoc
set the properties of (every art layer whose name is "Test") to {visible:false}
end tell
end tell
My test file has one "Test" layer inside an artboard, and two outside. As you can see below, only the two outside the artboard were modified.
Is it possible to tell Photoshop to look inside artboards with Applescript?
Moved to Scripting forum. [Moderator]
Copy link to clipboard
Copied
If you're just starting scripting, I would suggest to use javascript, as more people know that and can help you, and it's cross platform.
Copy link to clipboard
Copied
not exactly the answer he was looking for yes java scripting is very helpful but... Can this be done useing Applescript. I have a simmlar question that involves how to manuver through artboards and layer groups.
Copy link to clipboard
Copied
I believe that the original 2019 post went unanswered due to the very reasons mentioned by Chuck.
Perhaps check on the MacScripter site:
https://www.macscripter.net/tag/adobe
Without reading the AS ref guide, I would guess that layers within groups are navigated in a similar way to JS.
Copy link to clipboard
Copied
Agreed Chuck, IMHO these points are more crucial than the touted "simplicity" of AppleScript vs ExtendScript/JavaScript.
Additionally, sometimes one has to inject Action Manager JS code into the AS code to work around limitations with the DOM.