@@ -51,6 +51,13 @@ Options:
5151 --update ATTRIBUTE VALUE Update ATTRIBUTE with VALUE; for multi-valued
5252 attributes, this adds VALUE to the attribute if
5353 not already in the list
54+ --backup Backup FILE attributes. Backup file
55+ '.osxmetadata.json' will be created in same folder
56+ as FILE
57+ --restore Restore FILE attributes from backup file. Restore
58+ will look for backup file '.osxmetadata.json' in
59+ same folder as FILE
60+ -V, --verbose Print verbose output
5461 --help Show this message and exit.
5562
5663Valid attributes for ATTRIBUTE: Each attribute has a short name, a constant
@@ -67,44 +74,44 @@ set keywords to ['foo', 'bar']
6774
6875Short Name Description
6976authors kMDItemAuthors, com.apple.metadata:kMDItemAuthors; The
70- author, or authors, of the contents of the file. A list of
77+ author, or authors, of the contents of the file. A list of
7178 strings.
7279comment kMDItemComment, com.apple.metadata:kMDItemComment; A comment
73- related to the file. This differs from the Finder comment,
74- kMDItemFinderComment. A string.
80+ related to the file. This differs from the Finder comment,
81+ kMDItemFinderComment. A string.
7582copyright kMDItemCopyright, com.apple.metadata:kMDItemCopyright; The
76- copyright owner of the file contents. A string.
83+ copyright owner of the file contents. A string.
7784creator kMDItemCreator, com.apple.metadata:kMDItemCreator;
7885 Application used to create the document content (for example
79- “Word”, “Pages”, and so on). A string.
86+ “Word”, “Pages”, and so on). A string.
8087description kMDItemDescription, com.apple.metadata:kMDItemDescription; A
81- description of the content of the resource. The description
88+ description of the content of the resource. The description
8289 may include an abstract, table of contents, reference to a
8390 graphical representation of content or a free-text account
84- of the content. A string.
91+ of the content. A string.
8592downloadeddate kMDItemDownloadedDate,
8693 com.apple.metadata:kMDItemDownloadedDate; The date the item
8794 was downloaded. A date in ISO 8601 format: e.g.
8895 2000-01-12T12:00:00 or 2000-12-31 (ISO 8601 w/o time zone)
8996findercomment kMDItemFinderComment,
9097 com.apple.metadata:kMDItemFinderComment; Finder comments for
91- this file. A string.
98+ this file. A string.
9299headline kMDItemHeadline, com.apple.metadata:kMDItemHeadline; A
93100 publishable entry providing a synopsis of the contents of
94- the file. A string.
101+ the file. A string.
95102keywords kMDItemKeywords, com.apple.metadata:kMDItemKeywords;
96103 Keywords associated with this file. For example, “Birthday”,
97104 “Important”, etc. This differs from Finder tags
98105 (_kMDItemUserTags) which are keywords/tags shown in the
99- Finder and searchable in Spotlight using "tag:tag_name"A
106+ Finder and searchable in Spotlight using "tag:tag_name". A
100107 list of strings.
101108tags _kMDItemUserTags, com.apple.metadata:_kMDItemUserTags;
102109 Finder tags; searchable in Spotlight using "tag:tag_name".
103110 If you want tags/keywords visible in the Finder, use this
104- instead of kMDItemKeywords. A list of strings.
111+ instead of kMDItemKeywords. A list of strings.
105112wherefroms kMDItemWhereFroms, com.apple.metadata:kMDItemWhereFroms;
106113 Describes where the file was obtained from (e.g. URL
107- downloaded from). A list of strings.
114+ downloaded from). A list of strings.
108115```
109116
110117
@@ -259,6 +266,11 @@ meta.clear_attribute("tags")
259266
260267## Programmatic Interface:
261268
269+ ### name
270+ ` name() `
271+
272+ Returns POSIX path of the file OSXMetaData is operating on.
273+
262274### get_attribute
263275` get_attribute(attribute_name) `
264276
@@ -326,6 +338,11 @@ Clear anttribute (remove it from the file).
326338
327339List the Apple metadata attributes set on the file. e.g. those in com.apple.metadata namespace.
328340
341+ ### to_json
342+ ` to_json() `
343+
344+ Return dict in JSON format with all attributes for this file. Format is the same as used by the command line --backup/--restore functions.
345+
329346## Usage Notes
330347
331348Changes are immediately written to the file. For example, OSXMetaData.tags.append("Foo") immediately writes the tag 'Foo' to the file.
0 commit comments