How do I name it after making a save image in the loop?
The File Name box is where you’re supposed to put the filename. You need to provide the full path though. It looks like you’re trying to use a variable (country) for the filename, but you have the variable inside the double quotes.
It should be…
"\somepath\somefolder" + country + “.png”
Another way to do it so you don’t have to worry about the \s being correct:
Path.Combine(“\somepath\somefolder”,country + “.png”)
It’ll make sure the \s are correct.
we would suggest to use information of the current looped country and do the proper naming directly when save the image
lets assume: CurrentRow(“Column1”).toString is the country name
then the save Image could look like following (minimal approach):
CurrentRow("Column1").toString & ".png"
Kindly note: Instead of taking a screenshot we also can download the image
I want to save it in a folder named “Country”
then combine Paul’s and my suggestion e.g.
Path.Combine("C:\otherFoldersWhenNeeded", CurrentRow("Column1").toString & ".png")
Path.Combine("C:\otherFoldersWhenNeeded", CurrentRow("Column1").toString, "flag.png")
A folder named Country or a folder named by the country name that’s in a variable?
Not sure what you mean by “name of the flag” but anyway, you need to have your values in variables, row data, etc. to reference.
I also recommend having the main folder in a variable ie destinationFolder = Path.Combine(“C:\Users”,Environment.Username,“Documents\task3”)
Then you do an If with the condition: NOT Path.Exists(Path.Combine(destinationFolder,countryVar)
In the Then block, you create the folder since it doesn’t already exist. Leave the Else block empty, since you don’t need to create the folder if it already exists.
Then you just put this in your Save Image path:
Path.Combine(destinationFolder,countryVar,flagName + “.png”)