h0324879 Posted October 30, 2019 Posted October 30, 2019 Hi there. I would like to create a script/program that run in background and will automatically detect if MS word is running. Is so, then perform a key combination “ALT + G + PC + Enter” once (yes, merely performing key combination once). If detect activewindow=non-MS word, then will not perform such script/program. In short, the result I want is: Run a detective script in background to determine if activewindows=ms word, then hotkeyset above and the program will not end after the script is run and will resume detecting for active windows in background. Any ideas on where to start with? Many thx!😁
Earthshine Posted October 30, 2019 Posted October 30, 2019 (edited) Start by reading the manual. Then actually write code. Then post it here if you need help. We’re not going to write it for you Edited October 30, 2019 by Earthshine My resources are limited. You must ask the right questions
h0324879 Posted October 31, 2019 Author Posted October 31, 2019 16 hours ago, Earthshine said: Start by reading the manual. Then actually write code. Then post it here if you need help. We’re not going to write it for you Yea I have done the basic to make it run the key combo when I am in word... I mean in a passive way. However I am not able to make it to run at background and let it detect "automatically" the active windows. Any hints or method suggested?
Somerset Posted October 31, 2019 Posted October 31, 2019 3 hours ago, h0324879 said: Any hints or method suggested? Many methods, they are hidden in the help file. Code you write, and show; allows others to help you. Otherwise it is a guessing game for everyone.
Marc Posted October 31, 2019 Posted October 31, 2019 As a start, simply run a loop and wait for your window to get activated... While 1 $titel = WinGetTitle("") If ($titel <> "Word") Then ContineLoop ; run your commands WEnd of course if your action do not close word, you'd have to prevent hammering your keys again and again into the same word instance... Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)
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