Changeset 149
- Timestamp:
- 02/25/06 17:40:36
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/Publish/Spotlight.pm
r145 r149 5 5 use Encode; 6 6 use File::Spec; 7 use Mac:: AppleScript qw(RunAppleScript);7 use Mac::Glue; 8 8 9 9 sub register { … … 40 40 $comment =~ s/<[^>]*>//g; 41 41 $comment =~ s/\n//g; 42 $comment =~ s/"/\\"/g; 43 $comment = encode("shift_jis", $comment); # xxx 44 45 my $script = <<SCRIPT; 46 tell application "Finder" 47 set comment of ((POSIX file "$path") as file) to "$comment" 48 end tell 49 SCRIPT 50 51 RunAppleScript($script) or $context->error("$path: $!"); 42 $comment = encode("shift_jis", $comment); # xxx 43 44 my $finder = Mac::Glue->new("Finder"); 45 my $file = $finder->obj(file => $path); 46 $file->prop('comment')->set(to => $comment); 52 47 } 53 48 }
