Import confirmation window

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Import confirmation window

Post by PhilHibbs »

When importing jobs, the confirmation dialog box that warns the user that a job is referenced by another component sometimes gets hidden behind other windows. There is no way to bring this window to the foreground, it is not in the Alt-Tab list and bringing the import progress window to the front does not bring this dialog with it. The only way is to minimize all the other windows that are in front of it, which is not always possible if there is an application that is busy or is waiting for its own modal dialog box.

I have written a short script in AutoIt that brings this dialog box to the foreground, or indicates that no such dialog box was found. It can be compiled to a standalone executable but I don't have anywhere to post the .exe to right now.

Code: Select all

const $WinTitle = "Confirm import of:"
If WinGetHandle($WinTitle) <> "" Then
	WinActivate($WinTitle)
Else
	MsgBox(0,"Rescue","Confirmation dialog box not found")
EndIf
Phil Hibbs | Capgemini
Technical Consultant
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Thanks, Phil

You can also minimize all windows or "show desktop". The window that doesn't have focus does not minimize.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

ray.wurlod wrote:You can also minimize all windows or "show desktop". The window that doesn't have focus does not minimize.
That's what I meant by "The only way is to minimize all the other windows that are in front of it, which is not always possible if there is an application that is busy or is waiting for its own modal dialog box."
Phil Hibbs | Capgemini
Technical Consultant
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I like AutoIt. Here is one for my script DsJobReportDriver.bat which runs DsJobReport.bat and documents all jobs in a project. They are bundled with the backup script. It hits enter every time the window pops up. Very nice.

Code: Select all

; -----------------------------------------------------------------
; Name: DsJobReportDriver.au3
; -----------------------------------------------------------------
; Description:
; AutoIt Script which runs DsJobReportDriver.bat.
; -----------------------------------------------------------------
; Created by: Kim Duke March 22, 2010
; -----------------------------------------------------------------
; Todo:
;    Be nice if it could take command line arguments for bat file.
; -----------------------------------------------------------------
; Required Components:
;     DsJobReportDriver.bat
; -----------------------------------------------------------------

const $WinTitle = "DataStage" 

Local $pid = Run("DsJobReportDriver.bat")

While ProcessExists($pid)
	WinWaitActive($WinTitle)
	If WinGetHandle($WinTitle) <> "" Then 
		WinActivate($WinTitle) 
		Send("{ENTER}")
		WinWaitClose($WinTitle)
	EndIf 
Wend
Mamu Kim
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

Here's my latest version of the Import Confirmation Window script:

Code: Select all

const $WinTitle = "Confirm import of:"

While True
	If WinGetHandle($WinTitle) <> "" Then
		WinActivate($WinTitle)
		SendKeepActive($WinTitle)
		Send("{Enter}")
	EndIf
	Sleep(1000)
WEnd
It now runs constantly in the background, and if it sees a confirmation dialog, it automatically confirms it just like kduke's one does, so I can now leave multiple imports running and not have to sit clicking those windows.
Phil Hibbs | Capgemini
Technical Consultant
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

LMAO. Very cool. Mine quits after the batch script quits.
Mamu Kim
Post Reply