I'd like to make a workflow that will open the file you currently have highlighted in Finder with an app you specify to Alfred.
I'm pretty sure that getting the selected finder item will require applescript, but I'm not entirely sure. I have little coding experience, so I'm basically piecing together different scripts I can find online. So far, I have this:
tell application "System Events"
set app_id to (get the id of application "q" as string)
end tell
tell application "Finder"
set sel to selection
if sel is not {} then
set filepath to item 1 of sel as text
open filepath using application file id "app_id"
end if
end tell
The problems are a) that doesn't work and it depends on you giving Alfred the exact name of the app, rather than just a few letters as in a typical Alfred search. For example I want to be able to select a jpeg in finder, call up Alfred and type "o ps" and have the list of apps show up with the top one being Photoshop, and then press enter and have the file open in Photoshop.
Any help is greatly appreciated. PD