sphardy Posted February 15, 2013 Share Posted February 15, 2013 Hi When adding files to the file buffer is it possible to copy the files to the clipboard so that I can then paste them into another application? thanks ///sphardy Link to comment
scottisloud Posted March 6, 2013 Share Posted March 6, 2013 Do you want the file path copied or the file itself? Link to comment
sphardy Posted March 8, 2013 Author Share Posted March 8, 2013 Hi - I'm looking for an option to copy the actual file(s). It appears for now that Alfred can only copy the file path to the clipboard Link to comment
jdfwarrior Posted March 8, 2013 Share Posted March 8, 2013 Hi - I'm looking for an option to copy the actual file(s). It appears for now that Alfred can only copy the file path to the clipboard Unless you have disabled the action in preferences (Features->File Search->Actions) then the Copy To action should still be available for multiple items added to the buffer. Link to comment
sphardy Posted March 8, 2013 Author Share Posted March 8, 2013 Yes, but Clipboard is not a destination I can copy to Link to comment
jdfwarrior Posted March 8, 2013 Share Posted March 8, 2013 Yes, but Clipboard is not a destination I can copy to I don't understand why you would need it to be. If you're copying the files, the only final outcome of that is to paste them somewhere else, which would be the same thing as just using the Copy To action. Link to comment
sphardy Posted March 8, 2013 Author Share Posted March 8, 2013 Not if I want to past them into another app Example: I've been consolidating a lot of data files into Evernote notebooks together with various text notes etc. Lots of copy & pasting from various sources that I could do almost entirely without resorting to mouse or trackpad if this option was supported Link to comment
ctwise Posted March 8, 2013 Share Posted March 8, 2013 Just create a file action workflow. 'cat <all the files> | pbcopy' will do what you want. Link to comment
sphardy Posted March 8, 2013 Author Share Posted March 8, 2013 Like the suggestion, but doesn't pbcopy / pbpaste only work with text files? That said, I tried your suggestion using a workflow with a file action passing arguments to a script of: cat "{query}" | pbcopy Didn't work with text or other files Workflow I tried is here: http://sphardy.net/FsKu Link to comment
ctwise Posted March 8, 2013 Share Posted March 8, 2013 Like the suggestion, but doesn't pbcopy / pbpaste only work with text files? That said, I tried your suggestion using a workflow with a file action passing arguments to a script of: cat "{query}" | pbcopy Didn't work with text or other files Workflow I tried is here: http://sphardy.net/FsKu Alfred separates filenames with tabs. 'cat' doesn't understand tab separated filenames. The simplest approach is this: echo "{query}" | sed -e 's/ /\\ /g' | xargs cat | pbcopy Tell Alfred to escape double quotes and nothing else. This pipes the result through 'sed' to escape spaces, then through xargs to split out the arguments to cat. Link to comment
sphardy Posted March 8, 2013 Author Share Posted March 8, 2013 Thanks again for the efforts - your suggestion works with text files, but not binaries, I guess due to the limitations of pbcopy I'm wondering if the capability could be achieved via apple script, perhaps somehow calling finder to copy the files to the clipboard? Link to comment
ClintonStrong Posted March 13, 2013 Share Posted March 13, 2013 This is doable with some AppleScript (using "the clipboard"), but it only supports one file. The best method I could find was to use NSPasteboard in Cocoa. Here's a quick workflow to accomplish this: http://www.alfredforum.com/topic/831-copy-files-to-clipboard/ Link to comment
sphardy Posted March 14, 2013 Author Share Posted March 14, 2013 Many thanks to Clinton for building this - works exactly as hoped Link to comment
Recommended Posts