Of course, it was in front of me and I didn't saw the trick.
use AppleScript version "2.3.1"
use scripting additions
use framework "Foundation"
on setTags:tagList forItem:fileOrPosixPath
if class of fileOrPosixPath is not text then set fileOrPosixPath to POSIX path of fileOrPosixPath
set thisURL to current application's class "NSURL"'s fileURLWithPath:fileOrPosixPath -- make URL
set {theResult, theError} to thisURL's setResourceValue:tagList forKey:(current application's NSURLTagNamesKey) |error|:(reference)
if theResult as boolean is false then error (theError's |localizedDescription|() as text)
end setTags:forItem:
set aFolder to (choose folder)
# Clear the existing tags
my setTags:{} forItem:(POSIX path of aFolder)
# Set the label to red
tell application "Finder"
set label index of aFolder to 2
end tell
Yvan KOENIG running El Capitan 10.11.6 in French (VALLAURIS, France) mercredi 14 septembre 2016 21:37:08