Sign in to follow this  
Followers 0
ahq

very new and need some help

7 posts in this topic

#1 ·  Posted (edited)

hi , can someone help me here ? i need to know how to run a script when windows in minimize. i know i can use WinActivate to pop up the window then run but can it stay minimize and still run?

thanks ! :)

Edited by ahq

Share this post


Link to post
Share on other sites



hi , can someone help me here ? i need to know how to run a script when windows in minimize. i know i can use WinActivate to pop up the window then run but can it stay minimize and still run?

thanks ! :)

Normally your script should always continue to run automatically even when you minimize it's window.

Could it be that you clicked it's tray icon and then it pauses? To avoid that, try Opt("TrayAutoPause",0) - the default is 1 meaning script will pause when you click the tray icon, setting it to 0 will prevent autopause.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Normally your script should always continue to run automatically even when you minimize it's window.

Could it be that you clicked it's tray icon and then it pauses? To avoid that, try Opt("TrayAutoPause",0) - the default is 1 meaning script will pause when you click the tray icon, setting it to 0 will prevent autopause.

OMG :P thanks a million :)

Share this post


Link to post
Share on other sites

errrrrrrrrr still dont work :) can you tell me whats wrong with my lousy newbie script :

While 1

Run("SRO_Client")

WinActivate("SRO_Client")

opt("TrayAutoPause",0)

Send("{F4}")

send("0")

sleep(1000)

send("0")

sleep(1000)

send("0")

sleep(1000)

send("0")

sleep(1000)

send("9")

sleep(1000)

send("9")

sleep(1000)

send("9")

sleep(1000)

send("8")

sleep(1000)

send("8")

sleep(1000)

send("8")

sleep(1000)

send("8")

sleep(1000)

send("7")

sleep(1000)

send("7")

sleep(1000)

send("7")

sleep(1000)

send("6")

sleep(1000)

send("6")

sleep(1000)

send("6")

sleep(270000)

WEnd

dont laugh, its my 2nd script lol :P

Share this post


Link to post
Share on other sites

Hmmm... I'm very sorry but my crystall ball doesn't agree with my tarot card reading on what your actual problem is... :)

Some shots in the dark: perhaps starting your app takes longer than the blink of an eye and you need to wait for it before script continues? Use ProcessWait() after the Run command to wait for the process. Same with actually activating the window: use WinWaitActive() to wait for a point in time where the window is actually active, and only then start manipulation. (And remember: sleep(270000) means wait 4.5 minutes! But I guess that's the idea.)


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

thanks bunny :)

Share this post


Link to post
Share on other sites

thanks bunny :)

Another hint: if sending keystrokes to an app doesn't seem to work (in the sense that you KNOW you are sending the right keystrokes to the right window, but the app only sometimes or even never seems to recognise the keystrokes) be sure to use Opt("SendKeyDownDelay",[higher value than the default 5]).

From the SendKeyDownDelay help:

Alters the length of time a key is held down before being released during a keystroke. For applications that take a while to register keypresses (and many games) you may need to raise this value from the default.

Time in milliseconds to pause (default=5).


Roses are FF0000, violets are 0000FF... All my base are belong to you.

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