Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adnasa
Copy link
Member

@adnasa adnasa commented Sep 4, 2016

This PR adds the feature to support for plugins to copy their values to clipboard upon execution.

I added documentation on the keys that I could explain sufficiently, as well which is why I left out helpers and execute

}
break;
case 'copy':
clipboard.writeText(message.item.arg);
Copy link
Member Author

@adnasa adnasa Sep 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add the following as well (later on):

  • a confirmation dialog that the value has been copied to clipboard
  • thunk callback style support so plugins who implement this action can act accordingly when the action is done. This should actually not be specific to copy btw

@vutran
Copy link
Member

vutran commented Sep 4, 2016

Great addition. I think it would be best if this functionality could be implemented aside to the main action when the user uses cmd+c for OS X and ctrl for the other platforms. This would preserve the action property to open the URL or execute another action.

I'm not sure how Alfred structures this in their JSON schema at the top of my head but would need to look into it. I would figure it would be a property per result item.

A prime example would be the calculator plugin where the action could just open the native calculator app and cmd+c would copy it to clipboard.

@adnasa
Copy link
Member Author

adnasa commented Sep 4, 2016

okay.. hmm, I'll have to take a deeper look into it because I can really answer that :)
But what shall we do about this PR? discard it?

@vutran
Copy link
Member

vutran commented Sep 4, 2016

We'll keep it open for now until we have a better understanding on where to go with this.

@vutran
Copy link
Member

vutran commented Sep 4, 2016

Alfred's schema currently supports this through a text property in each item which you can define what will be copied. (reference)

screen shot 2016-09-04 at 2 08 44 pm

@vutran
Copy link
Member

vutran commented Sep 13, 2016

I've just merged in the initial implementation of the clipboard functionality here: 7c13a0e.

This enables users to use the normal: cmd + c to copy an item into their clipboard. It would retrieve item.text.copy by default, and fallback to item.arg if item.text.copy isn't specified. An example is made in the calculator plugin.

@adnasa
Copy link
Member Author

adnasa commented Sep 13, 2016

Cool! looks like we can close this PR, then

@vutran vutran closed this Sep 13, 2016
@adnasa adnasa deleted the copy-to-clipboard branch October 1, 2016 01:59
@vutran vutran mentioned this pull request Oct 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants