Javascript: Set Product Person based on Brand name

This script checks if a given brand (“Apple”) exists in the Item Specifics. If so, it selects the given product person (“Apple Inc.”) in the Product Safety settings.

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

// This script checks if the given brand exists in the Item Specifics. If so, it selects the given product person in the Product Safety settings.
function run() {
	for (listing of selectedListings) {
		
		let brand = "Apple"; // item specific "Brand"; replace "Apple" with the brand name of your choice
		let productPerson = "Apple Inc."; // replace "Apple Inc." with the product person of your choice; the person must have already been created in the Product Persons panel!
		
		if (listing.attributes["Brand"]==brand) {
			for (person of allProductPersons) {
				if (person.name==productPerson) {
	    			listing.manufacturer = person;
	    			consoleLog("Listing title: " + listing.title + "\nChanged product person to: " + person.name);
	    		}
	    	}
		} else {
			consoleLog("Brand '" + brand + "' not found")
		}
    }
 }

To use this script open GarageSale’s script editor, click the + button and paste the script. Select one or more listings in GarageSale’s main window, then click the “Run” button in script editor.