I have a question about selecting the clipping path of a photoshop document when it opens.
I would just do an ps action but the names of the clipping paths change from image to image.
This is what I have but the last sentence is wrong
tell application "Adobe Photoshop CS2"
activate
set theClippingPath to every path item whose kind is equal to clipping
make photoshop selection of theClippingPath
end tell
I’m kinda guessing here, since I’m new to AS myself, but I believe that theClippingPath in your AS is an array (or collection), not the actual clipping path. Update your last line to:
make photoshop selection of the first path of theClippingPath
Do you want to “select” a path item or “create selection” of a path item?
To select a path item to perform a task goes like this:
tell application "Adobe Photoshop CS2"
activate
set Doc_Ref to the current document
tell Doc_Ref
set theClippingPath to every path item whose kind is clipping
select theClippingPath
-- do your stuff here
end tell
end tell
To create selection of a path item goes like this:
tell application "Adobe Photoshop CS2"
activate
set Doc_Ref to the current document
tell Doc_Ref
set theClippingPath to every path item whose kind is clipping
create selection theClippingPath feather amount 0 with antialiasing
end tell
end tell
if exists (path items whose kind is clipping) then
set Clip to (name of every path item whose kind is clipping)
create selection path item (item 1 of Clip) feather amount 0 with antialiasing