Re: tags manipulation
Re: tags manipulation
- Subject: Re: tags manipulation
- From: 2551 <email@hidden>
- Date: Mon, 28 Sep 2015 10:41:34 +0700
On 28 Sep 2015, at 09:49, Shane Stanley < email@hidden> wrote:
OK, some conclusions for anyone interested:
Great stuff, thanks Shane.
As an addendum, there’s a WWDC 2013 (sorry don’t have the reference to hand) that demos code for finding out the tag(s) associated with a particular file (and for programmatically setting tags), though I’m afraid Shane or someone else will have to do the translation to ASObjC. Querying a file for existing tags goes something like this (typed not pasted, beware typos):
BOOL isTagged; NSArray *tags; NSURL *filesUrl = //insert the the file’s url here;
isTagged = [filesUrl getResourceValue:&tags forKey:NSURLTagNamesKey error:nil];
if (isTagged == YES) { NSLog(@“tags for file %@ : %@“, filesUrl, tags]; } else { NSLog(@“file %@ is not tagged”, filesUrl); }
If I get the chance I’ll play with it later. I don’t know but I’m assuming NSURLTagNamesKey will not return labels.
Best
Phil
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden