andy4222 Posted August 4, 2022 Posted August 4, 2022 Hi everyone, I am trying to create a workflow that has a File Filter which shows list of files in the specific directory and opens it in a specific app (VS Code in this case). If the file is not found, I should be able to: - Open VS Code, or - Create a file and open it in VS Code. However with File Filter, I am not able to figure out a path forward once no file is found. I somehow need to be able to connect that to Run Script so I can do the above actions. Any suggestions please?
vitor Posted August 4, 2022 Posted August 4, 2022 A File Filter’s purpose is to find paths, it must pass something along. Passing nothing would be unpredictable without prior setup. A simple way to do what you want is to add a Keyword Input and have its keyword be the same as the File Filter’s. That way when the File Filter has no results, the Keyword will still now. Note that for It to work you have to type the full File Filter Keyword, you can’t type part of it then ↩ to autocomplete, because that will tell Alfred that’s specifically what you want and won’t show the Keyword Input. Another option is a Fallback Search Trigger.
andy4222 Posted August 4, 2022 Author Posted August 4, 2022 Thanks for the keyword suggestion. But then it shows up like this (1st one is file filter, second is keyword): Anyway I can just have keyword and pass in the args from keyword search to the file filter, and then file filter's functionality starts working?
vitor Posted August 5, 2022 Posted August 5, 2022 On 8/4/2022 at 9:57 PM, andy4222 said: But then it shows up like this (1st one is file filter, second is keyword) Isn’t that the ideal scenario? On 8/4/2022 at 9:57 PM, andy4222 said: Anyway I can just have keyword and pass in the args from keyword search to the file filter, and then file filter's functionality starts working? Connect one directly to the other.
andy4222 Posted August 5, 2022 Author Posted August 5, 2022 (edited) 1 hour ago, vitor said: Connect one directly to the other. Then I need to press enter before before the File Filter kicks and starts showing suggestions. I was looking for something where as soon as I start typing, all files/folder start showing up, if nothing exists, it offers me to create a file for me. I can think of Script Filter that can do this, but I don't wanna build a File Filter functionality within Script Filter Edited August 5, 2022 by andy4222
vitor Posted August 5, 2022 Posted August 5, 2022 11 minutes ago, andy4222 said: was looking for something where as soon as I start typing, all files/folder start showing up That’s the File Filter. 11 minutes ago, andy4222 said: if nothing exists You will only see the Keyword Input. Why isn’t that workable?
andy4222 Posted August 6, 2022 Author Posted August 6, 2022 This is what I did. When I type "code", it shows only one options which is fine, but doesn't show any suggestions (picture 2). So I have to press enter, then it takes me to a File Filter where it starts showing suggestions (pic 3). I want it to start showing suggestion in box 2, but if anything isn't available, it should provide me ability to create a file via Run Script
vitor Posted August 6, 2022 Posted August 6, 2022 I’m referring to the previous solution. Why isn’t that one workable?
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