Coder Social home page Coder Social logo

tag's People

Contributors

8ch9azbsfifz avatar jamescat avatar jdberry avatar tessarin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tag's Issues

Machine readable output

Could you add an option to the list argument that puts a delimiter between the file name and the tags? It's a hassle to parse out the files and any tags that may exist. Also if the file name is a directory could you append a trailing slash to the name so it's obvious what is a file and what isn't? That would be greatly appreciated.

Very nice application by the way!

[INVALID] Windows binary

Dear James,
Could you be so kind to generate .exe for the rest of us who use Windows, if possible?

Cannot locate files with special characters in their paths

My environment:

  • OS X 10.10.3
  • tag-0.7.5 from Homebrew

I tried to add tag to a file from Terminal this way:

$ tag -l "/Users/me/Downloads/Virtual Barber Shop Hair Cut - 3D Sound (Amazingtag!!) (Low).mp4"

and here is the error messages:

tag -l "/Users/me/Downloads/Virtual Barber Shop Hair Cut - 3D Sound (Amazingtagtag -l "/Users/me/Downloads/Virtual Barber Shop Hair Cut - 3D Sound (Amazingtag -h) (Low).mp4") (Low).mp4"
-bash: syntax error near unexpected token `('

Looks like tag's argparse has problems with special characters in the path.
Please help.

Method to list all tags in use

Finder seems to have a fast method for listing all tags in use in the filesystem. It would be very helpful to add support in the 'tags' command. It can be faked (slowly) using 'tag --find * --tags --no-name' and processing the results but a fast, simple method would be extremely useful.

tags created on network drive files are in a ghost state

If the tag command creates a new tag on a network file/directory, that tag will not be listed under the Finder "All Tags..." until the tag command adds the same tag to a local file/directory, or the Finder adds the same tag to a local/network file/directory.

The tag created on the network resource in this scenario remains in an ephemeral state, wherein the Finder cannot delete and readd the tag. If some other process successfully adds the tag, then the ephemeral nature of the original tag is resolved.

To expound on what I mean by ephemeral, the graphics of the tag will be a dotted line instead of a solid line. I can create a similar dotted line graphic by introducing a new tag in the Finder, before the tag edit bubble is closed.

screen shot 2015-04-10 at 4 54 39 pm

I cannot find any intuition on whether this is a tag command thing, an osx thing, or both. The state machine of the tag command is a mystery! I'll understand if there's nothing to be done.

My use case here is that I drag music files/folders onto tags as genres, and then later I use your tag command to dump the tag list and assign those files/folders per tag into a playlist per tag. At home I have a mac mini in the closet with the music, which I sort from a remote client and then generate the playlists. If a new tag is introduced on the mac mini, it will not be presented on my computer until I manually munge in the tag with trickery. Thanks.

Finding Files Without Tags

It would be useful to be able to find files that currently don't have tags. As far as I see there is no real way in order to do this, and it would make scripting easier.

Don't quite understand this statement

Not sure exactly what you mean by this:

• Tagnames may include spaces, but the entire tag list must be provided as one parameter: "a multiword tag name".

Do you mean that if any tag in the list contains a space, the entire list must be enclosed in double quotes? Or do you mean that each tag that contains a space must be individually quoted?

It would be the difference between this:
"tag1,tag2,tag3 with spaces,tag4"
and this:
tag1,tag2,"tag3 with spaces",tag4

Or do you mean something else? Please clarify, and thanks for making this software!

Tag setting not properly working

Hey there,

I try to do some stuff with iTunes and your tag command line. I have the following written in Applescript:

do shell script "/usr/local/bin/tag --set 'Electro House' '~/Music/iTunes/iTunes Media/Music/Alex Skrindo/Moments/Moments (feat. Stahl!).mp3'"

The tag should be "Electro House" and the file does exist at the specific location, I already checked that. But the problem is that if I type it right into the command line it works but if I call it like in the code snippet above, I always get following error message:

tag: The operation couldn’t be completed. (OSStatus error -43.)

As far as I am aware of the error code 43 has something to do with the existence of the file. But those files to all exist. Maybe you have a clue. Obviously the command itself works but not if I call it through Applescript even if they both are technically the same...

EDIT:
The above command does not work in the terminal. Just tags without spaces do work for me...

Find tags on invisible files

According to the readme:
The --all, --enter, and --recursive options apply to --add, --remove, --set, --match, and --list

I need to --find invisible tags. Is there a workaround for this?

Sort files by tag

Is there a way to list all files in a folder, separated by tag? For example:

tag
Name1
Name2
Name3
tag
Name1
Name2
Name3
Name4
tag
Name1
Name2

i know that tag -tgf \* /Some/Folder will show files in the folder with any tag.
i know that tag -tgf \*|grep '^ '|cut -c5-|sort -u will list all Finder tags

I would like to a combination of the two without having to call out each tag-
( tag -tgf 'tagname' /Some/Folder )

Is this possible, or maybe even with a small script?

Thanks very much

--help and --version still --list

The default action, when none is specified, has been set to --list. It also does this when --help and --version are specified — so the current directory contents are listed after the version is printed, or the help text is displayed.

Not working on R/W mounted NTFS Volume?

Hello,
tag v0.8.1 doesnt seem to work on an external USB 4 Tbytes Harddisk, that is mounted R/W by Paragon NTFS v12.1.62.(Macbook pro, 10.10.3, tag installed via port)
It looks to me as if it doesnt even access the Volume, i hear no sound, and there is no delay, e.g. "tag --find '*' --descend /Volumes/4T", and of course no matching files are output.
This is not a permissions issue, because in Finder i can create, edit and delete files(as well as their tags) on said drive easily.
I should mention that cocatech's PathFinder 7.1.5 shows some strange behaviour too on NTFS Volumes (shows, but is unable to change tags).

Any idea on this ?
Any way to force a verbose/debug output or dump a logfile that i could send to you?

Yours
Dirk

The item couldn’t be opened because the file name is invalid

If you could add this syntax example to your documentation to help others (although, it relies on gnu xargs). I haven't figured out how to pipe a list of filenames into tag using macOS installed xargs.

$ gxargs -d '\n' -a /Users/name/Desktop/textfile.txt -I % tag  -a red %

Here we use xargs to read from file (using -a), using replacing string with (using %) and execute command tag -a red {filename}. You may need to add -d '\n' (setting delimiter to newline) to split strings.

This allows us to use the two flags -d and -a there fore we don't need to add the -0 flag in xargs and tag.

-a file, --arg-file=file
Read items from file instead of standard input. If you use this option, stdin remains unchanged when commands are run. Otherwise, stdin is redirected
from /dev/null.
--delimiter=delim, -d delim
Input items are terminated by the specified character. The specified delimiter may be a single character, a C-style character escape such as \n, or an
octal or hexadecimal escape code. Octal and hexadecimal escape codes are understood as for the printf command. Multibyte characters are not supported.
When processing the input, quotes and backslash are not special; every character in the input is taken literally. The -d option disables any end-of-file
string, which is treated like any other argument. You can use this option when the input consists of simply newline-separated items, although it is al-
most always better to design your program to use --null where this is possible.

gnu xargs can be installed on mac using homebrew command brew install findutils

Feature idea: verbose output

I have been using jdberry/tag in a generated script, which has thousands of lines like this: tag --set tag1,tag2 file. It'd be nice if I could do something like tag --verbose so I can see what's going on. Otherwise, it runs silently, which is great, but it'd be nice to have some form of reference as to how much longer it has to go. If this is already possible, I apologize. I looked for it but I didn't see it.

adding tag with certain characters damages file

On several times now, I have encountered a situation where after adding a tag to a PDF file in a shell script with

tag -a "$tags" "$file"

the file was damaged as a result. With a hex editor, I could see that the beginning of the file was overwritten by the xattr information (bplist00etc.)

It is the same when I enter the command above in the Terminal, replacing the variables with their actual values.

This is seemingly caused by certain characters in the tag, but I have not found out which ones.

Using Tag 0.9 installed through Homebrew on OS X 10.11.6

xargs: unterminated quote

This is a very useful tool. Unfortunately, no matter what I do I can't pipe it to xargs. Something in the readme said to use -0. But although this clearly changes the format of the output, whether or not I have it I always only get xargs: unterminated quote.

In the meantime I will look for a workaround. If anyone can share how they process the raw output without xargs perhaps that could help me too.

is it possible to see which tags have been used more recently?

Hi I would like to list tags of a set of files, possibly all the tagged files in my computer, and list these tags according to the date of last use.
I may assume that the last use corresponds to the latest modification time of files tagged with a given tag, but this is an assumption ... is the tagging "history" somehow accessible anywhere?

How to copy tags from one file to another?

Hi,

I would like to copy the tags set on one file to another file. I am a bit lost how to do it though... Maybe you could even add this functionality?

I did an automator action "encode to m4a 128kbit". But I would like to then copy the tags set for the wav file to the generated m4a file.

Very strange btw. that there are no tools from Apple. Finder tags seems to be super rudimentary a.k.a. almost useless.

How to show all tags?

I read the entire README.md and all the issues. But I failed to figure out how to show all tag names that I added/used. I thought it should be a basic feature but don't know how to do it. If I add thousands of tags, I won't be able to memorize all tag names so I need a way to figure out what tags are. Thanks a lot.

error on removing tags

@jdberry @tessarin

This command is working to reveal every file in the directory that has any tag.
tag --match '*' --recursive --tags /Volumes/PlexMedia

When I try to remove all of the tags I found I get an error:

$ tag --remove 'Green' --recursive /Volumes/PlexMedia
tag: The operation couldn’t be completed. (OSStatus error -5000.)

I first thought it could be an ownership issue. The volume didn't have "ignore ownership on this volume" selected. I checked that and ran the command again and received the same error. I then selected "apply to enclosed items" and ran the command again.

Is my command incorrect?

$ tag -r 'Green' -R /Volumes/PlexMedia
tag: The operation couldn’t be completed. (OSStatus error -5000.)

I am thinking I need to pass the found files to xargs but am having trouble with the syntax

$ tag --match '*' --recursive --tags /Volumes/PlexMedia | xargs -0 tag -r {}
$ tag --match '*' --recursive --tags /Volumes/PlexMedia | xargs -0 -I {} tag -r -R {}

$ tag --match '*' --recursive --tags /Volumes/PlexMedia | xargs -0 tag -r -R
tag: The item couldn’t be opened because the file name “The Big Short (2015) CD” is invalid.

Requesting option to not follow symlinks

I'm trying to recursively add a tag all the files and folders in a path, which is working perfectly except that I have added a simlink to a directory on an external read-only drive, and it's now giving me the error tag: The operation couldn’t be completed. (OSStatus error -8058.). Could you maybe add an option to not follow links?

Tags should be compared as case-insensitive

While it's possible to add tags that differ only in case, Finder seems to collapse tags that differ only in case. We should probably follow suit and compare tags in a case-insensitive fashion when we add, remove, match, and find.

minimum file padding causes issues with piping to other programs

On https://github.com/jdberry/tag/blob/master/Tag/Tag.m#L385 there is some padding that gets put into the file output. This causes the filename to be invalid.

$ touch test1 test2
$ tag -a demo *
$ tag -m demo *
test1                          
test2                          
$ tag -0 -m demo * |xargs -0 ls -l
ls: test1                          : No such file or directory
ls: test2                          : No such file or directory

If I remove the padding and recompile, the program works as I expect it to. I am not a developer, and this is my first submission so please be kind if my report is bogus or my description poor. Regards!

Add generalized boolean search, allowing to match files not including tags

It would be nice to be able to specify tags to ignore. For instance, say I tag some files as "archive". I could then run a search as normal but that do not include files tagged as archive. A sample of the command could look like this:

tag -f Red Yellow Blue -i archive

This would search for all files that have been tagged "Red", "Yellow", and "Blue", but that do not have the "archive" tag.

file name is invalid?

tag: The item couldn’t be opened because the file name “horizon.s55e01.we.need.to.talk.about.death.720p.hdtv.x264-qpel[eztv].mkv ” is invalid.

All tags without usage

I might be missing something here, but the only way I can see to list all tags throughout the entire system is:

tag --usage

This lists all tags with their associated usage

I want to use tag to get all available tags for a script in Alfred. It's easy enough to split the output of tag --usage but it would be useful to just have a simple command that outputs all tags on their own. I've tried tag --list but this seems to list folders as well.

-H, -L, -R switches not recognized

The man page specifies that e.g. either -H or --home can be used to limit searching of tagged files:

        -H | --home         Find tagged files in user home directory
        -L | --local        Find tagged files in home + local filesystems
        -R | --network      Find tagged files in home + local + network filesystems

Using --home works as expected:

$ tag --home -f Green
[…]/Desktop/test

But using --H instead gives an error (while still providing results):

$ tag -H -f Green
tag: invalid option -- H
[…]/Desktop/test

Im using v0.8.1 installed via MacPorts.

Controlling Tag Order

First of all, this is a great utility. Thanks!

I'm trying to tag a bunch of movie files, and would like the "Year" tag to always be the first tag in the group. Other tags are actors, directors, and movie type.

Is there a way to control the order of the tag?

I've tried a few things, but it seems to always be a bit random.

Thanks!

Support for Rixtag and other xattr?

Rixstep has released a new super-fast tagging app called Rixtag using proprietary xattr, not the default macOS tags: http://rixstep.com/1/20170808,00.shtml
The xattr is com.rixstep.Rixtag, and the tags are stored in binary plist as hex data.

Support possible? E.g. as tag --xattr=com.rixstep.Rixtag <option> <tag(s)> <path(s)>

In that regard, wouldn't it be easy to let users create their own xattr? E.g.:
tag --xattr=com.github.jdberry -a <tag(s)> <path(s)>
and so on…

`tag --add` with an existing tag removes color information in Finder

If I use the command tag --add "Important" myFile.docx, it adds the tag "Important" to my file. However, the tag tool also seems to remove the color information for display in the Finder for this tag. So in this instance, the "Important" tag is by default marked with a red dot, now it isn't marked as such anywhere in the Finder which is quite annoying.

Crash

Thanks for building this cool tool! I've installed on OSX Mojave via Homebrew.
Sometimes it works fine, and sometimes I get the following error:
feckless:/Volumes/Back> tag -a Red Exps/Analysis/Russian -R
tag: The operation couldn�t be completed. (OSStatus error -8058.)

Any thoughts on what's happening?
Thank you!

-Dianne

--find option not working with directories?

I seem to have no problem tagging files and directories, but when performing a query using find, only my tagged files show up. Is this expected, or is there another option to include directories?

$ find . -name ".vagrant" |xargs tag -s blah
$ tag -l .vagrant
.vagrant                       	blah
$ find . -name "dummyfile" |xargs tag -s blah
$ tag --find blah .
<PATH_TO_MY_FILE>/dummyfile

Use the output of find as input to another script for further processing, but it needs to process tagged directories as well.

Thanks.

list of all tags

I red all the readme and also the previous issues, but I didn't find a command that show a list of the tags used in the finder, in order to know which colors are associated to each tag (as the screenshot attached)

image

thanks

How tag works and do I need to clean cache somehow when I remove tagged files?

First, thanks a lot for the amazing tool. I just install it today. I read a closed issue which mentions the tag uses extended attribute in HFS and APFS file systems. I don't really know what it means. Where does the tag info store? Does it store in the same file which I tag?
For example, if I tag a file tag -a tag1 file1, and then later rm file1, do the tag1 tag name and the reference/link btw tag name and file both removed from the file system? Do I need to do anything to clean the cache (or the extended attributes)?
Thanks a lot.

Add limited support for OpenMeta

Please: could you add an option to find tags that use the com.apple.metadata:kMDItemOMUserTags attribute?

If so, then would tag work (for that purpose) with Mountain Lion?

Thanks

adding directory scope for tag search

The scope for the --find command, unless I am mistaken, can only be home, local, or volume. IIUC, the system call allows NSURLs as search scopes. Maybe this could be added into the tool? Perhaps something like --scope /path/to/dir/, or tags --match --recursive <tags> <dir>...
I think this might be more efficient than a shell glob when searching through thousands of files.
Thanks!

Batch tag

Hi,
First of all thank you for this very useful tool.
I'm a newbie so sorry if my question is dumb.
I'd need to batch tag a large amount of files (+200000)
The actual list of files works great but is not ok for this purpose, too many entries. I have the paths in a text file, is there's a way Tag could read this text file's files adresses and tag the files?
Thanks in advance

question: are Mac OS x tags portable?

I have some questions about how tags work in Mac OSx Finder. Are tags written to the file somehow, or is it stored somewhere else in the system? Can I see/edit the tags from other operating systems? My concern is if the tags will stick and be available in other environments.

Forgive me for asking through a github issue. I have not been able to find the answer for myself. I was looking to use a command line application like this to organize some media, but first I wanted to check the limitations of the work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.