Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Capitalize first letter after ":" as per APA guidelines #224

Open
helsingi opened this issue Sep 4, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@helsingi
Copy link

helsingi commented Sep 4, 2024

Describe the feature

Hi, I was happy to find your plugin to convert all of my Titles into sentence case because that's what APA recommends. But now I need to go through the 700+ items to capitalize the first letter after the colon ":" when available in the title.
Is there, or are you planning to add a feature to help with this?
Thanks

Also, not sure if I should open another issue for this, but would be great to capitalize first letter of countries/cities as well, even in sentence case.

Additional context

No response

@helsingi helsingi added the enhancement New feature or request label Sep 4, 2024
@helsingi
Copy link
Author

helsingi commented Sep 4, 2024

Thanks, so I have to do it manually

@northword
Copy link
Owner

My be write a small script, and use 'Run JavaScript' in 'Tools' -> 'Developer'.

such as:

const items = Zotero.getActiveZoteroPane().getSelectedItems();
for (const item of items) {
    const title = item.getField('title')
    console.log(title)
    const shortTitle = title.split(': ')[1]
    console.log(shortTitle)
    item.setField('shortTitle', shortTitle)
    await item.saveTx()
}

Note: I didn't test this in detail, you'll need to try it with a very small portion of items first to confirm compliance before processing in large batches. It is best to backup your database before processing.

Subsequent plugins might consider adding automatic interception of the title after the colon to fill in the short title. But I'm too busy in the near future to make it happen anytime soon.

@northword
Copy link
Owner

Note: above comment is spam, the link is virals, I have reported to GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 Needs Triage
Development

No branches or pull requests

3 participants
@northword @helsingi and others