I’d like to modify the script so that it takes text from one item specific (A) and writes it in capital letters into the title, also if text into the field t is not capital. Now I am writing directly in capital letters into field A, but I am sure there must be some trick to let GS writing title changing a specific text in capital letters. Is it possible to do?
Untested, slightly improved, version of Christian’s script:
function run() {
for (const listing of selectedListings) {
// enter preceding text optionally:
var precedingText = "";
// enter attribute names in the order you want them, e.g.:
// var attributeList = ["Brand", "Model", "Color", "Size"];
var attributeList = ["", "", "", "", "", "", "", "", ""];
// leave everything below untouched:
var finalTitle = "";
for (const attributeName of attributeList) {
if (listing.attributes[attributeName] && listing.attributes[attributeName] != "") {
finalTitle = finalTitle.concat(listing.attributes[attributeName], " ");
}
}
listing.title = (precedingText + finalTitle).toUpperCase();
}
}