Am I missing something.
Using some ASObjC pieces of code, I may get POSIX path or file objects which are in fact «class furl» ones.
Sometimes, I must use “Finder” to make some treatments and I get puzzling behaviors which you will see as comments in the sample below.
set unHfs to choose folder
set unPosix to POSIX path of unHfs
set aFile to POSIX file unPosix
log class of aFile
tell application "Finder"
try
exists aFile
log result --> true
on error errMsg number errNbr
log "Error #" & errNbr & ", " & errMsg
end try
try
name of aFile
log result
on error errMsg number errNbr
log "Error #" & errNbr & ", " & errMsg
(*Error #-1728, Erreur dans Finder : Il est impossible d'obtenir name of file "SSD 500:Users:yvankoenig:Desktop:2002 après:".*)
end try
try
set locked of aFile to true
log result
on error errMsg number errNbr
log "Error #" & errNbr & ", " & errMsg
(*Error #-10006, Erreur dans Finder : Il est impossible de régler locked of file "SSD 500:Users:yvankoenig:Desktop:2002 après:" à true.*)
end try
try
set label index of aFile to 2
log result
on error errMsg number errNbr
log "Error #" & errNbr & ", " & errMsg
(*Error #-10006, Erreur dans Finder : Il est impossible de régler label index of file "SSD 500:Users:yvankoenig:Desktop:2002 après:" à 2.*)
end try
end tell
I’m surprised to see that the Finder is able to see that a «class furl» object is available but seems to be unable to get or set properties of the same object.
Am I missing something ?
I thought to a conflict between file as class defined by the Finder and file as prefix of a «class furl» object but if it’s that it would logically strike with exists command too.
Yvan KOENIG running El Capitan 10.11.6 in French (VALLAURIS, France) jeudi 15 septembre 2016 11:52:35