--- /dev/null
+// ==UserScript==
+// @name set alt+S keyboard shortcut on HIV LANL results page to improve download options
+// @namespace http://tampermonkey.net/
+// @version 0.1
+// @description add alt+S shortcut to include HXB2 seq and label with accession code and patient ID
+// @author You
+// @match https://www.hiv.lanl.gov/components/sequence/HIV/search/search.comp
+// @grant none
+// @run-at document-end
+// ==/UserScript==
+
+(function() {
+ 'use strict';
+
+ function get0(s) {
+ var sel = document.querySelectorAll(s);
+ if (sel.length == 1) {
+ var out = sel[0];
+ console.log(out);
+ return out;
+ }
+ }
+
+ function doStuff() {
+ // onclick="showElt('both'); hideElt('tree'); hideElt('down'); showElt('save')"
+ get0('input[value="Download Sequences"]').click();
+
+ // simulate clicking the "compose a label" link
+ Changesaveoutput();showElt('compose');
+
+ // set options
+ get0('input[name=INCLUDE_HXB2]').checked = true;
+ get0('input[name=comp_sa_genbankaccession]').value = 5;
+ get0('input[name=comp_ssam_pat_id]').value = 6;
+ }
+
+ // https://superuser.com/questions/496212/shortcut-to-open-specific-bookmark-url-in-chrome/1313997#1313997
+ document.addEventListener('keyup', function(event) {
+ if (!event.ctrlKey && event.altKey && !event.shiftKey) {
+ if ('S' == String.fromCharCode(event.keyCode)) {
+ doStuff();
+ }
+ }
+ });
+})();
\ No newline at end of file