Jump to content

Need Help: Copy selected .app to /Applications folder


Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...