I am writing a script to use winzip from powershell but I am having problems clicking the mouse inside the address bar of a dialog box.
I have solved the problem using the 7zip method but I want to learn another method.
(I have 2 screens hence the coordinates of the mouse). I tried making a new shell just for the dialog box but that doesn't work. What am I doing wrong?
UPDATE: When I put the Sleep 1 in front of the click, the computer makes a tone. Am I dealing with a focus issue?
Add-Type -AssemblyName System.Windows.Forms
$screen = [System.Windows.Forms.SystemInformation]::VirtualScreen
$screen | Get-Member -MemberType Property
$Width=$screen.Width
$height=$screen.Height
& "C:\Program Files (x86)\WinZip\WINZIP32.EXE"
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Winzip Pro')
Sleep 1
$wshell.SendKeys('% ')
$wshell.SendKeys('x')
$wshell.SendKeys('%')
$wshell.SendKeys('o')
$wshell.SendKeys('p')
[Windows.Forms.Cursor]::Position = "2600,40"
Sleep 1
$wshell.SendKeys( {ClickLeft})
#$Dialog = New-Object -ComObject wscript.shell;
#$Dialog.AppActivate('Zip')
#Sleep 1
#$Dialog.Sendkeys({ClickLeft})