Tags no longer working in Sierra after clean system update.

Hi,
I’ve been using the following component of a script with no issues until I did a clean reinstall/update of my system a month or so ago:

use FileTagsLib : script "FileTagsLib"
use scripting additions
set IconResource to "/Applications/Naming Convention.App/Contents/Resources/Icons/Folders with Icons"

set sourceFile to choose folder with prompt "Please choose a file:" default location IconResource as string -- 08.21.16	
--TAG SECTION:
set oldListOfTags to FileTagsLib's returnTagsFor:sourceFile
log oldListOfTags
tell FileTagsLib to setTags:listOfTags forItem:sourceFile
set newListOfTags to FileTagsLib's returnTagsFor:sourceFile -- 08.15.16

The error I now get is “error “-[NSURL length]: unrecognized selector sent to instance 0x600000abf860” number -10000”

Any idea why this would be different after updating the system and how I might go about fixing it? Thank you in advance for any help.

I’m not sure that your script worked before.

It correctly logs the oldListOfTags but the next instruction fails because listOfTags is not defined !
I added : set listOfTags to {“Jaune”} just after the log instruction and, what a surprise, the script worked.

use FileTagsLib : script "FileTagsLib"
use scripting additions
--set IconResource to "/Applications/Naming Convention.App/Contents/Resources/Icons/Folders with Icons"
set iconResource to path to desktop
set sourceFile to choose folder with prompt "Please choose a file:" default location iconResource -- 08.21.16	
--TAG SECTION:
set oldListOfTags to FileTagsLib's returnTagsFor:sourceFile
log oldListOfTags  (*Rouge*)
set listOfTags to {"Jaune"}
tell FileTagsLib to setTags:listOfTags forItem:sourceFile
set newListOfTags to FileTagsLib's returnTagsFor:sourceFile -- 08.15.16
--> {"Jaune"}

I changed the definition of IconResource because your Naming Convention.app is unavailable here.

Yvan KOENIG running Sierra 10.12.1 in French (VALLAURIS, France) mardi 15 novembre 2016 17:46:44

Hi Yvan,
While I truly appreciate your help, I find “what a surprise” and questioning if the script worked before really condescending. I’m just trying to learn and your mocking me is unnecessary. I’m doing the best I can and meant no offense in submitting my (apparently) silly script for help.

I’ve found this site to be really informative, but I would honestly prefer not to have your help if you find it necessary to belittle me for merely seeking knowledge.

Hi Sidewipe

I was not saying that your code was silly. Just that your assertion was not matching the reality.

As far as I know, it’s not me but you who wrote :[format]'ve been using the following component of a script with no issues until I did a clean reinstall/update of my system a month or so ago:[/format]

So I think that there was no offense in my sentence : [format]I’m not sure that your script worked before.[/format]

It was just a polite ascertainment. In fact the truth is that I thought :[format]I’m sure that the posted script never worked before[/format]

Don’t worry, everybody here, including helpers, make errors from time to time.

Yvan KOENIG running Sierra 10.12.1 in French (VALLAURIS, France) mardi 15 novembre 2016 19:53:46

sideswipe,

Yvan provides an incredible amount of free, expert help here, and he didn’t say anything condescending. The script you posted passes an undefined variable as an argument to a handler. Whatever that part of the script is supposed to do can’t be working right, unless there’s more information that we’re missing - like you didn’t paste in the entirety of the code and we’re missing a line or something. His statement was a simple factual statement, there’s nothing rude about it. Your script as posted contained a line of clearly non-functional code.

“What a surprise” is not rude either. He explained that he found an undefined variable, and typed “what a surprise” that defining it fixes it. Entering a little color or train of thought in his responses is not rude. Reading this thread, nothing caught my attention as rude or condescending until I got to your last post.

Please don’t read negative tone into the responses of the volunteers trying to help you. No one is belittling you for seeking knowledge. Give them the benefit of the doubt. If someone types “you idiot” or “I wish clueless newbs would learn something before they come here” or something like that, that is condescending. If you have to read between the lines to make something condescending, then you probably shouldn’t.

  • Tom.

Thanks t.spoon

I was not at ease with my poor English and was afraid to make the relations even worse.

Yvan KOENIG running Sierra 10.12.1 in French (VALLAURIS, France) mercredi 16 novembre 2016 09:18:24