Jump to content

Using ControlSend to avoid Screen Lock


Recommended Posts

Hi guys,

I am very much a newbie, but I am slowly learning by writting simple scripts.

#include <Clipboard.au3>
#include <File.au3>
#include <Msgboxconstants.au3>


Const $test_url  = "https://www.autoitscript.com/site/"
Const $hFileOpen = FileOpen(@WorkingDir & "\TEMP.txt",$FO_OVERWRITE)

; Open FIREFOX at https://www.autoitscript.com/site/
ShellExecute("firefox.exe",$test_url)


Sleep(60000)            ; Allow the page to open - no rush
Send("^a")          ; Select ALL text
Sleep(1000)         ; Pause for 1 second
Send("^c")          ; CTRL + C to copy text
Sleep(1000)         ; Pause for 1 second

; Write Data to File
FileWrite($hFileOpen,_ClipBoard_GetData ($CF_UNICODETEXT))

; Close Temp File
FileClose($hFileOpen)


MsgBox(262144,"Completed","Data Written To File")

The above code basically just copies text on a webpage and outputs it to a file.  Works well. I understand AutoIT a little more now.

However, Send() doesn't work when my screen lock is on. :-(
 

Is there a simple tweak which I can do so that it does work when my screen is locked, bearing in mind that I am not a guru like most users yet.

I read somewhere the ControlSend works, but requires the browser "handle".


Thanks in advance.

Best regards,

Pete

Link to comment
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
 Share

×
×
  • Create New...