• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: tags manipulation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: tags manipulation
      • From: Shane Stanley <email@hidden>
    • Re: tags manipulation
      • From: 2551 <email@hidden>
References: 
 >tags manipulation (From: Jean-Christophe Helary <email@hidden>)
 >Re: tags manipulation (From: Shane Stanley <email@hidden>)
 >Re: tags manipulation (From: Christopher Stone <email@hidden>)
 >Re: tags manipulation (From: Shane Stanley <email@hidden>)
 >Re: tags manipulation (From: Christopher Stone <email@hidden>)
 >Re: tags manipulation (From: Shane Stanley <email@hidden>)
 >Re: tags manipulation (From: Shane Stanley <email@hidden>)
 >Re: tags manipulation (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: tags manipulation
  • Next by Date: Re: tags manipulation
  • Previous by thread: Re: tags manipulation
  • Next by thread: Re: tags manipulation
  • Index(es):
    • Date
    • Thread