Jump to content

Losing Focus, Help Please....


 Share

Recommended Posts

I have written an AutoIT Script:

MsgBox,0,SendFax Utility:,Next a file selection dialog will be displayed. Select either the Text File, Word Document, or Excel Spreadsheet that you want to fax out.....

FileSelectFile, FaxFile, 1, Q:\\

MsgBox,0,FaxFile:,FaxFile:%FaxFile%

Exit

However, when I compile this script and run it in XP, by copying the ICON to the "Quick Lanuch" bar and running it from there it does not maintain focus. In other words, what happens when its lanuched and there is already a program like Word displayed, the AutoIt Icon is displayed in the System Tray, and the first dialog is not displayed at all. In order to see it you must click on it in the Start Bar, and then the first dialog is displayed. Then in order to see the File Selection Dialog you need to, double click the SysTray Icon Twice, then click on the AutoIT icon in the StartBar. And then the File Selection Dialog box comes to the foreground.

How do I get all of this to be in the foreground from the beginning?

B)

Please help....

:angry:

Thanks in advance for any and all help..... :whistle:

Link to comment
Share on other sites

OK, Thanks you solved half of my problem.

The other half is when the File Selection Dialog box is displayed it is not put in the foreground with fucus. It is placed in the background without focus and you need to shutdown windows until you find it and then click on it to give it focus.

I looked at the documentation for this option and a simular feature is not available for this command.

I know I could spawn off another AutoIt script looking for this dialog and the give it focus but this does not seam logical as I do not understand why it is not given focus to start with.

Thanks again for the help...... :whistle:

Link to comment
Share on other sites

Larry, Thanks again for the help.

With this direction I figured it out. There was a little problem with the example code and I sent my test AutoIt script in a endless loop which force me to shutdown and reboot my system. :whistle: So I figured I would post the fixed code with a little more explination for others.

As Larry orginally stated. This needs to be compiled in order to run.

; This line can be a little confusing if you do not know that %1% %2% %3% are

; command line parameters to AutoIt. Therefore, the following line is determining

; if you call this AutoIt script with a parameter specified. If you did then it will

; skip to the Main body of the code(Main).

IfEqual,0,1,Goto,Main

; If you did not start with a parameter it will run the script again with a parameter

; specified and then wait for the File Select window to appear, activate it, and then

; exit the original script call that you ran.

Run,%A_SCRIPTFULLPATH% Main

WinWait,Select File

WinActivate,Select File

Exit

Main:

FileSelectFile, FaxFile, 1, X:\\

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...