Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Running a script with Schedule Task wont work



  • Please log in to reply
3 replies to this topic
azzaams
  • Members
  • 3 posts
  • Last active: Oct 26 2015 02:52 PM
  • Joined: 23 Oct 2015

Hello,

I have created a script to double click and open an app on the desktop.

When I manually open the script file .ahk it works without any problem. Even tried compiling it and works fine. But when i add this to my windows Schedule task, it wont work correctly. Neither the ahk file or the compiled one.

 

During the test what I found is, Y position is always try to open (double click) at position 39. No matter what position I gave. I have also, added to open up notepad.exe just to make sure the script really works. So, it opens up notepad and can see it is clicking at 281,39 always. No matter what Y position I changed in the script.

 

eg. script below;

--

SetDefaultMouseSpeed, 0

MouseMove, 281,530

MouseClick, left, , , 2

Run notepad.exe

Return

--

Please help.

Thanks in advance.

 



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
How do you know which window will be active when the task runs? I suggest using screen coordinates: CoordMode, Mouse, Screen

azzaams
  • Members
  • 3 posts
  • Last active: Oct 26 2015 02:52 PM
  • Joined: 23 Oct 2015

As far as I can see, no active windows open at the time it is trying to click. However, I will try your suggestion and update here.

Thanks



azzaams
  • Members
  • 3 posts
  • Last active: Oct 26 2015 02:52 PM
  • Joined: 23 Oct 2015
✓  Best Answer

Thank you Lexikos,

Having tested with an icon at the lower end of the screen it didn't work. But however, changing the icons position somewhat to the top with your suggestion ONLY it worked.

Appreciated your help.

Az