Jump to content

Support Cmd-C to copy the output of a workflow


lilyball

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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