Skip to main content
Participant
October 20, 2008
Question

[AS][Photoshop] Checking if there is any paths or clipping paths

  • October 20, 2008
  • 1 reply
  • 328 views
Hey guys,

I would like to determine if there is any paths or clipping paths in the files dropped onto the droplet. Then sort them into different folders. One folder for files with paths and one for without paths. Getting the files to move I think I can manage, but I can't get checking for the paths to work. Anyone got a clue? This is how far I have got.

> on open fileList
> tell application "Adobe Photoshop CS3"
> activate
>
>
> repeat with thisFile in fileList
> open thisFile showing dialogs never
>
> set CountOfPaths to count of path items
> display dialog CountOfPaths
>
> end repeat
>
> end tell

end open
This topic has been closed for replies.

1 reply

Participant
October 23, 2008
Solved it! :D

on open fileList
tell application "Adobe Photoshop CS3"
activate


-- DO WITH EVERY FILE DROPPED ONTO THE DROPLET
repeat with thisFile in fileList
open thisFile showing dialogs never



tell current document

-- CHECK FOR PATHS
set CountOfPaths to every path item
if CountOfPaths is equal to {} then



-- IF THERE'S NO PATH
tell application "Finder"

-- MAKE RED IN FINDER
set the label index of thisFile to 2

end tell

else


-- IF THERE IS A _CLIPPING PATH_
if exists (every path item whose kind is clipping) then


tell application "Finder"

-- MAKE GREEN IN FINDER
set the label index of thisFile to 6

end tell

else

-- IF THERE IS A PATH BUT _NO_ CLIPPING PATH

tell application "Finder"

-- MAKE PURPLE IN FINDER
set the label index of thisFile to 5

end tell

end if


end if





end tell

-- CLOSE THE FILE
close current document saving no


end repeat







end tell

end open