Jump to content

Recommended Posts

Posted

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?

  • Moderators
Posted

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

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.

Posted

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...

Posted

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.

Posted

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

Posted
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.

Posted
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!

Posted
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!

Posted

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

Posted
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 Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...