I have a color picker that I would like to use to broadcast a value to any script that is listening.
For extra context.
.
.
Does anyone have a good method to accomplish this?
I think that there is a message that can be used but I can't recall what it was.
A simple example of script 1 passing script 2 a value of "FF0000" when you press f1 would be perfect.
Thanks for your time.
Sending and receiving a broadcast message. Topic is solved
Re: Sending and receiving a broadcast message. Topic is solved
Thanks mikeyww.
In my case though I needed something that would allow any script that is set to "listen" to be able to get the values.
This is what I have found that does the trick (so far).
Code: Select all
;Script 1
;#################
#SingleInstance Force
objShell := ComObjCreate( "WScript.Shell" )
objEnv := objShell.Environment( "Volatile" )
objEnv.Item( "Color" ) := "22262A"
return
F1::
objEnv.Item( "Color" ) := Random( min := 0 , max := 100 )
return
Random( min := 0 , max := 100 ){
local outputVar
Random, outputVar , min , max
return outputVar
}
;#################
;Script 2
;#################
#SingleInstance Force
return
F2::
objShell := ComObjCreate( "WScript.Shell" )
objEnv := objShell.Environment( "Volatile" )
MsgBox, % objEnv.Item( "Color" )
return
;#################
Who is online
Users browsing this forum: adam86shadow, Bing [Bot], Chunjee, JKJadan and 275 guests