JoeKueser Posted March 22, 2013 Share Posted March 22, 2013 This should be the simplest workflow ever devised. I wanted to simply be able to select a file in my downloads folder or a DMG, wake Alfred up and type "install" and the workflow would simply copy the selected .app file to your /Applications folder. I've tried a few different ways, but I think the right way is a file filter followed by a script. So I have a file filter set up to take only application files, and I have a script that executes: "cp -R {query} /Applications/" I thought it could be a permissions thing, so I'd need "sudo cp -R {query} /Applications/", but wasn't sure if Alfred could handle sudo, so I switched to doing "cp -R {query} ~/Applications/" but still nothing. Incidentally, if I run "cp -R SomeCool.app /Applications/" in the terminal, it works like a champ, no sudo needed. If anyone could shed some light on where my thinking is flawed (in relation to this workflow, not in general) it would be greatly appreciated. Thanks! Link to comment
jdfwarrior Posted March 22, 2013 Share Posted March 22, 2013 This should be the simplest workflow ever devised. I wanted to simply be able to select a file in my downloads folder or a DMG, wake Alfred up and type "install" and the workflow would simply copy the selected .app file to your /Applications folder. I've tried a few different ways, but I think the right way is a file filter followed by a script. So I have a file filter set up to take only application files, and I have a script that executes: "cp -R {query} /Applications/" I thought it could be a permissions thing, so I'd need "sudo cp -R {query} /Applications/", but wasn't sure if Alfred could handle sudo, so I switched to doing "cp -R {query} ~/Applications/" but still nothing. Incidentally, if I run "cp -R SomeCool.app /Applications/" in the terminal, it works like a champ, no sudo needed. If anyone could shed some light on where my thinking is flawed (in relation to this workflow, not in general) it would be greatly appreciated. Thanks! Could the path in {query} have had spaces or anything else in it that would have messed it up? Have you tried wrapping {query} in quotes? Link to comment
JoeKueser Posted March 22, 2013 Author Share Posted March 22, 2013 Quotes didn't help. I'm currently leaning toward me just starting with the right place. I see other workflows that are doing something to the file selected in Finder, and they aren't starting with a file filter. All of them seem to be using custom scripts. I might have to go that route. Link to comment
JoeKueser Posted March 22, 2013 Author Share Posted March 22, 2013 I managed to get it working with a Hotkey with no issues. That works fine. Thanks for your help! Simple workflow, but now I can install an app without using my mouse Link to comment
JoeKueser Posted March 22, 2013 Author Share Posted March 22, 2013 FWIW I debugged this by throwing a notification in right after my input, so I could see the query that was getting passed along. Helped a lot. 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