Class: Cleaner::Actions::Label
- Inherits:
-
Cleaner::Action
- Object
- Cleaner::Action
- Cleaner::Actions::Label
- Defined in:
- lib/cleaner/actions/label.rb
Constant Summary collapse
- COLORS =
{ :white => 0, :orange => 1, :red => 2, :yellow => 3, :blue => 4, :purple => 5, :green => 6, :gray => 7, }
Instance Attribute Summary
Attributes inherited from Cleaner::Action
Instance Method Summary collapse
Methods inherited from Cleaner::Action
Constructor Details
This class inherits a constructor from Cleaner::Action
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cleaner/actions/label.rb', line 14 def execute code = COLORS[[:color]] files.each do |path| script = %Q{tell application \\"Finder\\" to set label index of file (POSIX file \\"#{path}\\") to #{code}} `osascript -e "#{script}"` end end |