Sort File by Mac Label

Post Reply
Danny
Member
Posts: 27
Joined: Wed Dec 08, 2010 5:59 pm

Sort File by Mac Label

Post by Danny »

Hello,

Has anyone had sort files by the color they are labeled? We are running PowerSwitch and I think this would have to be done using applescript. If anyone out there has had to do this or knows how I could write this I'd appreciate the help.

Basically, all I want to do in Switch is to move any file labeled Red one out going connection and send everything else down another connection.



Thanks for any help in advance,



Danny
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Sort File by Mac Label

Post by dkelly »

Hello, the following Applescript retrieves the directory contents sorted by label. You would have to modify it to get the directory name from Switch, instead of asking user, and process its output back into Switch.



set original_element to choose folder

set AppleScript's text item delimiters to {return}



tell application "Finder"

try

set sort column of list view options of original_element to label column

set contents_list to entire contents of original_element as text

on error

set contents_list to {entire contents of original_element as text}

end try

end tell





Sincerely,

Dwight Kelly

Apago, Inc.

dkelly@apago.com
Post Reply