A bit of Help with AppleScript and GS

Hello There,
Firstly, thanks for this awesome software that is helping us a lot with our business !

I am doing the following many times a day and I would like to automatize it, if it’s possible:

  • Duplicate 50 times a pre-filled listing in GS,
  • and add a different picture for each listing that is in a folder on my mac (that contain the 60 pictures of my listings).
    I know It’s not very difficult but I don’t know a bit of AppleScript. Does someone know what code lines should I use ?
    Thanks and Merry Christmas ! :wink:

So you want to duplicate one specific template every time? And do you want to use exactly one picture from the folder for each new copy of that template?

If so, you could start by looping over the pictures in the folder, and for each of those making a fresh copy of the template? Is that the way it will work?

Thank you @Vaguery for your answer. Yes exactly, I want to copy a pre-filled listing in GS and assign it a picture each time different from a specific folder (for all my image in that folder).
I am thinking about something like that but I don’t know the correct syntax :

#Select files
tell application "Finder" to set myFiles to every file of (choose folder)

tell application "GarageSale"
repeat with aFile in myFiles
    #Select listing to duplicate
    set thelisting to first item of (get selected ebay listings)

    #Duplicate Listing
    tell thelisting
        set newListing to duplicate listing
    end tell

    #Set the image to aFile
    tell theListing
        set theImage to make listing image aFile
    end tell
end repeat

Any idea ? Merry Christmas. :santa:

Here is something I quickly hacked together.

Before running the script, I would selected the listing you want to duplicate as master listing in GarageSale’s preferences (eBay > Copy all settings from:). This way you don’t need to deal with copying the correct listing in AppleScript.

Also, instead of selecting folder, my script requires you to select multiple image files. Couldn’t get iterating over a folder to work in AppleScript.

The “choose file” command needs to be run within a “tell GarageSale” block, otherwise Sandbox restrictions will block GarageSale from accessing your file.

tell application "GarageSale"
	set myFiles to (choose file with prompt "Please select images folder" multiple selections allowed yes)
	repeat with myFile in myFiles
		set the theListing to make ebay listing
		tell theListing
			set theImage to make listing image file POSIX path of myFile
		end tell
	end repeat
end tell

Hope this helps

1 Like

Thank you very much Ilja ! It works like a charm. You’re awesome !

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.