skippynz Posted March 1, 2005 Share Posted March 1, 2005 expandcollapse popup#include <GUIConstants.au3> #include <File.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainwindow = GUICreate("Wireless Profile Configuration", 360, 120) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Please choose the Office that you would like the Wireless Profile setting up for.", 10, 10, 350, 40) $AKLbutton = GUICtrlCreateButton("AKL", 10, 50, 60) $CHCbutton = GUICtrlCreateButton("CHC", 80, 50, 60) $DUDbutton = GUICtrlCreateButton("DUD", 150, 50, 60) $HLZbutton = GUICtrlCreateButton("HLZ", 220, 50, 60) $WLGbutton = GUICtrlCreateButton("WLG", 290, 50, 60) $EXITbutton = GUICtrlCreateButton("EXIT", 150, 85, 60) GUICtrlSetOnEvent($AKLbutton, "AKLButton") GUICtrlSetOnEvent($CHCbutton, "CHCButton") GUICtrlSetOnEvent($DUDbutton, "DUDButton") GUICtrlSetOnEvent($HLZbutton, "HLZButton") GUICtrlSetOnEvent($WLGbutton, "WLGButton") GUICtrlSetOnEvent($EXITbutton, "EXITButton") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func AKLButton() GUISetState (@SW_HIDE) Global $SHORTNAME = 'AKL' Global $SSID = 'AKLTest' If FileExists("C:\wless" & $SHORTNAME & ".txt") Then exit Else call ("Setup") _FileCreate ( "C:\wless" & $SHORTNAME & ".txt" ) GUISetState (@SW_SHOW) EndIf EndFunc I have this script to check for a file. - ie c:\wlessAKL.txt - how do i make it return to the start of the script instead of closing the entire script ???? Link to comment Share on other sites More sharing options...
MHz Posted March 1, 2005 Share Posted March 1, 2005 Taking out the exit line may help? but looks like your gui will be hidden, if the file does exist? Link to comment Share on other sites More sharing options...
skippynz Posted March 1, 2005 Author Share Posted March 1, 2005 (edited) Func AKLButton() GUISetState (@SW_HIDE) Global $SHORTNAME = 'AKL' Global $SSID = 'AKLTest' If FileExists("C:\wless" & $SHORTNAME & ".txt") Then GUISetState (@SW_SHOW) ???? Else call ("Setup") _FileCreate ( "C:\wless" & $SHORTNAME & ".txt" ) GUISetState (@SW_SHOW) EndIf EndFunc ok so this will show the gui again, but how does the script return to the main gui ? eg what do i stick in place of the ???? Edited March 1, 2005 by craig.gill Link to comment Share on other sites More sharing options...
MHz Posted March 1, 2005 Share Posted March 1, 2005 You call the function. When the function is complete, the script will continue on from where you called your function initially. You can place whatever code you wish, inplace of ????. All depends what your intentions are with the operation of the script. I only know that you are checking for a file. Link to comment Share on other sites More sharing options...
skippynz Posted March 1, 2005 Author Share Posted March 1, 2005 (edited) OK what im doing is setting up a script that will install a wireless profile for the user - the options that the user selects in the gui will then pass different params for the different names and SSIDs etc for that office - then from there it then checks if a file exists - which is c:\wless???.txt where ??? is the office location - if its not there the script continues on its merry way to setup a Wireless Profile.... when the setup of the profile is complete the function returns to the start - ie the main gui - that part is all cool and works ok so what i want to do is make is so when the file already exists for this location it returns saying its been run and cannot be run again then the script will return the user to the Main Gui so they can either select another office or they can exit out of the script. I hope this covers what i want to do, but if not post me back a reply - if it cant be done i can handle that and i will just send the user a message that they need to rerun the file again from sms but just trying to simplify the process for DFU's so they can setup wireless profiles for different offices in the one script. otherwise i would need to roll out 5 scripts all the same but with different params for the different offices. thanks for your help in advance....... Craig Edited March 1, 2005 by craig.gill Link to comment Share on other sites More sharing options...
MHz Posted March 1, 2005 Share Posted March 1, 2005 so what i want to do is make is so when the file already exists for this location it returns saying its been run and cannot be run again then the script will return the user to the Main Gui so they can either select another office or they can exit out of the script.You just want notice of the file existance. You can just replace the ????, with a messagebox. This will notify you, and choose to press another button, if required from the result.A messagebox:MsgBox(0, "Notice", "Procedure has already been executed") Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now