So I finally was able to get a working solution for this. I wanted to post it here so others can refer to it if they come across the same issue. Please note that I am doing my testing in a java framework so I am using the autoit jna wrapper that is defined here. The code could be easily transferred to autoit's native lang, but hopefully you will get the idea. This code is assuming IE9 & Win7 environment. Autoitx autoitx = getInstance();
//get a handle to the main window
byte[] retWin = new byte[9];
autoitx.AU3_WinGetHandle("[Class:IEFrame]", "", retWin, 9);
String winHandle = new String(retWin, 0, 8);
String winTitle = "[HANDLE:" + winHandle + "]";
//get a handle to the control (IE9 download info bar)
byte[] ctrlWin = new byte[9];
autoitx.AU3_ControlGetHandle(winTitle, "", "[Class:DirectUIHWND]", ctrlWin, 9);
String ctrlHandle = new String(ctrlWin, 0, 8);
String ctrlTitle = "[HANDLE:" + ctrlHandle + "]";
//must have this line in here in order to get a handle to the control
autoitx.AU3_WinWaitActive(ctrlTitle, "[CLASS:DirectUIHWND]", 10);
// Get the x, y coordinates of the control
x = autoitx.AU3_ControlGetPosWidth(winTitle, "", "[Class:DirectUIHWND]") - 135; //will differ depending on size of control
y = autoitx.AU3_ControlGetPosHeight(winTitle, "", "[Class:DirectUIHWND]") - 25; //will differ depending on size of control
// Save Prompt
autoitx.AU3_ControlFocus(winTitle, "Do you want to open or save", "[CLASS:DirectUIHWND]");
autoitx.AU3_WinActivate(winTitle, "Do you want to open or save");
autoitx.AU3_ControlFocus(winTitle, "Do you want to open or save", "[CLASS:DirectUIHWND]");
autoitx.AU3_ControlClick(winTitle, "", "[Class:DirectUIHWND]", "primary", 1, x, y); //activates the save button
autoitx.AU3_ControlSend(winTitle, "", "[Class:DirectUIHWND]", "{Down}", 0); //down arrow
autoitx.AU3_ControlSend(winTitle, "", "[Class:DirectUIHWND]", "a", 0); //select "save as"
// Save as dialog
autoitx.AU3_WinActivate("Save As", "Save");
autoitx.AU3_WinWaitActive("Save As", "Save", 10);
autoitx.AU3_ControlSetText("Save As", "", "Edit1", filepath);
autoitx.AU3_ControlClick("Save As", "", "&Save", "left", 1, 5, 5);
autoitx.AU3_ControlClick("Confirm Save As", "", "&Yes", "left", 1, 0, 0);
// Close the info bar
autoitx.AU3_WinActivate(winTitle, "");
x = autoitx.AU3_ControlGetPosWidth(winTitle, "", "[Class:DirectUIHWND]") - 15;
y = autoitx.AU3_ControlGetPosHeight(winTitle, "", "[Class:DirectUIHWND]") - 23;
autoitx.AU3_WinActivate(ctrlTitle, "");
autoitx.AU3_ControlClick(winTitle, "", "[Class:DirectUIHWND]", "", 1, x, y);
success = autoitx.AU3_ControlSend(winTitle, "", "[Class:DirectUIHWND]", "{Enter}", 0);