我需要在finder注释中添加一些文本字符串,代码是:
awk '{{sub(/.*\//,"", $2);};for(i=0; i<=NF; ++i){if(i>3){a=a" "$i}};system("xattr -w com.apple.FinderInfo a $2"};a=""}' comments.txt
,但是它不起作用。还有第二种方法,但仍然无法使用:
makecomment(){
osascript -e 'on run {f, c}' -e 'tell app "Finder" to set comment of (POSIX file f as alias) to c' -e end "$1" "$2"
}
awk '{{sub(/.*\//,"", $2);};for(i=0; i<=NF; ++i){if(i>3){a=a" "$i}};system(""makecomment" $2 a"); a=""}' comments.txt
其次,如何在finder画廊视图中预览Spotlight评论