Sign in to follow this  
Followers 0
rshultz

Runwait Not Working...

3 posts in this topic

I have a script that I would like to run Firefox from cd so it copies Firefox to the temp directory much like Firefox Portable. The problem is that I have it do a RunWait to open Firefox and it continues to execute, I want it to clean up the temp files when Firefox is closed thus the reason for using the RunWait. Below is my script. Any ideas would be appreciated. Thanks.

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.1.0

; Author: Ryan Shultz <xxxxxxxxxx>

;

; Script Function: Firefox Portable Browser with AgTerror Content

;

;

; ----------------------------------------------------------------------------

; -----------------

; Build SplashImage

; -----------------

$copyright = Chr("169")

$destination = @TempDir & "\etc_logo.bmp"

FileInstall("etc_logo.jpg", $destination) ;source must be literal string

SplashImageOn($copyright & "2006 - Environmental Training Center", $destination, 350, 150, -1, -1, 3)

Sleep(2000)

; -------------------

; Collect Information

; -------------------

$maintemp = @TempDir

$ffoxtemp = @TempDir & "\Firefox"

DirRemove($ffoxtemp, 1) ; PreRun File Cleanup

DirCopy("Firefox", $ffoxtemp, 1)

$etccontent = """" & @ScriptDir & """\Content\index.htm"""

; ----------------

; Run Applications

; ----------------

RunWait($ffoxtemp & "\firefox.exe -profile " & $ffoxtemp & "\profile\foxoafvu.default " & $etccontent, "", @SW_MAXIMIZE)

; ------------

; Splash Stuff

; ------------

SplashOff()

SplashTextOn("AgTerror", "Cleaning up temporary files...", 250, 20, -1, -1, "", -1)

; --------------

; Delete Firefox

; --------------

Sleep(1000)

DirRemove($ffoxtemp, 1)

FileDelete($destination)

SplashOff()

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe do:

Do
    Sleep(10)
Until FileExists($destination); Or Until FileExists($ffoxtemp) ... I don't know what is what.

; ----------------
; Run Applications
; ----------------

RunWait($ffoxtemp & "\firefox.exe -profile " & $ffoxtemp & "\profile\foxoafvu.default " & $etccontent, "", @SW_MAXIMIZE)
?

If I'm understanding you right that may work.

Also... You may want to use code tags for you scripts.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Unfortunately that did not work. It is not a matter of the file not existing yet as it has copied prior to the actual run of the application. The problem comes that the actual script does not see that the application is still running even though it is. It should run Firefox then continue waiting until Firefox closes.

Share this post


Link to post
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
Sign in to follow this  
Followers 0