How do I set a spotlight comment for a folder using Bash. (Or Applescript)
The following example is not working:
osascript -e "tell application \"Finder\" to set comments of alias POSIX file \"$folder\" to \"This is a spotlight comment\"
How do I set a spotlight comment for a folder using Bash. (Or Applescript)
The following example is not working:
osascript -e "tell application \"Finder\" to set comments of alias POSIX file \"$folder\" to \"This is a spotlight comment\"
I modified this answer to be a function you can define in your ~/.bash_profile and it seems to work for files or folders:
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"
}
USAGE:
makecomment foldername "My comment"