When I ran it for the first time one of my scripts under Sierra, I discovered that it failed.
Looking carefully at the History, I understood what was the wrongdoer.
In this script, I used this handler :
#=====
on getNameAndContainer:PosixPath
local theURL, PosixContainer, PosixName
--|-- log "Entre dans getNameAndContainer"
set theURL to current application's |NSURL|'s fileURLWithPath:PosixPath
set PosixContainer to theURL's URLByDeletingLastPathComponent()
set PosixName to theURL's lastPathComponent()
# set {theResult, theNameHfs} to (theURL's getResourceValue:(reference) forKey:(current application's NSURLLocalizedNameKey) |error|:(missing value)) # pour un nom Hfs
return {PosixName as text, POSIX path of (PosixContainer as text)}
end getNameAndContainer:
#=====
The second returned value is a posix path of a folder which ended with a slash.
With Sierra, the ending slash was missing. So, to get rid of that and keep my script able to run under 10.10, 10.11 and 10.12 I edited the handler as :
#=====
on getNameAndContainer:PosixPath
local theURL, PosixContainer, PosixName
--|-- log "Entre dans getNameAndContainer"
set theURL to current application's |NSURL|'s fileURLWithPath:PosixPath
set PosixContainer to theURL's URLByDeletingLastPathComponent()
set PosixName to theURL's lastPathComponent()
# set {theResult, theNameHfs} to (theURL's getResourceValue:(reference) forKey:(current application's NSURLLocalizedNameKey) |error|:(missing value)) # pour un nom Hfs
--return {PosixName as text, POSIX path of (PosixContainer as text)} # Original last instruction
set PosixContainer to PosixContainer's |path|() as text
# ATTENTION, Sierra ne met pas le / final
if PosixContainer does not end with "/" then set PosixContainer to PosixContainer & "/"
return {PosixName as text, PosixContainer}
end getNameAndContainer:
#=====
Yvan KOENIG running Sierra 10.12.0 in French (VALLAURIS, France) vendredi 23 septembre 2016 15:35:42