golfinhu Posted April 1, 2010 Share Posted April 1, 2010 this is a part of my script: expandcollapse popupOpt("TrayMenuMode", 1) $exit = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = $exit ExitLoop Case Else TrayTip("Running", "O " & $title & " está em execução", 3) $logfile = OpenOrCreateLog(@ScriptDir & "\log xml.txt") DownloadFile($download_link, $file_name, $logfile) Verificar_Arquivo($file_name, $logfile) Space_tag($file_name, $logfile) Subst_ponto($file_name, $logfile) Arrumar_Pontuacao($file_name, $logfile) interrogacao($file_name, $logfile) break_line($file_name, $logfile) open_tag($file_name, $logfile) Convert($file_name, $logfile) Tidy($file_name, $logfile) $FTPsession = FTPSessionOpen('MyFTP Control', $logfile) $FTPconnect = FTPSessionConnect($FTPsession, $server, $username, $password, $logfile) If Not FTPSetRemoteDir($FTPconnect, '\httpdocs\jovial', $logfile) And FTPSessionClose($FTPsession, $logfile) Then Exit FTPSendFile($file_name, '\httpdocs\jovial\xml.xml', $FTPconnect, $logfile) FTPSessionClose($FTPsession, $logfile) FileDelete($file_name) If Not @error Then _FileWriteLog($logfile, "XML deletado - OK") _FileWriteLog($logfile, "----------------------------------------" & @CRLF & "Tudo Ok!") FileClose($logfile) TrayTip($title, "Finalizado!", 3) Sleep(1000) ExitLoop EndSelect WEnd people, can you help me? what's wrong with this script? because when I click "Exit" the program continues running it just stops running when he finished completing all the tasks! How can I when you click "Exit" to stop him running the same program? thanks Link to comment Share on other sites More sharing options...
JohnOne Posted April 1, 2010 Share Posted April 1, 2010 I've had similar issues, I think its just busy running the code and dosent register the exit until its finished. I find that setting a hotkey for exit function works more quickly. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
KaFu Posted April 1, 2010 Share Posted April 1, 2010 Yup, would think the same. Try TrayOnEventMode.... Opt("TrayMenuMode", 1) Opt("TrayOnEventMode",1) $exit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"ExitEvent") TraySetState() While 1 sleep(5000) WEnd Func ExitEvent() Exit EndFunc OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
golfinhu Posted April 1, 2010 Author Share Posted April 1, 2010 (edited) thanks, but...it's dont work =/but thanks for your helpI've had similar issues, I think its just busy running the code and dosent register the exit until its finished.I find that setting a hotkey for exit function works more quickly.HotkeySet? Edited April 1, 2010 by golfinhu Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 1, 2010 Share Posted April 1, 2010 (edited) HotKeySet("^!{ESC}", "Quit") ;Ctrl+Alt+Esc Func Quit() Exit EndFunc ;==>Quit Edited April 1, 2010 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. 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