We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference this. Also, see #10 and #61.
The text was updated successfully, but these errors were encountered:
Tags can be set like this:
""""Set Finder tags on files and folders.""" import sys from Foundation import NSURL, NSURLTagNamesKey, NSURLLocalizedLabelKey if __name__ == "__main__": file = sys.argv[1] tags = sys.argv[2:] tags = ["Tag5\n5"] url = NSURL.fileURLWithPath_(file) if not url.setResourceValues_error_(dict(NSURLTagNamesKey=tags), None): print(f"Error setting tags {tags} on {file}") sys.exit(1) print(f"Tags {tags} set on {file}") label_name = url.getResourceValue_forKey_error_(None, NSURLLocalizedLabelKey, None) print(f"Label name: {label_name}")
Sorry, something went wrong.
Reference: https://github.com/hugocornejo/Locker-Room/blob/cbe8788ef1216be22b1cf7d2efc42b49f61ac7ed/DribbbleLikeDownloader.m
-(void)setFinderComment:(NSString*)comment forFile:(NSString*)path { @try { static FinderApplication *finderApp = nil; if (finderApp == nil) { finderApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.finder"]; } NSURL *location = [NSURL fileURLWithPath:path]; FinderItem *item = [[finderApp items] objectAtLocation:location]; item.comment = comment; } @catch (NSException *ex) { NSLog(@"Unable to set finder comment for %@: %@", path, ex); } }
This still involves scripting but uses direct communication with Finder instead of calling AppleScript.
No branches or pull requests
Reference this. Also, see #10 and #61.
The text was updated successfully, but these errors were encountered: