Robert9 Posted August 7, 2015 Posted August 7, 2015 (edited) I recently installed Autoit, and tried to make couple of macros. In some occasion I managed to make simple macros, but in this I couldn't find solution.I have newest version of Autoit, using Windows 10 x64.I tried to make macro to close the window/application "Tor browser"It activates the window if it is not active but doesn't close it:WinActivate("About Tor - Tor Browser")WinClose("About Tor - Tor Browser")It doesnt report an error, it executes the macro, but window is not closed.I also tried Winkill, and to record strokes alt+F4, alt+X... but no luckHelp will be appreciated. Edited August 7, 2015 by Robert9
Jfish Posted August 7, 2015 Posted August 7, 2015 It would be better if you could post your code. Otherwise, it is hard to say what is happening. WinClose should return either a 0 or 1. When you say you get no error are you getting a 1? That would mean success and no error. You can double check it this way:$result=WinClose("About Tor - Tor Browser") msgbox(0,"Result","This is the result: "&$result) Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt
Robert9 Posted August 7, 2015 Author Posted August 7, 2015 Thank you for reply.That is all code.I put above and I got:This is the result:1But the window is not closed.
Jfish Posted August 7, 2015 Posted August 7, 2015 I would try again but use WinKill. What is the result for that? I would hope it would be blank. It should only return a 1 if it worked. Also, have you confirmed you only have one instance of this window / app running? Check your task manager to confirm. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt
Robert9 Posted August 7, 2015 Author Posted August 7, 2015 Same result with WinKill. You can check if you install this program Tor Browser.It is only one instance.Is there a command to close a program by location on disk? like "C:\Tor Browser\Browser\firefox.exe"
Robert9 Posted August 7, 2015 Author Posted August 7, 2015 (edited) Update: now I compiled the script and run it as admin, it works.Dont know why it doesnt work as a script, but it works as .exe. But it is important it works. Edited August 7, 2015 by Robert9
Developers Jos Posted August 7, 2015 Developers Posted August 7, 2015 Just add #RequireAdmin at the top of your script to force the script to always run AsAdmin.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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