Ama1899 Posted November 20, 2018 Share Posted November 20, 2018 Hi everyone, I was trying to automate an installer and was looking for a way to close a new browser tab as soon as the program opens it. The solution must work with any browser (or at least the most common ones). This got me stuck for a while, any idea? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 20, 2018 Moderators Share Posted November 20, 2018 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Earthshine Posted November 20, 2018 Share Posted November 20, 2018 What have you written so far? My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Ama1899 Posted November 20, 2018 Author Share Posted November 20, 2018 The code for the rest of the installer. Everything works fine except the closing windows part. Right now I am using: Sleep(5000) Send("{CTRLDOWN}w{CTRLUP}") however I was hoping for a much better solution, that worked without an arbitrary delay. Link to comment Share on other sites More sharing options...
Earthshine Posted November 20, 2018 Share Posted November 20, 2018 Alt-f4 should colse it My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Ama1899 Posted November 20, 2018 Author Share Posted November 20, 2018 The problem is not closing the tab... The problem is that I want it closed as soon as it opens, right now I make the script wait for 5 seconds, which could be enough or not... Link to comment Share on other sites More sharing options...
Earthshine Posted November 20, 2018 Share Posted November 20, 2018 What application are you automating? My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Ama1899 Posted November 20, 2018 Author Share Posted November 20, 2018 It's an Install Wizard, that, once the installation is completed, opens a URL on the default browser. The method of the arbitrary delay is working fine, however I would really prefer a method wich is instantaneous and reliable. Link to comment Share on other sites More sharing options...
Danp2 Posted November 20, 2018 Share Posted November 20, 2018 13 minutes ago, Ama1899 said: It's an Install Wizard We gathered that from your OP. What is its name? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
careca Posted November 20, 2018 Share Posted November 20, 2018 Ok, couple of things: The preferred solution would be to do the install silently, or with a config file that ignores that step, i've seen it before in some. Other option is to close the process for the browser as soon as it's up. If that's not good because you may have tabs open already, then you have to go find a way to get how many/which tabs are open, and loop that until there's another one, and close it. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Ama1899 Posted November 20, 2018 Author Share Posted November 20, 2018 12 minutes ago, Danp2 said: We gathered that from your OP. What is its name? I didn't mean to hide it form you, I just thought it was irrelevant. It's CCleaner. Link to comment Share on other sites More sharing options...
Ama1899 Posted November 20, 2018 Author Share Posted November 20, 2018 16 minutes ago, careca said: Ok, couple of things: The preferred solution would be to do the install silently, or with a config file that ignores that step, i've seen it before in some. Other option is to close the process for the browser as soon as it's up. If that's not good because you may have tabs open already, then you have to go find a way to get how many/which tabs are open, and loop that until there's another one, and close it. I'll try and find a way to close everything but the already open ones, thanks! Link to comment Share on other sites More sharing options...
Danp2 Posted November 20, 2018 Share Posted November 20, 2018 Seems like CCleaner supports a silent installation. Have you tried using the '/S' option? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Ama1899 Posted November 20, 2018 Author Share Posted November 20, 2018 6 minutes ago, Danp2 said: Seems like CCleaner supports a silent installation. Have you tried using the '/S' option? I'm shocked I haven't thought of this before... Anyway, it works fine! Thanks for help and for making my script useless! Danp2 1 Link to comment Share on other sites More sharing options...
Earthshine Posted November 20, 2018 Share Posted November 20, 2018 usually installers support silent installs My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Bert Posted November 20, 2018 Share Posted November 20, 2018 There is a much easier way to install it. Use the zip version of CCleaner. It is what I use. All you need to do is unzip it and your done. Skeletor 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
careca Posted November 20, 2018 Share Posted November 20, 2018 But maybe you skip things like the context menus, no? Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Skeletor Posted November 20, 2018 Share Posted November 20, 2018 1 hour ago, Bert said: There is a much easier way to install it. Use the zip version of CCleaner. It is what I use. All you need to do is unzip it and your done. I agree... and you can use AutoIt to run a command string like: Run(@ComSpec & " /c " & 'commandName', "", @SW_HIDE) to extract the contents from the zip file. Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI 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