jordic Posted January 17, 2013 Share Posted January 17, 2013 Hi, I've created a simple workflow to manage my 'alfred ignore list'. It reuses some PHP code from jdwarrior. I hope that's not a problem :-) The workflow contains a file action to add the alfred:ignore comment to a file. This will make Alfredapp ignore the file and not show it as a search result anymore. Type 'ignorelist' to display a list of all currently ignored files. Selecting a file will remove all spotlight comments (beware!) and will make Alfred list it in the search results again. I hope it's of use to anyone else. It helps me to get rid off all the annoying and useless apps showing up in my results. Again, it blatantly removes all spotlight comments right now and I've not tested it thoroughly yet, but I'll try to fix any issues asap. You probably need to reload Alfred's cache after using this workflow: just type 'reload' and select 'Reload Alfred Cache'. PS: Any way to do that programmatically? Download: http://cl.ly/3P092T38282j regards, J. Florian 1 Link to comment
jordic Posted January 17, 2013 Author Share Posted January 17, 2013 I've uploaded a new version of the workflow. It adds two new functions using modifier keys: cmd-key: reveal the file on ignore list in Finder alt-key: open Finder Info window for the file on the ignore list regards. Download: http://cl.ly/1i1o0z13021T Link to comment
jordic Posted January 17, 2013 Author Share Posted January 17, 2013 Last version for the day; removed the dependency on jdwarriors code and the ignorelist now shows the proper file icons. Download: http://cl.ly/0y221I1y341J CarlosNZ 1 Link to comment
Florian Posted January 17, 2013 Share Posted January 17, 2013 I think you could detect whether a comment already contains "alfred:ignore" with something like this: set string1 to "coucou" set string2 to "cou" if string2 is in string1 then display dialog "yay" and then using the comment already existing in a file to add "alfred:ignore" (only if it isn't already in it), to the previous comment without erasing it, something like this: set existing_comment to comment of theFile set comment of theFile to existing_comment & " " & "alfred:ignore" Also, I'm not sure you need to write your "ignorelist" to a file since the command mdfind (command line for a spotlight search, quite fast) allows you to search for a file by kMDItemFinderComment, which is the file's comment. Finally, I know there is a simple way to remove a string from a string with php or bash. So i would assume that also exists in applescript (if you decide to stick with it and not use bash for mdfind). Anyway, I really like your workflow I never use the comments so I don't care if it erases it Link to comment
jordic Posted January 18, 2013 Author Share Posted January 18, 2013 Thanks for the suggestions Florian. I've reworked the workflow. It now handles existing comments and leaves them intact. I'm not keeping a list of ignored files. I use mdfind to dynamically construct the list. I've change the keyword to a default keyword ignore not to confuse people. Download: http://cl.ly/032U2J2l2f0z Florian and Jono 2 Link to comment
Jasondm007 Posted August 17, 2018 Share Posted August 17, 2018 @jordic Thanks for posting this workflow! Does it still work in Alfred 3 (& current Mac OS)? On my machine, I can only get the file action to work for 1 file at a time (not multiples). In addition, the search feature is a little sporadic. However, it might just be my machine. Thanks again! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now