Sign in to follow this  
Followers 0
matrix121

Newbie Really Needs Help.....

14 posts in this topic

#1 ·  Posted (edited)

I'm very new to scripting and have looked extensively and can't seem to figure out this problem......

Everything in this script is fine except the blue text... It runs but I want it to check to see if the Limited Output box is checked then uncheck it and if it is unchecked click close because if not it'll just keep checking and unchecking the box which I don't want...

I'm using Windows XP

Any help would be greatly appreciated....

;-----Configuration-----

Opt("TrayIconHide", 1)

;The title of the sound config window.

Dim $ConfigWindowTitle = "Sounds"

Dim $ConfigWindowTitle2 = "Advanced"

Dim $ConfigWindowTitle3 = "Master"

Global $hGUI

;-----End of configuration----

Run("control mmsys.cpl") ;Run the sound control applet and hide it.

Opt("WinWaitDelay", 500)

WinWaitActive($ConfigWindowTitle)

ControlClick($ConfigWindowTitle, "Ad&vanced...", "Button4", "Sounds")

WinWaitActive($ConfigWindowTitle3)

ControlClick($ConfigWindowTitle3, "&Advanced", "Button3", "Sounds")

WinWaitActive($ConfigWindowTitle2)

ControlClick($ConfigWindowTitle2, "&1 Limited Output", "Button3", "Advanced")

If ControlCommand($ConfigWindowTitle2, "", "Button3", "IsChecked", "") = 1 Then

ControlClick($ConfigWindowTitle2,"Close","button3","left",1)

ElseIf ControlCommand($ConfigWindowTitle2, "", "Button3", "IsChecked", "") = 0 Then

ControlClick($ConfigWindowTitle2,"Close","button5","left",1)

Endif

WinClose($ConfigWindowTitle2)

WinClose($ConfigWindowTitle3)

WinClose($ConfigWindowTitle)

;Maximum System Sound Volume

;send("{VOLUME_UP 30}")

;SoundSetWaveVolume(100)

Edited by matrix121

Share this post


Link to post
Share on other sites



You could do something like

ControlClick($ConfigWindowTitle2, "&1 Limited Output", "Button3", "Advanced")
If ControlCommand($ConfigWindowTitle2, "&1 Limited Output", "Button3", "IsChecked") then
ControlClick($ConfigWindowTitle2, "&1 Limited Output", "Button3", "left",1)
Else
Winclose($ConfigWindowTitle2)

Share this post


Link to post
Share on other sites

Why did you open a second thread with the EXACT same problem instead of dealing with the one you have already?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I couldn't find it again.and I don't know how to deleted posts.... Anyway I've tried a few things over the weekend to no avail... I still can't get the "limited output" to uncheck with any command, such as: Controlfocus or ControlClick or {TAB}{TAB}{TAB}{SPACE} or this latest code... The other code was written on a very early version of AutoIt but has been corrected with the newest version...

;-----Configuration-----

Opt("TrayIconHide", 1)

Opt("WinWaitDelay", 500)

;-----End of configuration----

;Maximum System Sound Volume

send("{VOLUME_UP 30}")

SoundSetWaveVolume(100)

Run("control mmsys.cpl") ;Run the sound control applet and hide it.

WinWaitActive("Sounds")

ControlClick("Sounds", "Ad&vanced...", "Button4", "left",1)

WinWaitActive("Master")

If ControlCommand("Master", "Advanced", "", "IsVisible") then

ControlClick("Master", "&Advanced", "Button3", "left",1)

Else

Winclose("Master")

WinClose("Sounds")

Endif

WinWaitActive("Advanced")

If ControlCommand("Advanced", "&1 Limited Output", "Button3", "IsChecked") then

WinWait ("Advanced", "&1 Limited Output" )

Winactivate ( "Advanced", "&1 Limited Output" )

WinWaitActive ( "Advanced", "&1 Limited Output" )

While ControlCommand("Advanced", "&1 Limited Output", "Button3", "IsChecked") = 1

Sleep(50)

WEnd

ControlFocus ( "Advanced", "&1 Limited Output", "Button3" )

ControlClick ( "Advanced", "&1 Limited Output", "Button3", "left",1)

Else

Winclose("Advanced")

Endif

WinClose("Master")

WinClose("Sounds")

Edited by matrix121

Share this post


Link to post
Share on other sites

You could also try ControlClick ( "Advanced", "&1 Limited Output", "[CLASSNN:Button3]", "left",1)

Share this post


Link to post
Share on other sites

Thanks but it doesn't work.. I tried that too.. forgot because I've tried so many things...

Share this post


Link to post
Share on other sites

I've even tried the simple:

If ControlCommand("Advanced", "&1 Limited Output", "Button3", "IsChecked") then

send("SPACE")

Else

Winclose("Advanced")

Endif

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I've used the Send("!1") before in another script and it's worked without the If statment but I need the if statement because it will just keep checking and unckecking the box each time it's run

If ControlCommand("Advanced", "&1 Limited Output", "Button3", "IsChecked") then

WinWaitActive("Advanced")

Send("!1")

Else

Winclose("Advanced")

Endif

Edited by matrix121

Share this post


Link to post
Share on other sites

All I need to dod when the "Advanced" window is open is Alt 1 to uncheck it but it's not working either... it almost seems to be skipping the command

Here is the summary of the "& Limited Output" Button...

>>>> Window <<<<

Title: Advanced Controls for Master Volume

Class: #32770

Position: 267, 129

Size: 389, 376

Style: 0x94C800C4

ExStyle: 0x00010101

Handle: 0x008D090E

>>>> Control <<<<

Class: Button

Instance: 3

ClassnameNN: Button3

Name:

Advanced (Class): [CLASS:Button; INSTANCE:3]

ID: 1031

Text: &1 Limited Output

Position: 26, 258

Size: 330, 23

ControlClick Coords: 62, 11

Style: 0x50010003

ExStyle: 0x00000004

Handle: 0x007008A0

>>>> Mouse <<<<

Position: 358, 427

Cursor ID: 0

Color: 0xECE9D8

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

These settings can be used to make fine adjustments to your audio.

Tone Controls

These settings control how the tone of your audio sounds.

&Bass:

Low

High

&Treble:

Low

High

Other Controls

These settings make other changes to how your audio sounds. See your hardware documentation for details.

&1 Limited Output

Close

>>>> Hidden Text <<<<

&2

Share this post


Link to post
Share on other sites

I see whats wrong..Its the controlID you have wrong.

Try replacing this:

If ControlCommand("Advanced", "&1 Limited Output", "Button3", "IsChecked") then

With this:

If ControlCommand("Advanced", "&1 Limited Output", 1031, "IsChecked") then

Share this post


Link to post
Share on other sites

I just tried that actually... here is what I have

If ControlCommand("Advanced", "&1 Limited Output", 1031, "IsChecked") then

WinActive("Advanced")

ControlClick("Advanced","&1 Limited Output","button3","left",1)

Else

Winclose("Advanced")

Endif

Share this post


Link to post
Share on other sites

I just tried that actually... here is what I have

If ControlCommand("Advanced", "&1 Limited Output", 1031, "IsChecked") then

WinActive("Advanced")

ControlClick("Advanced","&1 Limited Output","button3","left",1)

Else

Winclose("Advanced")

Endif

ControlClick("Advanced","&1 Limited Output","button3","left",1) Needs to be ControlClick("Advanced","&1 Limited Output",1031","left",1) as well

Share this post


Link to post
Share on other sites

No go with changes....

If ControlCommand("Advanced", "&1 Limited Output", 1031, "IsChecked") then

WinActive("Advanced")

ControlClick("Advanced","&1 Limited Output",1031,"left",1)

Else

Winclose("Advanced")

Endif

Share this post


Link to post
Share on other sites

Figrured it out.... I had to get rid of the "&1 Limited Output" from the command....

If ControlCommand("Advanced", "", 1031, "IsChecked") then

send("!1")

Else

Winclose("Advanced")

Endif

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0