my script wont work please help Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
stanthekfcman
Posts: 4
Joined: 13 Jun 2019, 05:54

my script wont work please help

13 Jun 2019, 05:58

Ok, so i have started scripting a way to auto save my work after 10 mins but it doesn't seem to work can you please help me?
the code is here anything to help me fix this



Code: Select all

CoordMode, Pixel, Relative
IfWinActive, ("ahk_exe WINWORD.EXE")
{  
   Loop {
                Sleep, 600000
                PixelGetColour, colour, 950, -10
               IFEqual, colour, 0xFFFFFFFF {
                MsgBox,0,AutoSave,Time to save your work..., 3
                Sleep, 3000
                Send ^s
                                                                    }
               } Until, WinWaitClose,  ("ahk_exe WINWORD.EXE")
}

IfWinActive, ("ahk_exe WINWORD.EXE")
{
  Loop {
              Sleep, 600000
              PixelGetColour, colour2, 950, -10
             IFEqual, colour2, 
              MsgBox,0,AutoSave,Time to save your work...,3
              Sleep, 3000
              Send ^s
             }
}

If Process, Wait, MSPUB.EXE
{
 Loop {
             Sleep, 600000
            MsgBox,0,AutoSave,Time to save your work...,3
            Sleep,3000
           Send ^s
           }
}
Moderator Note: Added code tags. ~ sinkfaze
Rohwedder
Posts: 2212
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: my script wont work please help  Topic is solved

13 Jun 2019, 09:56

Hallo,
I would also refuse to work.
Admit it! You not once tested!
Error at line 6.

Line Text: PixelGetColour, colour, 950, -10
Error: This line does not contain a recognized action.

The program will exit.
stanthekfcman
Posts: 4
Joined: 13 Jun 2019, 05:54

Re: my script wont work please help

20 Jun 2019, 04:47

i did test my script please check my most recent post NOTE: when this script is run word is in full screen and i have debugged the program but it doesn't function
Rohwedder
Posts: 2212
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: my script wont work please help

20 Jun 2019, 12:34

Hallo,
your most recent post has no code.
I put your first piece of code in a timer.

Code: Select all

#Persistent
CoordMode, Pixel, Relative
SetTimer, Timer, 600000 ;every 600 seconds
Return
Timer:
IfWinActive, ahk_exe WINWORD.EXE
{
	PixelGetColor, colour, 950, -10
	IFEqual, colour, 0xFFFFFF
	{
		MsgBox,0,AutoSave,Time to save your work..., 3
		Sleep, 3000
		Send ^s
	}
}
Return
But, my German Word does not respond to Send ^s
stanthekfcman
Posts: 4
Joined: 13 Jun 2019, 05:54

Re: my script wont work please help

20 Jun 2019, 20:50

sorry this my old post i have fixed the getpixel issue the new post hasn't been moderated yet will post link when it has can i have help with most recent post
regards
stan
gregster
Posts: 2976
Joined: 30 Sep 2013, 06:48

Re: my script wont work please help

20 Jun 2019, 21:49

stanthekfcman wrote:
20 Jun 2019, 20:50
sorry this my old post i have fixed the getpixel issue the new post hasn't been moderated yet will post link when it has can i have help with most recent post
Well, there is no unapproved post of you (if you meant that)... but perhaps you mean this post which has no replies yet: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=65569

Return to “Ask For Help”

Who is online

Users browsing this forum: [martin], AHK_user, anaxio, colt, Google [Bot], Newbie0919, Veterus, wjdtlfwkd1029 and 234 guests