Document being saved in the download folder instead of the specified folder

I am developing an automation that captures the information base and uses the ‘Browse’ function to open the Chrome.exe document download page. I have a function that performs a concatenation as follows:

tempFolderDocument = String.Format(“{0}{1}”,
System.IO.Path.GetTempPath(), CurrentRow(“Document name”)

However, when I use the ‘Type into’ function in the ‘Simulate’ option, the path is inserted (I cannot use Chrome IO, as Google opens the download page itself). Then, when I simulate clicking to save the document, it is saved in the ‘Downloads’ folder and not the temporary folder. If I simulate the ‘Backspace’ keyboard shortcut or use a hardware event in ‘Type into’, it works normally. Has anyone else had this problem?

@Kanael

Welcome to the community

if you hover while indicating over the type into field you would see two different selectors with slight variation..only one of it works for changing the path and all..so re indicate it properly

Also instead of simulate send window messages is a bette option on it

cheers

Thank you very much for the welcome, @Anil_G, and thank you for your quick response.

I already tried that, but it didn’t work. It’s as if something is forcing the download to the “Downloads” folder. I tested it manually, and when I download the document manually, it works normally.

However, when the robot is run via AnyDesk, it doesn’t work. On my local machine, it works, but the difference is that in the machine settings, I set the Temp folder as the default download folder. On the virtual machine, unfortunately, I can’t do the same, as there are several robots running different processes. So I’m trying to enter the path directly in the “File name” field, but without success.

In addition, when I use the SendWindowMessages option, the program writes letter by letter, and in this case I need the path to be entered all at once.

@Kanael

please try assigning the path to clipboard using set to clipboard and then use send hotkeys to paste the data

or if you are on latest new type into has option to set the value from clipoboard directly as well instead of typing

Alternately let it download any where just use wait for download which gives the output file and can then use it to move or rename

cheers

@Kanael,

Simulate don’t work here. Use Hardware Events input method for typing the file path.

Hi @Kanael ,

As @Anil_G mentioned.
Kindly try Method 1 :

  1. Set the full path to clipboard: Use the Set To Clipboard activity
    tempFolderDocument = String.Format(“{0}{1}”, System.IO.Path.GetTempPath(), CurrentRow(“Document name”).ToString)
  2. Send Hotkey activity with Ctrl + V to paste the path into the Chrome “Save As” dialog
  3. Click activity to press the Save button

If method 1 didnt work then try method 2 as suggested by @ashokkarale :

  1. Use set Type Into property Input Method = Hardware Events.
  2. Set DelayBetweenKeys = 0 to speed up typing.

Method 3:

  • Use Wait for Download activity to get the file path.
  • Then use Move File activity to relocate it to your temp folder.

please try all 3 methods and let us know your result.

All the best

Hi everyone,

Thank you all for your time and helpful suggestions!

After testing the three proposed methods, I found that a combination approach worked best in my scenario.

I used an AutoHotKey ‘Backspace’ to clear the file name field in the Chrome ‘Save as’ dialogue,
Then I used a Type Into activity with the Simulate option enabled to input the full path.

This combination allowed the dialogue to correctly recognise and save the file in the intended temporary folder.
This worked even under the limitations of the virtual machine, where I can’t change Chrome’s default download folder because it’s shared across multiple robots.

As a follow-up question:
Is there an argument or Chrome launch setting that I can use to open the download dialog directly in the %TEMP% path without changing the default configuration for all users?

Thanks again for your support!

Kanael

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.