johnjoonso Posted November 19, 2014 Share Posted November 19, 2014 (edited) I would like to create a workflow that is close to the 'Filter from keyword and reveal', with a limited search scope but instead of display the search results in the Alfred window, I'd like it to reveal all search results in Finder (like spotlight, but restricted to a specific folder). Any advice is much appreciated. bests John Edited November 19, 2014 by johnjoonso Link to comment
jdfwarrior Posted November 22, 2014 Share Posted November 22, 2014 I would like to create a workflow that is close to the 'Filter from keyword and reveal', with a limited search scope but instead of display the search results in the Alfred window, I'd like it to reveal all search results in Finder (like spotlight, but restricted to a specific folder). Any advice is much appreciated. bests John So this would be a file filter with a limited scope, and you want to reveal them all in Finder? Would using the default Ctrl+Return hotkey on the result work? I guess I'm just trying to figure out exactly what you're wanting.. Link to comment
deanishe Posted November 25, 2014 Share Posted November 25, 2014 As he says, when he hits ALT+ENTER to show the results "in Spotlight", he wants the search scope to be limited to the same scope as the File Filter, not "This Mac", which is what Alfred does. For example: I have a File Filter set up to search ~/Dropbox. If I hit ALT+ENTER on any result to search with Spotlight, the scope is no longer ~/Dropbox, but the entire system. Link to comment
johnjoonso Posted November 26, 2014 Author Share Posted November 26, 2014 (edited) So this would be a file filter with a limited scope, and you want to reveal them all in Finder? Would using the default Ctrl+Return hotkey on the result work? I guess I'm just trying to figure out exactly what you're wanting.. First part yes, second part: when I press Ctrl+Return on my File Filter with a limited scope (keyword is 'fonts'), it brings up a Web Search with 'fonts foobar'. As he says, when he hits ALT+ENTER to show the results "in Spotlight", he wants the search scope to be limited to the same scope as the File Filter, not "This Mac", which is what Alfred does. For example: I have a File Filter set up to search ~/Dropbox. If I hit ALT+ENTER on any result to search with Spotlight, the scope is no longer ~/Dropbox, but the entire system. Yes! Except, Alfred also uses whatever is highlighted in the search result instead of my original search term, i.e. if I activated the workflow using 'find helvetica', and I pressed Alt+Enter, instead of showing a finder spotlight search looking for 'Helvetica', it's looking for the highlighted results 'HelveticaNeueeTextPro-Bold', which is not what I want. Edited November 26, 2014 by johnjoonso Link to comment
deanishe Posted November 26, 2014 Share Posted November 26, 2014 Got you. If you want to create a workflow to do this mdfind is your friend. It's the command-line equivalent of Spotlight. There are loads of great examples of how to use it online. Here's a pretty simple workflow that uses mdfind to show a list of Sublime Text projects. That might be a good starting point. Link to comment
johnjoonso Posted March 7, 2015 Author Share Posted March 7, 2015 Hey not sure if I need mfdind, I think it's this simple: "fonts foobar" should open a finder search limited to my fonts folder for 'foobar', I don't want the results in alfred. Link to comment
deanishe Posted March 19, 2015 Share Posted March 19, 2015 Use this AppleScript in a Run Script action (Language /usr/bin/osascript): set theQuery to "{query}" tell application "Finder" set thePath to (home as Unicode text) & "Fonts" set theDirectory to thePath as alias open theDirectory activate -- Change the delay to something long enough so that -- the Finder window is activated and receives the -- keystroke events delay 0.3 tell application "System Events" tell process "Finder" set value of text field 1 of group 5 of toolbar 1 of front window to theQuery keystroke "f" using {command down} end tell end tell end tell You might have to alter the ...text field 1 of group 5 of toolbar 1... line if you've customised Finder's toolbar. 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