Jump to content
bocaboy

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

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

That did it! It works like a charm. Thank you so-o much. This will make a dramatic difference in my being able to process the large number of images I receive every day and sort them appropriately.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...