Issue with automating Save As

Hi All

I want to save a file as it is coming with its default name. And i don’t know the file name as it keeps on changing its name. We have just automated to click on the download link.

So once we click on the download link a Save As window appears. So as we don’t know the file name what should we give in the file name field. We are using Type into activity to type the full path of the file.

@kkpatel,

You can download the file as it is and rename the files once the download completed.

Check this post to rename the downloaded file in a folder.

yah that would work
may i know the issue you were facing on this
Cheers @kkpatel

@sarathi125 @Palaniyappan

The issue is what string value should i provide in the Type Into ?

I DON’T KNOW THE INCOMING FILE NAME.

@kkpatel,

Path + “\” + NameofFile.xlsx

Where Path has Value such as : “D:\Sample”
NameofFile can be : AnyName eg. “InputData.xlsx” - To make this Name Dymanic Append Time to the FileName annd then append with .xlsx


Mukesh

usually if that gives us a filename be default, but saves in different folder then we can do one thing
–lets get the default filename alone from that field and then concatenate with the filepath we have
–steps involved will be like this
–once after the save as window opens click onthe filepath file which will be having the default value
–use send hot key activity with key as ctrl+a so that it will select the default filename
–then again send hot key activity with key as ctrl+c so that it will copy to clipboard
–now use a GET FROM CLIPBOARD activity and get the value stored in clipboard with a string variable named str_filename
–then use a type into activity and mention the filepath like this
“yourfolderpath\”+str_filename.ToString

or

if the save us window doesnt show us the default file name
then we can give our own file name with timestamp like this
“yourfolderpath\”+Now.ToString(“dd_MM_yyyy_hh_ss”)+“.xlsx”
here i have mentioned .xlsx you can change as per your filetype

Cheers @kkpatel

I can’t give the filename by my own. I just want the file to come the way its coming. I want the name to be the same as its default name.

In That case , What is the Name that you get when you manually save the File ?

If that name is constant - use that Name.

Thanks @Palaniyappan. I can try this.

1 Like