NNTagging Reference Library

NNTagToFinderCommentWriter Class Reference

NNTagToFinderCommentWriter Class Reference

Inherits from
Declared in NNTagToFinderCommentWriter.h

Overview

Abstract class

Provides different tag syntax for Spotlight Finder Comment and the ways to write it.

Tasks

Instance Methods

finderTagCommentForTags:

- (NSString *)finderTagCommentForTags:(NSArray *)tags
Parameters
tags

Tags to create the comment for

Return Value

String representation for tags in concrete syntax

Discussion

Abstract method for template method.

Declared In
NNTagToFinderCommentWriter.h

finderCommentIgnoringKeywordsForFile:

- (NSString *)finderCommentIgnoringKeywordsForFile:(NNFile *)file
Parameters
file

File to get comment for

Return Value

Finder comment contents without NNTagging stuff

Discussion

Abstract method for template method.

Declared In
NNTagToFinderCommentWriter.h

readTagsFromFile:creationOptions:useStore:

- (NSArray *)readTagsFromFile:(NNFile *)file creationOptions:(NNTagsCreationOptions)options useStore:(NNFinderCommentStore)store
Parameters
file

File to get tags for

options

Influence tag creation

store

Determines the backing storage to get the finder comments from

Return Value

Array of NNTags on file

Discussion

Abstract method.

Declared In
NNTagToFinderCommentWriter.h

tagsInComment:

- (NSArray *)tagsInComment:(NSString *)comment
Parameters
comment

Finder Comment

Return Value

Tags in comment

Discussion

Abstract method.

Calls tagsInComment:creationOptions with NNTagsCreationOptionNone

Declared In
NNTagToFinderCommentWriter.h

tagsInComment:creationOptions:

- (NSArray *)tagsInComment:(NSString *)comment creationOptions:(NNTagsCreationOptions)options
Parameters
comment

Finder Comment

options

Determines if tags are created

Return Value

Tags in comment

Discussion

Abstract method.

Parses the passed string to get the tags.

Declared In
NNTagToFinderCommentWriter.h

keywordsForComment:

- (NSArray *)keywordsForComment:(NSString *)comment
Parameters
comment

Finder Comment

Return Value

NSArray of NSString with tag names

Discussion

Abstract method.

Reads the tag names from the Finder Comment

Declared In
NNTagToFinderCommentWriter.h

commentForFile:

- (NSString *)commentForFile:(NNFile *)file
Parameters
file

File to get comment for

Return Value

comment

Discussion

Calls commentForFile:useStore with NNFinderCommentFinderStore

Uses the finder scripting bridge to fetch the finder comment. Will cause hangs when using this while dragging the file from finder.

Declared In
NNTagToFinderCommentWriter.h

commentForFile:useStore:

- (NSString *)commentForFile:(NNFile *)file useStore:(NNFinderCommentStore)store
Parameters
file

file to get comment for

store

Determines the backing storage to get the finder comments from

Return Value

comment

Discussion

Using the spotlight db to fetch the finder comment won't cause Finder to hang on drop, but data might be out of date.

Declared In
NNTagToFinderCommentWriter.h

prefix

- (NSString *)prefix
Return Value

Tag prefix as set in NNTagStoreManager

Declared In
NNTagToFinderCommentWriter.h

setPrefix:

- (void)setPrefix:(NSString *)aPrefix
Parameters
aPrefix

Prefix to use in NNTagStoreManager

Declared In
NNTagToFinderCommentWriter.h

setComment:forURL:

- (BOOL)setComment:(NSString *)comment forURL:(NSURL *)fileURL
Parameters
comment

New comment

fileURL

File to set comment for

Return Value

YES on success, NO otherwise

Discussion

Sets the finder comment using the scripting bridge.

Declared In
NNTagToFinderCommentWriter.h

commentForURL:

- (NSString *)commentForURL:(NSURL *)fileURL
Parameters
fileURL

file to get comment for

Return Value

comment

Discussion

Returns the Finder Comment using the Scripting Bridge (causes the finder to hang if the comment is read on drag'n'drop

Declared In
NNTagToFinderCommentWriter.m

Last updated: 2010-5-13