Skip to content

Instantly share code, notes, and snippets.

@monish-khatri
Created September 15, 2023 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monish-khatri/548756656674f14271ecc819b27b6055 to your computer and use it in GitHub Desktop.
Save monish-khatri/548756656674f14271ecc819b27b6055 to your computer and use it in GitHub Desktop.
let dbNames = 'database_1,database_2';
const dbNamesArray = dbNames.split(",");
// Using Set to remove duplicates and converting back to an array
const uniqueDbNamesArray = [...new Set(dbNamesArray)];
uniqueDbNamesArray.forEach(function(dbName) {
var label = $('label:contains("' + dbName.trim() + ' #")');
var labelFor = label.attr('for');
var inputElement = $('input[value="' + labelFor + '"]');
if (inputElement.length > 0) {
inputElement.click()
}
});
setTimeout(function(){
if(confirm('Want to Generate Command?')) {
javascript:showScriptCommand();
}
}, 3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment