lilyball Posted October 28, 2015 Posted October 28, 2015 Various actions in Alfred support pressing Cmd-C to copy them. I'd love to be able to support this in my workflow. Specifically, I'm creating a workflow right now that runs a script with a keyword trigger with the action being Copy to Clipboard & Automatically paste. I want to be able to press Cmd-C to just copy without pasting. Three thoughts on how to do this: 1. If an action would Copy to Clipboard, support Cmd-C to copy as well without pasting (and without running any other actions). This would only work for actions that already copy though. 2. More generally, Alfred could support just copying the output of any script to clipboard with Cmd-C. The downside here is you'd get the exact output of the script, which may not be correct (e.g. the Copy to Clipboard action may add other text around the {query}). 3. A variant on #1, perhaps the Copy to Clipboard action could gain a new boolean option "Copy only with Cmd-C". This way you could add Cmd-C support to existing workflows but have it only copy on Cmd-C and not on normal action triggering.
lilyball Posted October 28, 2015 Author Posted October 28, 2015 Related to this would also be supporting Cmd-L to do Large Type with the output of a workflow command. For example, if I type "=1+2" and hit Cmd-L, it shows "3", but if I run a workflow command instead, Cmd-L just shows exactly what I typed (even for script filter workflows).
Andrew Posted October 28, 2015 Posted October 28, 2015 There is support for this in the Script Filter workflow object XML, take a look at the "text" attribute here: https://www.alfredapp.com/help/workflows/inputs/script-filter/#xml Cheers, Andrew
lilyball Posted November 3, 2015 Author Posted November 3, 2015 Oh wow when did that documentation show up? I've always used http://www.alfredforum.com/topic/5-generating-feedback-in-workflows/as my source for this stuff, and it doesn't mention that. You should update that forum post to link to the documentation.
lilyball Posted November 3, 2015 Author Posted November 3, 2015 Also, after reading that, it seems the support you have right now is for copying data from the XML output. That's still not usable for my purposes. I want to be able to run a script action and copy the results of that instead. The reason being I don't want to run the action on multiple different results when the user can't copy them all, and may not even copy any. I just want to run my action once the user has told me that they need the results.
Andrew Posted November 4, 2015 Posted November 4, 2015 Also, after reading that, it seems the support you have right now is for copying data from the XML output. That's still not usable for my purposes. I want to be able to run a script action and copy the results of that instead. The reason being I don't want to run the action on multiple different results when the user can't copy them all, and may not even copy any. I just want to run my action once the user has told me that they need the results. This isn't going to be possible, because at the point the user uses cmd+c, the current selected item is copied to the clipboard (or the pre-specified text). There is no provision for running an action when the user wants to copy. One option could be running an alternate output from the filter input (e.g. alt+return) and in the run script for this output, do the processing you require then use a pbcopy to populate the clipboard.
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