untidey Posted July 31, 2013 Share Posted July 31, 2013 I've created a script filter interface to my nvAlt notes. The keyword is 'n <optional argument>'. Pressing 'n<space>' shows all of my notes; any argument is used to filter the list. My problem is that default results, such as contacts and apps, are also added to Alfred's results list, not just what my script filter returns. Is there a way to hide these? Cheers Nick Link to comment
jdfwarrior Posted August 1, 2013 Share Posted August 1, 2013 I've created a script filter interface to my nvAlt notes. The keyword is 'n <optional argument>'. Pressing 'n<space>' shows all of my notes; any argument is used to filter the list. My problem is that default results, such as contacts and apps, are also added to Alfred's results list, not just what my script filter returns. Is there a way to hide these? Cheers Nick How would Alfred know whether or not you were trying to action the workflow/script filter or doing a generic search for other matching items? Should prob just try setting a different keyword. Link to comment
untidey Posted August 1, 2013 Author Share Posted August 1, 2013 (edited) Having played around a bit more, I see your point. I'll just live with it. Edited August 1, 2013 by Nick T Link to comment
jdfwarrior Posted August 1, 2013 Share Posted August 1, 2013 Alfred wouldn't know, but I would which is why I've the specific keyword I've chosen. I assumed the script filter results would override any other results. It would be nice to have an option to suppress default results. It's crazy to think I'd have to keep trying different keywords until I find one that doesn't return default results. Alfred wouldn't know, but I would which is why I've the specific keyword I've chosen. I assumed the script filter results would override any other results. It would be nice to have an option to suppress default results. It's crazy to think I'd have to keep trying different keywords until I find one that doesn't return default results. But by following that logic, you are basically saying "Alfred should know that I am wanting to execute this script filter and not perform a search". How would he know that? It still matches other items. Following that, if I typed 's', Alfred should read my mind and know that I want Safari and not show results for Sublime Text, App Store, Sequel Pro, System Prefs, Sharing, etc. I know it sounds like a silly example, but its the same principle. If Alfred didn't show other results just because it matched a keyword for a script filter, then I would never be able to launch Rdio because the workflow to search Rdio's keyword is rdio. Link to comment
untidey Posted August 1, 2013 Author Share Posted August 1, 2013 (edited) That's not exactly what I meant. A disconnect occurs between me and Alfred because I'm using an optional argument on the script filter out of necessity, but actually intend for their to be an argument in practical use. I type 'n' and the script filter shows a list of existing files. Then I either select one of the existing filenames or type a new string which gets passed to nvAlt and created as a new file. I need the optional argument in order to show the list of existing files to begin with. Alfred, quite rightly, matches the script filter and default results the moment I press 'n'. Now that I've actually thought about it, I see there's no reasonable alternative and given that my script filter results are prioritised it's really a non-issue anyway. Edited August 1, 2013 by Nick T Link to comment
jaster Posted April 28, 2014 Share Posted April 28, 2014 I think we could get around this if the developers add the option for a script filter to only activate/show its results if the user presses 'enter' after they type the keyword. I too have this problem as I've set up a script filter called 'sync' and it also shows two applications that the 'sync' keyword applies to. If I had the option in Alfred, I would gladly have it set to run the script filter only when I chose the 'sync' workflow in the results and press the 'enter' key. Link to comment
deanishe Posted April 30, 2014 Share Posted April 30, 2014 (edited) I think we could get around this if the developers add the option for a script filter to only activate/show its results if the user presses 'enter' after they type the keyword. I too have this problem as I've set up a script filter called 'sync' and it also shows two applications that the 'sync' keyword applies to. If I had the option in Alfred, I would gladly have it set to run the script filter only when I chose the 'sync' workflow in the results and press the 'enter' key. Unfortunately, that doesn't solve the problem of "how can Alfred know if you want the sync workflow or other results containing 'sync'?". If you, as the developer, set some flag to ensure that only the workflow is shown, you'd likely break things for any of your workflow users who want to use an app called "sync". In such cases, a good solution is to use a keyword like ".sync" or "/sync", not just "sync". This will do what you want, and won't make other results inaccessible. Edited April 30, 2014 by deanishe Link to comment
jaster Posted May 1, 2014 Share Posted May 1, 2014 (edited) Unfortunately, that doesn't solve the problem of "how can Alfred know if you want the sync workflow or other results containing 'sync'?". If you, as the developer, set some flag to ensure that only the workflow is shown, you'd likely break things for any of your workflow users who want to use an app called "sync". In such cases, a good solution is to use a keyword like ".sync" or "/sync", not just "sync". This will do what you want, and won't make other results inaccessible. Currently I do have my sync workflow keyword with a period before it ".sync" to get around ths issue. But by "developers" I meant the team behind Alfred itself. I am really not sure if script filters provide this feature already but I've made two images to illustrate my problem better: What it currently does (mixes the script results in with the default results if you don't use a unique keyword): What I'd like it to do: Edited May 1, 2014 by jaster Link to comment
rice.shawn Posted May 1, 2014 Share Posted May 1, 2014 Actually, you can do this now. So, just make a keyword (not script filter) called "sync" and attach it to a "run script" (Applescript) object. Next, create an "External Trigger" that links directly to a script filter that has no keyword, space not required, argument required. To get Alfred to let you save a script filter without a keyword, you'll have to enter something like the placeholder text, but it really doesn't matter. Then, put the contents of your current script filter in the keyword-less script filter. Lastly, make that Applescript "run script" option to invoke the External Trigger. Now, when you type, your keyword will appear, and, after the user presses enter, it will invoke the script filter. (Note: current pre-release needed). Link to comment
jaster Posted May 2, 2014 Share Posted May 2, 2014 Cheers Shawn. I'll give that a shot. 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