如何设置焦点评论使用 Bash 获取文件夹。(或 Applescript)
下面的例子不起作用:
osascript -e "tell application \"Finder\" to set comments of alias POSIX file \"$folder\" to \"This is a spotlight comment\"
答案1
我修改了这个答案成为您可以在其中定义的函数~/.bash_profile
,它似乎适用于文件或文件夹:
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"
}
用法:
makecomment foldername "My comment"