Jump to content

Copy a selected file(s) to a specific location


Recommended Posts

I'd like to create a workflow that takes a file and copys it to a specific location. As an example, I'd like to assign a key combo to a workflow that would allow me to take a highlighted file and automatically copy it to a folder called dailies. If one exists, I'd sure appreciate it if someone would point me to it. If it doesn't yet exist, can someone tell me how to create it?

 

Many thanks!!

Edited by bocaboy
Link to comment

I'd like to create a workflow that takes a file and copys it to a specific location. As an example, I'd like to assign a key combo to a workflow that would allow me to take a highlighted file and automatically copy it to a folder called dailies. If one exists, I'd sure appreciate it if someone would point me to it. If it doesn't yet exist, can someone tell me how to create it?

 

Many thanks!!

 

Sorry it took a bit to get back with you on this. I completely missed this. I'd be happy to help you get this working.

 

There are two ways you could do this. With a file action, where you would select the files in Alfred, using the buffer, then use a result action to copy them all to the location.. or, using a hotkey as you had mentioned and just selecting the files in Finder and  pressing the hotkey to copy them to the destination. Or, you could set up the workflow to do both.

 

Here's what to do. Create a new workflow, set all your details for it then add a new Action->Run Script and drop in this code.

list="{query}"
IFS="	"
for x in $list; do
	cp "$x" "/Users/david/Desktop"
done
 

Then change the /Users/david/Desktop path to whatever you want the destination to be. After you have that set.. lets go back and select the activation method.

 

For the hotkey.. add a Trigger->Hotkey item, set your hotkey sequence, then for the Argument, set the value to "Selection in OS X". Save the hotkey and connect it to the Run Script item.

For the result action.. add a Trigger->File Action, give it a name and select that it can accept multiple files, Save, and attach to the Run Script.

For both.. just do both of the methods above. Then you can just pick how you want to do it.

Link to comment

David, I followed your directions but don't seem to be able to get it to work. When I run it with the key combo I've selected (^⌥⌘6) the only thing that happens is the File menu in Finder flashes for a second, but the files I've chosen isn't moved. Here's what my workflow looked like...

 

alfred1.jpg

Link to comment

David, I followed your directions but don't seem to be able to get it to work. When I run it with the key combo I've selected (^⌥⌘6) the only thing that happens is the File menu in Finder flashes for a second, but the files I've chosen isn't moved. Here's what my workflow looked like...

 

alfred1.jpg

 

One thing I forgot that may be causing it is spaces in the file path. In the Run Script, untick the Spaces option. The path is enclosed in quotes anyway so it's not needed

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...