Separate Field for Last Author

I completely agree with this idea. The way we talk about papers in my group, a last author field would actually be significantly more useful than the first author functionality that exists. While this new field should definitely be added to EndNote by the developers, I have created a workaround that can be used in the meantime, though only on Macs.

If anyone wants to use this script, I urge you to back up your library first. It’s worked without any problems for me, but better safe than sorry. The following AppleScript will (possibly only if EndNote is open?) take the last name in the author field of every reference and copy it to the “Custom 8” field, which can then be used as a last author field. You can show the new field in the reference list by adding it under “Display Fields” in the settings, and also change its name to “Last Author”, or whatever you’d like. If you aren’t using EndNote X9, you’ll need to change that bit to whatever version you’re using in the script.

The best way I’ve found to use this is to create a service that can be run from EndNote. To do this, open the application Automator and choose the service template. Change “Service receives selected  text  in  any application” to “Service receives  no input  in  EndNote X9.app”. Add a “Run AppleScript” action (it’s under Utilities), and paste the script over everything that’s already there. Save the service as whatever you want it to be called (“Fill last author field” for instance), and it will be added to the services menu item in EndNote. You can also add a keyboard shortcut if you want, by going to System Preferences > Keyboard > Shortcuts. Select Services from the sidebar and find your service. Add a shortcut by double clicking (none).

Finally, go to System Preferences > Security > Privacy > Accessibility and add Automator to apps allowed to control your computer - I don’t think it will work without this step, but I had already enabled this, so I haven’t tested without doing it. Feel free to try without it first.

You’ll need to run this script after you add new references to populate the new Last Author field. The first time I ran it on all my references it took some time, but it’s quick when you only have a few new references with unpopulated Last Author fields.

Here’s the script:

on run {input, parameters}

    tell application “EndNote X9”

        set res to retrieve “all” records in first document

        repeat with myRecID in res

            set current_last_author to field “Custom 8” of record myRecID

            if current_last_author is equal to “” then

                set author to field “Author” of record myRecID

                set last_author to last paragraph of author

                set field “Custom 8” of record myRecID to last_author

            end if

        end repeat

    end tell

end run


endnote_last_author_service_screenshot.jpg