set myFilePath to "Macintosh HD:Users:mySelf:Desktop:file.txt" as text
tell application "Finder" to set comment of myFilePath to "testing"
and yet, the code returns:
Can’t set «class comt» of "Macintosh HD:Users:mySelf:Desktop:file.txt" to "testing". (-10006)
However, if we have the following code:
set tFile to choose file
log tFile
set tComment to text returned of (display dialog "Please enter the comment below" default answer "Comment Here")
tell application "Finder" to set comment of tFile to tComment
The code logs tFile as
<NSAppleEventDescriptor: 'alis'($000000000132000200000C4D6163696E746F7368204844000000000000000000000000000000C789A404482B0000035A38310C43726F77426172322E747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035A3836CA3E41515445585400000000FFFFFFFF00004920000000000000000000000000001000080000C789EA540000001100080000CA3E79910000000E001A000C00430072006F00770042006100720032002E007400780074000F001A000C004D006100630069006E0074006F007300680020004800440012003055736572732F4576616E5363686F66667374616C6C2F4465736B746F702F53706163652F43726F77426172322E747874001300012F00001500020016FFFF000000000000$)>
and does exactly what I want it to,
but I don't want to choose a file! What in goodness gracious? I tried as alias and as POSIX file and as |path|()'s |URL|() and on and on.
Nothing works execpt choose file and I have no idea why? Please help?