ctwise Posted March 21, 2013 Share Posted March 21, 2013 The hotkey option to pass selected text through to the next stage in the workflow is a problem for many cases. For example, if I select a large chunk of text and try to pipe it through to the clipboard, I'm going to have to save it to a temporary file first to avoid escaping issues. I would like the option to trigger a copy directly from the workflow instead. Link to comment Share on other sites More sharing options...
jdfwarrior Posted March 22, 2013 Share Posted March 22, 2013 The hotkey option to pass selected text through to the next stage in the workflow is a problem for many cases. For example, if I select a large chunk of text and try to pipe it through to the clipboard, I'm going to have to save it to a temporary file first to avoid escaping issues. I would like the option to trigger a copy directly from the workflow instead. I'm not really following what it is that you're looking for. By creating a hotkey and setting the argument to "Selection in OSX" you can grab the selected text and then use a Copy To Clipboard module to copy that data to the clipboard. What is it exactly that you are wanting to do with the data? Link to comment Share on other sites More sharing options...
ctwise Posted March 22, 2013 Author Share Posted March 22, 2013 (edited) I'm not really following what it is that you're looking for. By creating a hotkey and setting the argument to "Selection in OSX" you can grab the selected text and then use a Copy To Clipboard module to copy that data to the clipboard. What is it exactly that you are wanting to do with the data? It's the part in between that's the problem. I can mostly get there by doing something like this: [ruby] # had to comment out below line because you can't just echo large amounts of random crap to the shell #`echo "{query}" | command-line-application` # instead I have to save the contents to a file selection = <<MY_HERE_DOC_HOPE_ITS_NOT_IN_THE_SELECTION {query} MY_HERE_DOC_HOPE_ITS_NOT_IN_THE_SELECTION file = Tempfile.new file.write selection file.close `cat #{file.path} | command-line-application` Now, if I could just have the selection auto-copied to the clipboard, I could do this: [ruby] `pbpaste | command-line-application` Edited March 22, 2013 by ctwise Link to comment Share on other sites More sharing options...
jdfwarrior Posted March 22, 2013 Share Posted March 22, 2013 It's the part in between that's the problem. I can mostly get there by doing something like this: [ruby] # had to comment out below line because you can't just echo large amounts of random crap to the shell #`echo "{query}" | command-line-application` # instead I have to save the contents to a file selection = <<MY_HERE_DOC_HOPE_ITS_NOT_IN_THE_SELECTION {query} MY_HERE_DOC_HOPE_ITS_NOT_IN_THE_SELECTION file = Tempfile.new file.write selection file.close `cat #{file.path} | command-line-application` Now, if I could just have the selection auto-copied to the clipboard, I could do this: [ruby] `pbpaste | command-line-application` This may lead to the same issue you mention above and probably isn't favored but have you tried to do something like grab the data and save it to the clipboard using a simple applescript? tell application "System Events" to keystroke "c" using command down tell application "System Events" to return (the clipboard as text) I used that.. Stuck a keyword in front of it and large type after, and that would grab selected text and show it in large type. Or.. this seems to work for me... echo "{query}" | pbcopy pbpaste Especially after telling it to escape double quotes. Would that not work? Link to comment Share on other sites More sharing options...
ctwise Posted March 22, 2013 Author Share Posted March 22, 2013 This may lead to the same issue you mention above and probably isn't favored but have you tried to do something like grab the data and save it to the clipboard using a simple applescript? tell application "System Events" to keystroke "c" using command down tell application "System Events" to return (the clipboard as text) I used that.. Stuck a keyword in front of it and large type after, and that would grab selected text and show it in large type. Or.. this seems to work for me... echo "{query}" | pbcopy pbpaste Especially after telling it to escape double quotes. Would that not work? Never mind, turns out the selection works by copying to the clipboard anyway. I never even tried it first. You can even see it happen because the Edit menu flashes. Link to comment Share on other sites More sharing options...
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