automatically update references

I have sontinued playing with AutoHotKey to automate EndNote and have come up with this script to automate the changing of fields and copying of others after import:

SetTitleMatchMode,1 ; title must begin with String
IfWinExist,EndNote X7 - [aecclib] ; set the library to what ever your library is - mine is aecclib
{
   WinActivate
   Send !t ; send alt t to access the tools menu
   Send {c 2} ; send to c keystrokes to access the change submenu
   Send {ENTER} ; send enter key to choose menu
   Send {c 7} ; send the c key 7x to choose the Custom 8 field
   Send {TAB 2} ; send the tab kay twice to position in change area
   Send {Down 2} ; send down key twice to choose “replace whole field with:”
   Send {TAB} ; to get to text field
   Send aftergrant2012_09 after2014SFURequest after2014Progressreport ; enter text for excludes in custom 8 field
   Send {TAB}
   Send {ENTER 2}
   sleep 5000 ; sleep 5 seconds to allow updating
   Send {Enter}
; finished section 1 - entering excludes into custom 8 field
sleep 1000 ; sleep for 1 second
   Send !t ; send alt t to access the tools menu
   Send {c 2} ; send to c keystrokes to access the change submenu
   Send {ENTER} ; send enter key to choose menu
   Send {r 4} ; send the r key 4x to choose the Reviewed Item field
   Send {TAB 2} ; send the tab kay twice to position in change area
   Send {Down 2} ; send down key twice to choose “replace whole field with:”
   Send {TAB} ; to get to text field
   Send 2014 from pubmed ; enter text in Reviewed Item field
   Send {TAB}
   Send {ENTER 2}
   sleep 5000 ; sleep 5 seconds to allow updating
   Send {Enter}
; finished section 2 - entering origin of pub (pubmed) and date into reviewed Item field
sleep 1000 ; sleep for 1 second
   Send !t ; send alt t to access the tools menu
   Send {c 2} ; send to c keystrokes to access the change submenu
   Send {ENTER} ; send enter key to choose menu
   Send +{TAB} ; access menu one above
   Send {Right} ; move right one tab
   Send {TAB} ; move to from field
   Send {a 4} ; press a 4x to choose accession number
   Send {Tab}
   Send {L} ; choose label field
   Send {TAB}
   Send {Down 2} ; choose replace entire field
   Send {TAB 2} ; two tabs if the former field is chosen
   Send {Down} ; choose to copy field
   Send {TAB} ; to get to next field
   Send {ENTER}
   Send {ENTER}
   sleep 5000 ; sleep 5 seconds to allow updating
   Send {Enter}
; finished section 3 - copying pmid to label (copy accession number field to label field for duplicate checking)
sleep 1000 ; sleep for 1 second
   Send !t ; send alt t to access the tools menu
   Send {c 2} ; send to c keystrokes to access the change submenu
   Send {ENTER} ; send enter key to choose menu
   Send +{TAB} ; access menu one above
   Send {Right} ; move right one tab
   Send {TAB 4} ; go to move/copy selection
   Send {Down} ; ; choose to copy field instead of moving
   Send {TAB 4} ; move from copy field to from field
   Send {r 3} ; press r 3x to choose record number
   Send {Tab} ; move to “to” field
   Send {c 8} ; press c 8x to choose call number field
   Send {TAB} ; move to next field
   Send {Down 2} ; choose replace entire field
   Send {TAB 3} ; three tabs if the former field is chosen
   Send {ENTER 2}
   sleep 1000 ; sleep for 1 second
   Send {Enter}
; finished section 4 - copying record number to call number field in case of record number change
}

The down side to this script is that it starts acting as soon as it is invoked if the EndNote window and library are open.  So the best way to use this, I have found, is to import new records - or select and show only those you wish to update, then invoke the script.  This will update all records being shown in the endnote window.

I have also attached the script - in case you want to try it out (just change the extension from .txt to .ahk).

ALWAYS make a backup before trying anything like this.  I make a backup of my library using the File->Compressed library (.enlx) … command before any change and at least once a day.

update new records on import.txt (3.01 KB)