Sign in to follow this  
Followers 0
leonardoGalani

Not Running Script under Screen Lock - 4REAL - already saw faq

18 posts in this topic

i saw those old posts ( ) and ( http://www.autoitscript.com/forum/index.php?s=&showtopic=88115 ) and already check the faq ( http://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F / )

The thing is.. its REALLY not working.

My code>>

WinWait("File Download")

Sleep(1000)

ControlClick("File Download","","[CLASS:Button; INSTANCE:2]","")

WinWait("Save As")

Sleep(1000)

ControlSend("Save As","","[CLASS:Edit; INSTANCE:1]", "")

Sleep(1000)

ControlSend("Save As","","[CLASS:Edit; INSTANCE:1]", $CmdLine[3])

Sleep(1000)

ControlClick("Save As","","[CLASS:Button; INSTANCE:1]","")

Sleep(1000)

WinWait("Download complete")

ControlClick("Download complete","","[CLASS:Button; INSTANCE:4]","")

See.. im using only the methods that are suppose to run under lock screen but its not working at all !

Im using windows 2008 server + internet explorer 8 and im triggering the script on a selenium test.

I works fine when i run it when the screen is not locked but it fails and stops on the download file when the screen is lock.

Can you guys gimme a hand.. i dont know what to do!

Share this post


Link to post
Share on other sites



Yeah... 15 minute bump. Not a good idea. You might want to read this while waiting for a reply.


Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Share this post


Link to post
Share on other sites

Sorry for the early "bump" but i think im doing something wrong thats maybe easy to fix.

When i log in on the remote desktop.. the download window modal is there but no action :oops:

Share this post


Link to post
Share on other sites

Bump.

Share this post


Link to post
Share on other sites

try this

1) ControlClick("File Download","","Button2")

2) instead of ControlSend("Save As","","[CLASS:Edit; INSTANCE:1]", "") try ControlSetText("Save As","","Edit1", "")

3) check if there are no other (more than one) "File Download" windows at time of running script

Share this post


Link to post
Share on other sites

try this

1) ControlClick("File Download","","Button2")

2) instead of ControlSend("Save As","","[CLASS:Edit; INSTANCE:1]", "") try ControlSetText("Save As","","Edit1", "")

3) check if there are no other (more than one) "File Download" windows at time of running script

1 - Its was "Button2" but it didnt worked either.

2 - ControlSetText doesnt work.. it sends the file name but when it clicks on the save button.. it try to save with the old name.

3 - No.. there is only 1 file download window at time...

Share this post


Link to post
Share on other sites

Try Omitting the last parameter of ControlClick instead of an empty string.

Default button id Left.

the problem is that when the screen is lock.. it doesnt even reach this far... so i guess this isnt the problem.

it doesnt even click on the first button....

Share this post


Link to post
Share on other sites

Well if the script is failing here

WinWait("File Download")

Then it would seem the problem is before that, which you have not supplied coed for.

I meant for you to try this

ControlClick("File Download","","[CLASS:Button; INSTANCE:2]")

Or

ControlClick("File Download","","[CLASS:Button; INSTANCE:2]","Primary")


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

John,

There is no code before that line..

All the script is there and it works when im using the session..

if i close the session (close remote desktop window) it doesnt work... (created a task)

I tried to compile it for "console" and this didnt worked out.

Once more.. this script is started from my selenium project.

I know it open the script (cz it appears on the menu bar near the clock) but they dont work...

Any other idea^?

Share this post


Link to post
Share on other sites

Zedna,

How can i get the execution log of the autoit?

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

i think zedna means you can make your own debug/log.

A common way would be consolewrite (if compiled as console) or good ol' filewrite works for me.

Most functions return a value of some sort. Just capture the return and feed it to the log file to verify your code is working.

Edited by spudw2k

Share this post


Link to post
Share on other sites

i think zedna means you can make your own debug/log.

Yes I meant that.

Just use FileWrite('I'm here at line xxx') to write info to LOG file and also content of some variables if needed.

Share this post


Link to post
Share on other sites

Scite4Autoit3

Tools -> Trace: Add Trace Lines.

This is unusable for more complicated scripts.

Lastly I tried this it broke my script because it added lines also inside Switch/case or something similar if I can remember correctly ...

Share this post


Link to post
Share on other sites

I've used that technique before to track down an elusive error with a very large script. You just have to go through the script and remove all the places where there are debug lines that you don't need, also anything inside of any While loop you're using on a GUI script, otherwise the output is unreadable.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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