I know what I want to do but I can't figure out where to start I'm afraid.
- do I need python?
- or can Excel or Google Sheets do this with a script?
In a Google sheet which stores data on 100 products in our forthcoming e-commerce store, I have 100 images, each with a unique URL in Col A.
Each product has an image pointing to our Google docs, eg
<a href="https://drive.google.com/open?id=XXX
>...`I want to rename those images with the product code of each image, in Col B, for example, VFBARCL-70.jpg, and save in a new folder in Google docs, so we can upload the images via our CSV file to the WooCommerce store.
As a separate question, how can Excel open an image in Excel, from its URL?
Please, can someone help?
I've looked at download list of images from urls but this doesn't help, and I found this code:
function convertToImage() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var range = sheet.getDataRange();
var colnum = 3; // assuming column C; change to another column number
var cell;
var values = range.getValues();
for (var i=0; i<values.length; i++) {
if (values[i][colnum-1]) {
cell = range.getCell(i+1, colnum);
cell.setFormula('=image("'+values[i][colnum-1]+'")')
}
}
}
Which at least opens the URLs as images in Google, but I don't know how to (i) run the script, and (ii) modify it to rename and resave the images into a different folder.