So, you will have to use thrid party tools like AutoIT or Sikuli to automate your GUI.
Here is the sample of the code to handle save dialog for IE.
; set the select mode to select using substring
if $CmdLine < 2 then
; Arguments are not enough
msgbox(0,"Error","Supply all the Arguments, Dialog title,Save/Cancel and Path to save(optional)")
; wait until dialog box appears
WinWait($CmdLine) ; match the window with substring
$title = WinGetTitle($CmdLine) ; retrives whole window title
; if user choose to save file
If (StringCompare($CmdLine,"Save",0) = 0) Then
; If firefox is set the save the file on some specific location without asking user.
;Save the File
if ( StringCompare(WinGetTitle("[active]"),$title,0) = 0 ) Then
;if firefox is set to prompt user for save path.
if WinExists("Enter name") Then
$title = WinGetTitle("Enter name")
if($CmdLine = 2) Then
; If user hasn't provided path to save
;save to default path.
; If user has provided path
;Set path and save file
;Firefox is configured to save file at specific location
; do not save the file
If (StringCompare($CmdLine,"Cancel",0) = 0) Then
Hope that helps!