Jump to content

Replace semicolons (or commas) on clipboard with linebreaks


Recommended Posts

Keywords in academic articles are usually separated by semicolons or commas but if you try to copy and paste these keywords into Zotero (and possibly other reference managers), the whole list will be converted into a single tag. In order for Zotero to create a separate tag for each keyword, each keyword has to be in a line of its own. In other words: semicolons/ commas need to be replaced by linebreaks. And that's exactly what this workflow does.


The workflow provides two ways of achieving the same thing:

  1. You can copy the keywords the normal way (⌘+C) and then use the assigned hotkey to paste them, or
  2. You can copy the keywords using universal actions (Select "Replace semicolons and copy") and then paste them the normal way (⌘+V).


Either way, semicolons will be replaced by linebreaks.


So replacing semicolons is the default behaviour but in both cases, you can use the option key to replace commas instead of semicolons.


Note: this is my first workflow and I'm sharing it here partly because I'd like to learn how the workflow could be optimised (I went for the first solution that came to mind, and I have little to no knowledge of the tricks and tweaks that can be achieved with Alfred Workflows. So feel free to improve it and share a new version here.


The workflow file is here: https://github.com/tophee/alfred_workflow-replace_semicolons/blob/main/Replace semicolons with linebreaks.alfredworkflow 

Link to comment
Share on other sites

  • 3 months later...
4 hours ago, Toffy said:

Note that it should say "commas" instead of "colons".

Ah, you’re right, I’ll have that fixed shortly. I’ve also sent a PR to fix the Hotkey’s note. Thank you for checking!

Edited by vitor
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...