Post

Replies

Boosts

Views

Activity

Comment on Setting filesystem metadata from Swift
I have this problem now. and the workaround suggested by Eskimo... has been blocked. We get an error message that says it was expecting a class instead of an array. I suspected it was a holdover from Obj-C so I converted the Array to an NSArray, resulting in a completely different error that claims "setResource(, forKey:) is no longer available, and I should instead use the plural form of the same thing : "NSURL.setResources()" That in turn doesn't work, because... surprise... you cannot set the tag names in an URLResourceValues object. it is read only. so... I guess that's that then.
Topic: App & System Services SubTopic: General Tags:
Mar ’22
Comment on obtuse error message when trying to add a tag to a file in the finder.
we have a winner! (URL as NSURL) is ll it took. mikeyh you figured it out. to sum up: try (atURL as NSURL).setResourceValue(tags as AnyObject, forKey: .tagNamesKey) works. try atURL.setResourceValue(tags as AnyObject, forKey: .tagNamesKey) does not.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’22
Comment on obtuse error message when trying to add a tag to a file in the finder.
yes. exactly. you are very efficient today ;) bug report filed. But I guess the modern way to do it is broken, and has been for a WHILE.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’22
Comment on Setting filesystem metadata from Swift
I have this problem now. and the workaround suggested by Eskimo... has been blocked. We get an error message that says it was expecting a class instead of an array. I suspected it was a holdover from Obj-C so I converted the Array to an NSArray, resulting in a completely different error that claims "setResource(, forKey:) is no longer available, and I should instead use the plural form of the same thing : "NSURL.setResources()" That in turn doesn't work, because... surprise... you cannot set the tag names in an URLResourceValues object. it is read only. so... I guess that's that then.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’22