Jump to content
Sign in to follow this  
keithy

Task Scheduler and WinWaitActive

Recommended Posts

keithy

I have written a script that uses "run" to fire up our ERP program (Navision), then WinWaitActive to wait until Nav fires up, then pokes keystrokes at the app to select some reports to print.

It works fine if I "go" in Scite editor, but wont run as an .exe or as a Server2008 scheduled task, presumably because the Navision program is hidden, so Winwaitactive never gets triggered. Navision is running in task Manager in this situation.

I would like this to run unattended overnight, so any pointers would be much appreciated.

NB Apropo the forum rules : I am not attempting to de-complile or violate the terms of the licence for Navision here !!

Edited by keithy

Share this post


Link to post
Share on other sites
someone

I've never run an exe from a scheduled task like your trying to do, so I could be way off, but...

Can you use WinWait instead of WinWaitActive? When you say it, 'pokes' some keystrokes, is it using Send or ControlSend? ControlSend may still work, while I wouldn't expect Send to work at all. If you need to add text try controlsettext. Just a few ideas. If that doesn't work please post a reproducer (or your entire code if it isn't too large).


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites
keithy

Thanks for the feedback. I thought that I would need to use WinWaitActive to ensure that the application fires up OK. I am using send (because it looked the simplest way at the time !) , but I will have a look at ControlSend now. I may be back !

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  

×