Editorial Workflows

Papers 3 Universal CiteKey

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Papers 3 Universal CiteKey
Cody Wu (cody.wu@ualberta.ca)

Description:
Papers 3 utilizes what they call a "Universal CiteKey" generated from the DOI. This is replaced and formatted by the Papers 3 desktop app when you generate the bibliography. While this is fine on the desktop, the iOS Papers application does not generate the CiteKey in the same format making cross-platform work/collaboration exceptionally difficult. This workflow takes the full reference from Papers 3's "Copy Reference" export option and generates/inserts the Universal CiteKey.

Notes:
I recommend that you map the workflow to a keyboard shortcut to allow for easy insertion of references.

Shared by: Cody Wu

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Get Clipboard ?
Generate Text ?
Text
Clipboard
Find ?
Search for
[A-z]+
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
[A-z]+
Set Variable ?
Variable Name
Name
Value
Input
…End If
Generate Text ?
Text
Clipboard
Find ?
Search for
\d{4}
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
\d{4}
Set Variable ?
Variable Name
Year
Value
Input
…End If
Generate Text ?
Text
Clipboard
Find ?
Search for
(10.(\d)+\/([^(\s\>\"\<)])+)
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
(10.(\d)+\/([^(\s\>\"\<)])+)
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import zlib

doi = workflow.get_input()
n_1 = zlib.crc32(doi) & 0xffffffff
n_2 = n_1%260
n_3 = n_2/26
n_4 = n_2%26
hash1 = chr(98+n_3)
hash2 = chr(97+n_4)

action_out = hash1+hash2

workflow.set_output(action_out)
Set Variable ?
Variable Name
Hash
Value
Input
…End If
Generate Text ?
Text
{Name:YearHash}
Replace Selected Text ?
Replacement Text
Input