Jump to content

Newbie terminology question -- "calling" and outside au3?


Recommended Posts

Probably the biggest problem we newbies face is trying to find answers in the help file because most of the time we don't know what we're looking for is called.

In this case, I don't know AI's term for "call" when we need to call an outside au3 script from within one we're working on. What is AI's term for this pls? I looked at "call" in the help file but it's not the same thing. If someone can point me to the right term, then I'd be able to find examples here in the forum.

Thanks! :P

Link to comment
Share on other sites

Thanks for this. I give up, though. Everything I tried didn't work and I don't know why. The bottom line is that when I combined 2 scripts into one file, the second didn't work. So then I tried calling the second script from the first after getting the above #include command but nothing happens no matter how I type it up. Various trials and 1/2 hour later and nothing and the 2nd script isn't invoked. So maybe it's better to go back and try to get the 2 working scripts into one in such a way that it does its thing properly. But I obviously need help with that as simply tacking one to the end of the other hasn't worked at all so far.

So rather than keep banging my head against the wall, can some kind soul help out with this? How can one combine the 2 working scripts below so that they work once they are combined? You see, using the maximize command doesn't maximize the launched program whereas the script that maximizes all open windows does the trick when I've clicked on the file to run it, which is why I'm trying to combine it into the original simple first script below.

;
; AutoIt v3.0
;


Run('E:\APPS\APPSUN~1\BKP-SN~1\SNAZZY~1.EXE E:\APPS\APPSUN~1\BKP-SN~1\WORKBA~1.SBS')


Exit
; finishedoÝ÷ Ù«­¢+ØÀÌØíÙÈô]¥¹1¥ÍÐ ¤()½ÈÀÌØí¤ôÄѼÀÌØíÙÉlÁulÁt(ì=¹±ä¥ÍÁ±ä٥ͱݥ¹½ÝÌѡСÙѥѱ(%ÀÌØíÙÉlÀÌØí¥ulÁt±ÐìÐìÅÕ½ÐìÅÕ½Ðì9%ÍY¥Í¥± ÀÌØíÙÉlÀÌØí¥ulÅt¤Q¡¸(]¥¹MÑMÑÑ ÀÌØíÙÉlÀÌØí¥ulÁt°ÅÕ½ÐìÅÕ½Ðì°M]}5a%5%i¤(¹%)9áÐ()Õ¹%ÍY¥Í¥± ÀÌØí¡¹±¤(%    ¥Ñ¹ ]¥¹ÑMÑÑ ÀÌØí¡¹±¤°È¤Q¡¸(IÑÕɸÄ(±Í(IÑÕɸÀ(¹%()¹Õ¹

Thanks for everyone's patience! Appreciate it. :P

Link to comment
Share on other sites

There is little reason to use #include to combine scripts, you can learn about "includes" later. For now, let's work with one single script to do what you want.

Start with the Run line that you have.

Follow it up with a WinWait line.

Then a WinSetState line.

If the application that you are starting creates several windows, you can either deal with them one at a time (one WinWait and one WinSetState per window) or use the code from your "second script"... you just need to make sure that the script waits between the run line and the loop that maximizes all of the windows. You can use one WinWait line for this or a long enough Sleep(),

If you decide to deal with the windows one at a time, try and use unique window text. Copy the window text from the "AutoIt Window Info" tool. [start > Programs > AutoIt v3 > AutoIt Window Info]

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Command Bar

Favorites Command Bar

Navigation Bar

Page Control

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Hi, yes. I should have explained, I use that method all the time. I have about 20 scripts that use winwait and when the title bar is matched, the windows are maximized. It didn't work at all in this case, which was baffling. Why would it work in so many other scripts yet not here. I tried everything I could think of with no success last week.

However, today something occurred to me. This program has a small "splash screen" type of graphic that appears while it loads. Sort of like a large icon. It occurred to me to wonder if that was messing up the code somehow. I didn't see how it would, but tried a sleep command anyway. I inserted one between the launching and the winwait command and now the maximizing works. Go figure. With a sleep command of 3500, the window gets maximized. When I remove it, it doesn't. I suspect that if anything freezes the window for a length of time longer than that 3500, that it won't get maximized then either, perhaps. But that shouldn't be too much of a problem as 3 trials worked fine with this sleep command.

Strange behaviour, this. But now something else that will occur to me if a similar situation ever happens again where tried and true code like this doesn't work in a particular instance. I'll look to see if something like a splash screen is interfering.

Tx.

Link to comment
Share on other sites

Hi, yes. I should have explained, I use that method all the time. I have about 20 scripts that use winwait and when the title bar is matched, the windows are maximized. It didn't work at all in this case, which was baffling. Why would it work in so many other scripts yet not here...

...maybe because you do not have unique window text on your WinWait line for this script.

...However, today something occurred to me. This program has a small "splash screen" type of graphic that appears while it loads...

More than likely, this "splash screen" has a window title (even if you cannot see it). That window title might be a perfect match to your WinWait line... so, your script no longer waits. It sends the WinSetState to the "splash screen" - which has no effect.

Try to find a combination of window title and unique window text.

Not to insult, but the window text can come from this part of the "info tool"

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Command Bar

Favorites Command Bar

Navigation Bar

Page Control

You keep mentioning window title matches... and I keep pointing you to unique window text matching :-)

WinWait("window title", "unique window text")

...let me know...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • 2 weeks later...

...maybe because you do not have unique window text on your WinWait line for this script.

I choose not to anymore. I found that different Windows environments screwed up the scripts when they were too precise. I use the state that allows for partial windows titles because that covered the most situations best. That's what I meant above though I seemed to not have explained it well <g>.

More than likely, this "splash screen" has a window title (even if you cannot see it). That window title might be a perfect match to your WinWait line... so, your script no longer waits. It sends the WinSetState to the "splash screen" - which has no effect.

p.s., the scripts seems to be working fine now with the sleep code so that covers it for this scripts, at any rate. I'll keep all the info in this post in mind, however. btw, I checked with the windows tool to see the windows title, just out of curiousity, but there was nothing in the place where windows titles usu. are. However, you mentioned that the info could be in those other places in the msg above, so will check again at some point to see if this little splash screen "icon" has a windows title elsewhere other than in the usu. line in the tool.

Thanks for everyone's help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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