Hey everyone… so, ive been in contact with ebay, and the recommend adjusting my titles ( 2000+ ) different items…
With my old software, i used to be able to rewrite the title using the placeholders - i know you can do this on GS in the description… ( e.g - [[foreach attr item.previewSpecifics attLoop]][[if attr.name==“Size”]][[attr.value]][[endif]][[endforeach attLoop]] ) can this been done in the title at all??
There is no way yet to use placeholders in the title field but maybe you can adjust the existing “Change listing title attributes” Apple Script to fit your needs? (Select “Show AppleScript Examples” from GarageSale 's Help menu.)
Just had a thought. please see attached… the custom title works perfectly for the description… would htere be anyway of telling GS to use that as the main title?
Based on the manual, it definitely seems like you can read/write attribute values you’re looking for using JavaScript, concatenate that into a new string, and write the result to the title.
Hiya!!! yeah funnily enough i was looking at this page when you sent the message…
It would be ideal to run a script in GS itself, as i would like the specifics slightly different depending on the type…
Im trying to figure out java on google… as by the look of that doc, i could use the " read/write The attributes (item specifics). " to the " read/write The listing’s title. "
so hopefully something simple like - {brand} in {size} {colour} {style}
Dont suppose you have any pointers at all do you?as that would be an ideal fix for me to get on with…
i have this to write the descriptions where i can rewrite selected items description…
function run() {
consoleLog("selectedListings: " + selectedListings.length);
for (const listing of selectedListings) {
// consoleLog(listing.itemDescription);
listing.itemDescription = “test”;
// consoleLog(listing.itemDescription);
}
}
No the string substitution is a special syntax for the GarageSale Template language (a whole other language from AppleScript and JavaScript). You can only use the square brackets in GS templates.
Here is a little JavaScript that prints the brand, if there is one, to the console, or “NO BRAND” if there isn’t one set. The template language you are using is doing a lot of extra BS to check whether there is a Brand attribute at all. Don’t do that.
function run(){
var thisBrand = "";
for (const listing of selectedListings) {
thisBrand = listing.attributes["Brand"];
if (!thisBrand) {
consoleLog("NO BRAND");
} else {
consoleLog(thisBrand);
}
}
}
(This is not very well-factored JS; I just threw it together to show you how to get the attributes in JS.)
@pkjack contacted me through the support with some request regarding adding certain attributes to the title so I tried to create one based on @Vaguery script. It might be helpful for others, too, that’s why I am posting it here. Feel free to modify and improve it to fit your needs.
function run() {
var thisBrand = "";
var thisSize = "";
var thisColour = "";
var thisPattern = "";
var thisFeatures = "";
var thisType = "";
for (const listing of selectedListings) {
if (!listing.attributes["Brand"]) {
consoleLog("NO BRAND");
} else {
thisBrand = listing.attributes["Brand"] + " ";
}
if (!listing.attributes["Size"]) {
consoleLog("NO SIZE");
} else {
thisSize = "Size" + " " + listing.attributes["Size"] + " ";
}
if (!listing.attributes["Colour"]) {
consoleLog("NO COLOUR");
} else {
thisColour = listing.attributes["Colour"] + " ";
}
if (!listing.attributes["Pattern"]) {
consoleLog("NO PATTERN");
} else {
thisPattern = listing.attributes["Pattern"] + " ";
}
if (!listing.attributes["Features"]) {
consoleLog("NO FEATURES");
} else {
thisFeatures = listing.attributes["Features"] + " ";
}
if (!listing.attributes["Type"]) {
consoleLog("NO TYPE");
} else {
thisType = listing.attributes["Type"] + " ";
}
listing.title = "Text" + " " + thisBrand + thisSize + thisColour + thisPattern + thisFeatures + thisType + "Text";
}
}
The problem i had was if a attribute was missing it would read as undefined - this is where @Vaguery 2nd solution come into play with removing anything that was blank… but i could quite figure out how to implement into each other…