Mark all selected listings that have a specific attribute with a colored tag

This script marks all selected listings that have a specific attribute (e.g. “Type”=“LP”) with a colored tag.
Feel free to modify and improve it to fit your needs.

Disclaimer:

  • You might want to test this script with one single listing first.
  • There’s no undo function.

More about GarageSale’s javascript feature: Running Scripts

// Mark all selected listings that have a specific attribute (e.g. "Type"="LP") with a colored tag
function run() {
	for (const listing of selectedListings) {

		if (listing.attributes["Type"]=="LP") { // change the attribute name and value to what you are looking for
			listing.tag = 3; // 1 = red tag, 2 = orange, 3 = yellow, 4 = green, 5 = turquois, 6 = blue, 7 = purple, 8 = pink, 9 = grey, 0 = no tag
			
			consoleLog("Listing '" + listing.title + "' marked with a colored tag");
				
		} else {
			consoleLog("Listing '" + listing.title + "' does NOT have the searched attribute");
		}
		
	}
}