It is currently May 3rd, 2024, 8:50 am

Help with AutoIt?, Laptop Brightness Control (SOLVED)

Get help with creating, editing & fixing problems with skins
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Help with AutoIt?, Laptop Brightness Control (SOLVED)

Post by UnforgivenRevival »

Is there a plugin or bang that can brighten or dim the laptop screen brightness like the "Fn+F6/F7"(on my laptop) keys? Is it possible to set a bang to keystrokes? For example: set it so it presses (Fn + F6) for me? Or am I dreaming too much :D
Last edited by UnforgivenRevival on June 18th, 2012, 12:32 am, edited 2 times in total.
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Laptop Brightness Control

Post by UnforgivenRevival »

Okay Ive done some research on this and it seems to be possible through autoit and nircmd.exe... I managed to get it to work through that but I cannot figure out how to make the window appear minimized instead of popping up the "cmd prompt" window on my desktop when I activate it. Feel free to move this posting, But can someone please help? VERY new to this coding language.


It also seems that the typing section takes a long time (about 1 second) before the command is fully executed. Any way to speed that up?

run("cmd.exe")
winwaitactive("C:\Windows\system32\cmd.exe")
Send("nircmd.exe setbrightness 100 {enter}")
WinClose("C:\Windows\system32\cmd.exe")

That is the autoedit code that Ive been using.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: Help with AutoIt?, Laptop Brightness Control

Post by KreAch3R »

I think you can send these nircmd.exe parameters through Rainmeter itself, without the use of an external cmd window. Try this:
Executing an external application is done by using the !Execute bang and a space, followed by the command and any parameters inside of square brackets:
LeftMouseUpAction=!Execute ["C:\Windows\Notepad.exe" "FileToOpen.txt"]
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Help with AutoIt?, Laptop Brightness Control

Post by UnforgivenRevival »

Yes that can open the cmd.exe file, But cannot "auto-type" the "nircmd.exe setbrightness 100 {enter}" line in cmd.exe like AutoIt does.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: Help with AutoIt?, Laptop Brightness Control

Post by KreAch3R »

What I meant is that you should use that !bang to send the "nircmd.exe" command directly, with it's parameters, not the "cmd.exe" one.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Help with AutoIt?, Laptop Brightness Control

Post by UnforgivenRevival »

The problem is you have to be in command prompt to send the "action(setbrightness 100)" to nircmd.exe. Simply executing nircmd.exe and trying to give it an "action" in the !bang doesnt work. you have to physically type in "nircmd.exe setbrightness 100" into command prompt to execute properly. I tried it the way that was suggested, But it doesnt seem to work that way. the nircmd program, if opened through a rainmeter !bang, flashes a window on the screen and quickly disappears because its not getting its "action." That is why I was working with the AutoIt Program along with nircmd.exe, or I wouldnt even need AutoIt. :?
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Help with AutoIt?, Laptop Brightness Control

Post by smurfier »

The bang should be formatted as
LeftMouseUpAction=!Execute ["nircmd.exe" setbrightness 100]

Don't forget to define the full path where nircmd is stored.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Help with AutoIt?, Laptop Brightness Control

Post by UnforgivenRevival »

Ill try that. I tried it as !execute ["nircmd.exe" "setbrightness 100"]
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Help with AutoIt?, Laptop Brightness Control

Post by UnforgivenRevival »

Still doesnt work that way. Idk why its not. Specified full path and everything.
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: Help with AutoIt?, Laptop Brightness Control

Post by UnforgivenRevival »

oh wow it works without the full path for some reason. as long as its !execute["nircmd.exe" setbrightness whatever], it works. thankyou very much for the help!