Jump to content

Recommended Posts

Posted

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

Posted (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 by Earthshine

My resources are limited. You must ask the right questions

 

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

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

Posted

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)

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