Reply
Frequent Contributor
Posts: 66
Registered: ‎03-15-2012
0

Re: 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.

Thomas Zucker-Scharff
Systems Analyst
New User
Posts: 1
Registered: ‎08-20-2015
0

Re: automatically update references

Although it is probably justified to ask the user to accept one by one with the updated reference, avoiding data loss, it is not actually well designed, it is annoying. At least the button "update all fields" and the button "save updates" can be a bit closer, right? Or how about ask the users to accept one by one (if we assume endnote really cannot make a backup), and save them all together at the end. Please just admit it, there is a plenty of room to improve this fantastic feature.

New User
Posts: 1
Registered: ‎10-19-2016
0

Re: automatically update references

I know this thread is really old, but unfortunately the problem persists! See below for my AutoHotKey code to run Find Reference Updates and press only Update Empty Fields when available. Since I spent enough time on it, I figured I should share in case anyone else is having the same problem. 

 

; This AutoHotKey script performs the following actions:
; 1. Checks that EndNote is open
; 2. Initiates "Find Reference Updates" for selected publications
; 3. Checks for the existence of a "Review Available Updates" window, then activates that window
; 4. Automates the acceptance of empty field changes for each record, or skips records with no "Update Empty Fields" option
;
; To use:
; 1. Turn off EndNote's A)"We were unable to find a reliable match for this record" error, and B) "No updates were found at this time." error
; 2. Select desired publications to update
; 3. Open or reload this AutoHotKey file
; 4. Press ctrl-shift-f (f for find!)
;
; This script written by Melissa Day                                  

^+f::

SetTitleMatchMode,1 ; title must begin with String
IfWinExist,EndNote  ; make sure EndNote is open first
{
  Send !r      ; press alt r to access the references menu
  Send {f 3}   ; press f 3x to access "Find Reference Updates"
  Send {ENTER} ; enter to choose
  sleep,200    ; wait

  Loop
  {
    SetTitleMatchMode,2 ; title must contain string
    IfWinExist,Review Available Updates       ; wait for correct window
;    WinWaitActive,Review Available Updates   ; alternative
;    If WinActive("Review Available Updates") ; alternative
    {
;      MsgBox, Active-Review Available Updates          ; checkpoint
      WinActivate
      ControlGet, status_UEF , Enabled, , Update Empty Fields ->
      ControlGet, status_skip, Enabled, , Skip
;      MsgBox, UEF #%status_UEF% & skip #%status_skip%  ; checkpoint

;;;;; If Update Empty Fields button is available, click it & save
      If (status_UEF = 1) {
        ControlClick, Update Empty Fields ->, Review Available Updates
        sleep,1000       ; wait (length is important here)
        ControlClick, Save Updates, Review Available Updates
        sleep,1000       ; wait
      }

;;;;; If Update Available Fields isn't available, click Skip instead
      else if (status_UEF = 0) and (status_skip = 1) {
        ControlClick, Skip, Review Available Updates
      }

;;;;; If Update Available Fields AND Skip aren't available, click Cancel
      else if (status_UEF = 0) and (status_skip = 0) {
        ControlClick, Cancel, Review Available Updates
      }

      sleep,3000        ; wait for entry to advance

;;;;; To thwart screensaver in case of long runs
      MouseMove,  1, 0, 1, R ; Move the mouse one pixel to the right
      MouseMove, -1, 0, 1, R ; Move the mouse back one pixel

    }
  }
}

New User
Posts: 3
Registered: ‎11-22-2016
0

Re: automatically update references

Hi Leanne,

I can't update references.  Any suggestions?

Regards,

M

New User
Posts: 3
Registered: ‎11-22-2016
0

Re: automatically update references

Hi Leanne,

I can't update references.  Any suggestions?

Regards,

M

Highlighted
Mentor
Posts: 7,224
Registered: ‎04-10-2008
0

Re: automatically update references

[ Edited ]

No suggestions other than calling Tech Support (but perhaps not the day before Thanksgiving ...on this occassion you might try submitting the problem online).  I am taking off for the holidays! (but I don't work for TR, so don't blame me!)  -- perhaps anyone else who can help might post on your new thread here.  

(long time Endnote user)