Colour in Finder if Clipping Path found
1 år, 4 månader sedan
Taggad: applescript, script
Here’s an AppleScript I made that checks images files for clipping paths and then labels the files with colour in Finder. Works with drag & drop. Click here to download.
on run display dialog "Drop files onto this file to process them" end run -- DETERNIME IF ITS A FOLDER DROPPED AND FORWARD TO THE FUNCTION process_item on open these_items repeat with i from 1 to the count of these_items set this_item to (item i of these_items) set the item_info to info for this_item if folder of the item_info is true then process_folder(this_item) else if (alias of the item_info is false) then process_item(this_item) end if end repeat end open on process_folder(this_folder) set these_items to list folder this_folder without invisibles repeat with i from 1 to the count of these_items set this_item to alias ((this_folder as text) & (item i of these_items)) set the item_info to info for this_item if folder of the item_info is true then process_folder(this_item) else if (alias of the item_info is false) then process_item(this_item) end if end repeat end process_folder -- /////////////////////////////////////////////////////////////////////////////////////////////////////////////// on process_item(this_item) tell application "Adobe Photoshop CS3" activate open this_item 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 this_item 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 this_item 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 this_item to 5 end tell end if end if end tell -- CLOSE THE FILE close current document saving no end tell end process_item