Search by item specific

Hi,
is is somehow possible to do a search by item specific? Let’s say I have a folder containing 1500 listings, all of them with the same items’ specifics structure (6 different). I want to launch a search within that box looking for item specific “=” or “contains” a specific word. I cannot find a solution for this search… any help would be very glad!

Thank you
Federico

This currently can’t done via a search or a smart group but it might be possible to create a script that lists all listings containing a specific item specific. Would that be helpful?

Hi Kristian,
thanks for reaching also on Sunday! So I am not the only one in office during weekends :sweat_smile:

Well, it might be, but does the script select and move somewhere found listings, or just create a list outside GS and then I need to search listings one by one in order to do modify content of that item specific?

Here is a simple script that checks ALL listing for the given attribute name and value:

// This script checks all listings for the specified atribute name and value.
function run() {

var arr = [];

	for (const listing of allListings) {

			if (listing.attributes["Brand"]=="Apple") { // adjust atttribue name ("Brand") and value ("Apple") here
				arr.push(listing);
			}
		
		}

	showListings(arr, "Listings found:");
	
}

Paste it into GarageSale’s Script Editor, adjust it to meet your needs, and hit the run button. It will present you a clickable list of listings found.

Does something like this work for you?

1 Like

Hi Kristian,
it works, Super! I think it is looking into the entire database. It took a lot of time before opening the list window. Is it somehow possible to limit the search on selected folder?

Here you go:

// This script checks all selected listings for the specified atribute name and value.
function run() {

var arr = [];

	for (const listing of selectedListings) {

			if (listing.attributes["Brand"]=="Apple") { // adjust atttribue name ("Brand") and value ("Apple") here
				arr.push(listing);
			}
		
		}

	showListings(arr, "Listings found:");
	
}

@kristian super as always!!! I would like to have time and knowledge for studying this matter.

I have another question in my mind since some days and maybe such a tool might help me. Is it possible somehow to use a script to find and replace the last image of all selected listings? In particular, I need to cancel the last image of all listings into a folder (it is a fixed image with postage cost table, which recently increased and need to be replaced). Is it possible to do in bulk? I have more than 2000 listings that need to be fixed and doing it manually would mean tons of hours… at least, I would like to bulk delete the last image. Then I can copy and past the new image to all listings in a second from another template, but deleting last image needs to be done manually as far as I know…

Thanks again for your constant support!

This can’t be done with Javascript as far as I can tell but here is an Apple Script:

Remove last image of selected listings.zip (2.1 KB)

Unzip the file and open the script in “Script Editor”. Hit the Run/Play icon to execute the script. Be careful, there’s no undo function. You might want to test the script with one or two listings first.

Hi,
I just tried it, but it seems there is an error:

It says "“garagesale found an error: the handler of apple event didn’t work”.

Really odd. I tried it several times here and it always worked like a charm.
Do you actually have a listing selected in GarageSale? And does that listing contain images?

Tried again, both selecting listings in main screen or left side column… and happened again. Now I see this message:

error “GarageSale ha trovato un errore: Impossibile ottenere last item of every listing image of ebay listing id "E20BC58A-D9C7-4961-8765-0E0B40481493". Indice non valido.” number -1719 from last item of every listing image of ebay listing id “E20BC58A-D9C7-4961-8765-0E0B40481493”

Unfortunately, I am not very familiar with Apple Script so it’s unclear to me why you get that error and why it works for me.

What happens if you change (just for test purposes) last to first? So you get this line:

set imageToRemove to the first item of listing images of theListing

Does this script work then and remove the first image as intended? (Again just for test purposes)
You might want to test it with a duplicated listing only!

Yes, it works with first image! If I change to “last”, it still doesn’t work with only 1 selected listing.
If I press on hammer icon, it says: “Syntax error: Class name was expected but it was found “last”.”

Sorry, I am tapping in the dark. Are you using macOS 15 and GarageSale 9.9.2b2, too?

Does this slightly adjusted script work better for you maybe?:

tell application "GarageSale"
	set theListings to (get selected ebay listings)
	repeat with theListing in theListings
		set imageToRemove to the last item of (listing images of theListing)
		tell theListing
			remove listing image image imageToRemove
		end tell
	end repeat
end tell
1 Like

I am using macOS 15.1 (24B2082) and GS 9.9.1 (1710). Maybe there is something new in beta2?

and YES! It works!! Super Kristian, thank you very much indeed as always for your help.

EDIT 1: I just discovered it worked with one listings, but when I tried it again on other listings, it still gives me the same error. There must be something wrong in those specific listings. Can I export one and send you so you can check what’s wrong with that one? Another one just worked perfectly.

EDIT 2: I discovered that the original listing does not work, but if I double it, the copy can work with the script…

Sure, feel free to export, zip and send me one of the listing in question e.g. via WeTransfer: https://www.wetransfer.com/

Ok I will send right now one listing which is giving me this problem. If I double it, it works, the original one doesn’t. I will send a dropbox by private message now.

Thank you. I tried with your listing but for me the “remove last image” script still worked perfectly fine. Also, I didn’t find anything wrong with your listing or images. :thinking:

Mmhhh… I think it has to do somehow on those specific group of listings, maybe one or more have been done with an old GS version and the last image is somehow lost in the database. By duplicating, the last image is still available in the database and so the script work. Sorry if it makes no sense… just an idea…

Anyway, I think I will double the entire folder and forget the bug !