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:
- 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?
- 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?
- 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