AppleScripting Help (Condition, Starting bid, etc.)

I am running an AppleScript on listings being imported from a CSV file (thanks for everyone’s help so far!), which I’ve pasted below. I still have a few things I’m trying to fix. Particularly:

  1. For the life of me I can’t get the Condition field to work. I’ve tried importing the text “Very Good” and assigning it to the Condition field (in which case I get a non-fatal error message when I try to start the listing, saying that Condition isn’t supported (for the “Books” category I’m using). I’ve also tried importing that Condition Code of 4000 (meaning “Very Good”) but that simply seems to get ignored. How can I upload or script the Condition field?
  2. Even though I’m importing “1000” into the Duration field (which appropriately sets it to “Good Till…”) I would like to remove the “Starting Bid” field and instead replace it with the “Buy It Now” price field. How do I do that in the AppleScript?
  3. Finally, since I’m creating the CSV file in Excel, it adds quotation markets around fields that contain delimited such as commas. Those quotation marks are then imported into GarageSale. How can I eliminate them (either before, during, or after the import process)?

Thanks for any help you can provide!

______________________________________________________________________________

set theCatChoices to {“Books”, “Media”, “Non Media”}

set theFavoriteCat to choose from list theCatChoices with prompt “Select Attribute List:” default items {“Books”}

if theFavoriteCat is false then

**return**

end if

tell application “System Events” to tell process “GarageSale” to set visible to false

tell application “GarageSale”

**repeat** **with** theListing **in** (**get** selected ebay listings)

	**tell** theListing

		**set** emptyString **to** ""

		**set** SpecList **to** *item specifics* **of** **the** theListing

		**if** SpecList ≠ emptyString **then**

			**set** SpecCount **to** **count** **of** SpecList

			**repeat** **with** i **from** 1 **to** SpecCount

				**try**

					**set** theSpecItem **to** specific name **of** *item* i **of** SpecList

					**set** theSpecific **to** **remove item specific** specific name theSpecItem

					**remove item specific** "Starting Bid"

				**end** **try**

			**end** **repeat**

		**end** **if**

	**end** **tell**

**end** **repeat**

end tell

tell application “GarageSale”

**repeat** **with** theListing **in** (**get** selected ebay listings)

	**tell** theListing

		**if** *item* 1 **of** theFavoriteCat **is** "Books" **then**

			**set** theSpecific **to** **add item specific** specific name "Author" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Publisher" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Place of Publication" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Year Printed" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Book Title" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "ISBN" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Language" values {"N/A"}

		**else** **if** *item* 1 **of** theFavoriteCat **is** "Non Media" **then**

			**set** theSpecific **to** **add item specific** specific name "Brand" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Color" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Height" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Lenth" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Material" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "MPN" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Size" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Style" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Type" values {"N/A"}

			**set** theSpecific **to** **add item specific** specific name "Width" values {"N/A"}

		**end** **if**

	**end** **tell**

**end** **repeat**

end tell

tell application “System Events” to tell process “GarageSale” to set visible to true

Is there any chance you can attach your Apple Script as a text/zip file?

Garage Sale Add Book Attributes.zip (7.2 KB)

To 1.:
I was able to import the condition value from CSV. This is how:
• Define a Category ID in your CSV. Use 261186 for the Books category (eBay USA). You find the category ID at the bottom of the category browser. In the CSV import panel link your CSV category ID to “Primary Category ID”.
• For the condition value always use the exact name in your CSV, e.g. Very Good

To 2.:
To remove the starting bid option make sure that the “Starting Bid” checkbox is disabled in the GarageSale preferences > eBay > New Listings before importing from CSV.
Another way is to add set use starting bid to false somewhere into your Apple Script.

To 3.:
I don’t have a solution for that, unfortunately. Maybe this can be done with Javascript after the import process.

Great, those first two worked, thanks!

One more question: is there any way to include a line feed (or new line) character in an imported text field? That is, if I have CHAR(10) in a text formula in Excel, which saves it to CSV as /lf, will GarageSale appropriately parse that as a line feed character within a single text field?

Don’t know about Excel but in the CSV itself you can simply add a soft line break (just a click of the Return key) to the item description. Once imported in GarageSale that line break will be visible.