Gui not on screen after running command

Get help with using AutoHotkey and its commands and hotkeys
Programinator
Posts: 26
Joined: 22 Dec 2018, 22:20

Gui not on screen after running command

30 Dec 2018, 20:51

I made a Gui and I have a dropdown list in there. The problem im having with the dropdown box is that when I select something from it then a command runs which currently for testing I have it set to run a mouse move and click and also some msg boxes. So the problem is that after the command runs the gui is no longer on the screen. Any help on this would be appreciated. Also the script is still running on system trey but its not on screen anymore.

Code: Select all

#SingleInstance,Force
;--------------------------------------------------------------------------------------------------------------------------------------------------------




;Gui Layout
:---------------------
:---------------------------------

List:="         FACING||one|two|three|four"


;Gui, AlwaysOnTop

Gui, Font, c190707 bold, Trebuchet MS

Gui, Add, DropDownList, x10 y168 w125 gAction vChoise, % List

Gui, Add, Button, x10 y12 w125 gMill_Mach_Def, MILL MACH DEF  ;Button 1

Gui, Add, Button, x+10 w125 gMerge_Vise, MERGE KURT VISE  ;Button 2

Gui, Add, Button, x+10 w125 gImport_Toolpath, IMPORT TOOLPATH  ;Button 3

Gui, Add, Button, x10 y42 w125 gImport_Levels, IMPORT LEVELS  ;Button 4

Gui, Add, Button, x+10 w125 gMerge_2_Vise, MERGE 2 VISE ;Button 5

Gui, Add, Button, x+10 w125 gChange_Offset, CHANGE OFFSET  ;Button 6

Gui, Add, Button, x10 y74 w125 gCenter_Points, CENTER POINTS   ;Button 7

Gui, Add, Button, x+10 w125 gMerge_BJ_Vise, MERGE BJ VISE ;Button 8

Gui, Add, Button, x+10 w125 gRenumber_Tools, RENUMBER TOOLS  ;Button 9

Gui, Add, Button, x10 y106 w125 gSolid_Stock, SOLID STOCK  ;Button 10

Gui, Add, Button, x+10 w125 gMerge_2BJ_Vise, MERGE 2BJ VISE  ;Button 11

Gui, Add, Button, x+10 w125 gStock_Model, STOCK MODEL  ;Button 12

Gui, Add, Button, x10 y138 w125 gStock_Setup, STOCK SETUP  ;Button 13

Gui, Add, Button, x+10 w125 gMerge_ALJ_Vise, MERGE ALJ VISE  ;Button 14

Gui, Add, Button, x+10 w125 gNew_Group, NEW GROUP ;Button 15


Gui, Color, 6A6A6A

Gui, Show, x806 y618 w417 h500, MasterCam Commands
return


Action:
{
    Gui, Submit
    If (Choise = "one")
        MouseClick, right,  639,  149 
    If (Choise = "two")
        MsgBox, 2nd action
    If (Choise = "three")
        MsgBox, 3rd action
    If (Choise = "four")
        MsgBox, 4th action
}
return

Run:
	Gui,Submit,%Choise%
	return


;Gui Labels
;----------------------
;---------------------------------------





Mill_Mach_Def: 
BlockInput, MouseMove
CoordMode, Mouse, Screen
MouseClick, left,  3800,  120
Sleep, 100
CoordMode, Mouse, Window
WinWait, ahk_exe Mastercam.exe, 
IfWinNotActive, ahk_exe Mastercam.exe, , ahk_exe Mastercam.exe, 
WinWaitActive, ahk_exe Mastercam.exe, 
MouseClick, left,  258,  66
Sleep, 100
MouseClick, left,  289,  109
Sleep, 100
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, left,  100,  138
Sleep, 800
MouseClick, left,  100,  138
Sleep, 800
Send, {END}{BACKSPACE}{BACKSPACE}{ENTER}
BlockInput, MouseMoveOff
	return






Import_Toolpath:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  639,  149
Sleep, 100
MouseClick, left,  531,  566
Sleep, 100
BlockInput, MouseMoveOff
return
	


Center_Points:
BlockInput, MouseMove
CoordMode, Mouse, Screen
MouseClick, left,  3800,  120
Sleep, 100
CoordMode, Mouse, Window
WinWait, ahk_exe Mastercam.exe, 
IfWinNotActive, ahk_exe Mastercam.exe, , ahk_exe Mastercam.exe, 
WinWaitActive, ahk_exe Mastercam.exe, 
Send, {CTRLDOWN}a{CTRLUP}{CTRLDOWN}{SHIFTDOWN}b{SHIFTUP}{CTRLUP}
Sleep, 300
MouseClick, left,  131,  424
Sleep, 100
MouseClick, left,  48,  747
Sleep, 100
MouseClick, left,  56,  788
Sleep, 100
MouseClick, left,  63,  809
Sleep, 100
MouseClick, left, -1068,  125
Sleep, 100
MouseClick, left,  3000,  123
Sleep, 100
MouseClick, left,  316,  135
Sleep, 100
BlockInput, MouseMoveOff
return





Solid_Stock:
BlockInput, MouseMove
CoordMode, Mouse, Screen
MouseClick, left,  3800,  120
Sleep, 100
CoordMode, Mouse, Window
WinWait, ahk_exe Mastercam.exe, 
IfWinNotActive, ahk_exe Mastercam.exe, , ahk_exe Mastercam.exe, 
WinWaitActive, ahk_exe Mastercam.exe, 
Send, {CTRLDOWN}a{CTRLUP}{CTRLDOWN}{SHIFTDOWN}b{SHIFTUP}{CTRLUP}
Sleep, 300
MouseClick, left,  133,  389
Sleep, 100
MouseClick, left,  44,  785
Sleep, 100
MouseClick, left,  50,  806
Sleep, 100
MouseClick, left,  46,  828
Sleep, 100
MouseClick, left, -1074,  153
Sleep, 100
MouseClick, left,  205,  507
Sleep, 100
BlockInput, MouseMoveOff
return




Change_Offset:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  612,  154
Sleep, 100
MouseClick, left,  566,  254
Sleep, 100
MouseClick, left,  319,  254
Sleep, 100
WinWait, Edit Common Parameters (Mill/Router), 
IfWinNotActive, Edit Common Parameters (Mill/Router), , WinActivate, Edit Common Parameters (Mill/Router), 
WinWaitActive, Edit Common Parameters (Mill/Router), 
MouseClick, left,  558,  311
Sleep, 100
WinWait, Toolpath Coordinate System, 
IfWinNotActive, Toolpath Coordinate System, , WinActivate, Toolpath Coordinate System, 
WinWaitActive, Toolpath Coordinate System, 
MouseClick, left,  510,  367
Sleep, 100
WinWait, Edit Common Parameters (Mill/Router), 
IfWinNotActive, Edit Common Parameters (Mill/Router), , WinActivate, Edit Common Parameters (Mill/Router), 
WinWaitActive, Edit Common Parameters (Mill/Router), 
MouseClick, left,  580,  624
Sleep, 100
BlockInput, MouseMoveOff
return



Stock_Setup:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, left,  39,  163
Sleep, 100
MouseClick, left,  110,  224
Sleep, 100
WinWait, Machine Group Properties, 
IfWinNotActive, Machine Group Properties, , WinActivate, Machine Group Properties, 
WinWaitActive, Machine Group Properties, 
MouseClick, left,  132,  124
Sleep, 100
WinWait, Plane Selection, 
IfWinNotActive, Plane Selection, , WinActivate, Plane Selection, 
WinWaitActive, Plane Selection, 
Send, {DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}
WinWait, Machine Group Properties, 
IfWinNotActive, Machine Group Properties, , WinActivate, Machine Group Properties, 
WinWaitActive, Machine Group Properties, 
MouseClick, left,  45,  321
Sleep, 100
MouseClick, left,  60,  395
Sleep, 100
MouseClick, left,  295,  615
Sleep, 100
MouseClick, left,  383,  679
Sleep, 100
BlockInput, MouseMoveOff
return



Renumber_Tools:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, left,  636,  143
Sleep, 100
MouseClick, left,  16,  68
Sleep, 100
MouseClick, right,  637,  150
Sleep, 100
MouseClick, left,  508,  252
Sleep, 100
MouseClick, left,  336,  339
Sleep, 100
WinWait, Renumber tools, 
IfWinNotActive, Renumber tools, , WinActivate, Renumber tools, 
WinWaitActive, Renumber tools, 
MouseClick, left,  127,  303
Sleep, 100
BlockInput, MouseMoveOff
return




Stock_Model:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  652,  147
Sleep, 100
MouseClick, left,  633,  159
Sleep, 100
MouseClick, left,  295,  522
Sleep, 100
WinWait, Stock model, 
IfWinNotActive, Stock model, , WinActivate, Stock model, 
WinWaitActive, Stock model, 
MouseClick, left,  107,  92
Sleep, 100
MouseClick, left,  420,  515
Sleep, 100
MouseClick, left,  92,  111
Sleep, 100
MouseClick, left,  480,  126
Sleep, 100
MouseClick, left,  98,  126
Sleep, 100
MouseClick, left,  475,  230
Sleep, 100
;CoordMode, Mouse, Screen
;MouseClick, left,  3800,  120
;Sleep, 100
;CoordMode, Mouse, Window
Send, {CTRLDOWN}a{CTRLUP}{ENTER}
WinWait, Stock model, 
IfWinNotActive, Stock model, , WinActivate, Stock model, 
WinWaitActive, Stock model, 
MouseClick, left,  639,  651
Sleep, 100
BlockInput, MouseMoveOff
return





Import_Levels:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
MouseClick, right,  78,  103
Sleep, 100
MouseClick, left,  207,  465
Sleep, 100
WinWait, Open, 
IfWinNotActive, Open, , WinActivate, Open, 
WinWaitActive, Open, 
Clipboard := ""
    Clipboard =
        (
            C:\Users\Public\Documents\shared Mcam2019\mill\Levels.csv
        )
    Send, ^v
	Send, {ENTER}
return



Merge_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\KURT VISE.mcam
        )
    Send, ^v
	Send, {ENTER}
return




Merge_2_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\2 KURT VISE.mcam
        )
    Send, ^v
	Send, {ENTER}
return







Merge_BJ_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\KURT VISE JAWS BACK.mcam
        )
    Send, ^v
	Send, {ENTER}
return







Merge_2BJ_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\2 VISE JAWS BACK.mcam
        )
    Send, ^v
	Send, {ENTER}
return






Merge_ALJ_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\KURT VISE ALUM JAWS.mcam
        )
    Send, ^v
	Send, {ENTER}
return




New_Group:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  92,  141
Sleep, 100
MouseClick, left,  149,  273
Sleep, 100
MouseClick, left,  403,  294
Sleep, 100
Send, {ENTER}
BlockInput, MouseMoveOff
return
















GuiClose:
	ExitApp
	return

!Esc::ExitApp
User avatar
Delta Pythagorean
Posts: 567
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

Re: Gui not on screen after running command

31 Dec 2018, 00:02

Instead of Gui, Submit, Try Gui, Submit, NoHide

- [AHK].......: 1.1.33.02 Unicode 64-bit
- [OS].........: Windows 10.0.18362
- [GITHUB]...: github.com/DeltaPyth
- [PAYPAL]....: paypal.me/DelPyth
- [DISCORD]..: Delta#3324

Remember to use [code]CODE[/code] for your multi-line scripts.
Stay safe, stay inside, and remember to wash your hands for 20 seconds!
Programinator
Posts: 26
Joined: 22 Dec 2018, 22:20

Re: Gui not on screen after running command

31 Dec 2018, 07:50

Ok that worked to keep the Gui up. Now I have 2 more problems.

1. I had a mouse click in for testing but I replaced that with the real code that I want run. so now what it does when I select "one" in the dropdown it runs like it should. But then when I select "two, three, or four" it will run the same as if I selected "one" again. What it should do is run the msgbox

2. I would like the word FACING to always be on the top and showing after I make any selection. Im just using it as a label for the list below. I don't need it to do anything. what it's doing now is leaving my last selection at the top.

Here is what I have now:

Code: Select all

#SingleInstance, Force


;Gui Layout
:---------------------
:---------------------------------
List:="        FACING||one|two|three|four" ;-------------

Gui, Font, s10 c190707 bold, Trebuchet MS

Gui, Add, DropDownList, x10 y180 w125 gAction vChoise, % List ;---------------

Gui, Add, Button, x10 y10 w125 gMill_Mach_Def, MILL MACH DEF  ;Button 1

Gui, Add, Button, x+10 w125 gMerge_Vise, MERGE KURT VISE  ;Button 2

Gui, Add, Button, x+10 w125 gImport_Toolpath, IMPORT TOOLPATH  ;Button 3

Gui, Add, Button, x10 y44 w125 gImport_Levels, IMPORT LEVELS  ;Button 4

Gui, Add, Button, x+10 w125 gMerge_2_Vise, MERGE 2 VISE ;Button 5

Gui, Add, Button, x+10 w125 gChange_Offset, CHANGE OFFSET  ;Button 6

Gui, Add, Button, x10 y78 w115 gCenter_Points, CENTER POINTS   ;Button 7

Gui, Add, Button, x+1 y78 w9 gUndo  ;Button 7.5

Gui, Add, Button, x+10 w125 gMerge_BJ_Vise, MERGE BJ VISE ;Button 8

Gui, Add, Button, x+10 w125 gRenumber_Tools, RENUMBER TOOLS  ;Button 9

Gui, Add, Button, x10 y112 w125 gSolid_Stock, SOLID STOCK  ;Button 10

Gui, Add, Button, x+10 w125 gMerge_2BJ_Vise, MERGE 2BJ VISE  ;Button 11

Gui, Add, Button, x+10 w125 gStock_Model, STOCK MODEL  ;Button 12

Gui, Add, Button, x10 y146 w125 gStock_Setup, STOCK SETUP  ;Button 13

Gui, Add, Button, x+10 w125 gMerge_ALJ_Vise, MERGE ALJ VISE  ;Button 14

Gui, Add, Button, x+10 w125 gNew_Group, NEW GROUP ;Button 15






Stalked_Window:="Levels"

gosub,Win_Watch  	; check to see if the window exists as soon as the script is launched
					

Win:=WinExist(Stalked_Window)   ;Get the handle for your target program (using calculator for testing)

Gui,1:+Owner%Win% 	; Set your target window as the owner of the gui
Gui, Color, 6A6A6A
;Gui,1:Show,w300 h300
Gui, Show, x806 y618 w417 h220, MasterCam Commands ;-------was h180
SetTimer,Win_Watch,500
return

Win_Watch:
	 ifWinNotExist, ahk_exe Mastercam.exe
	;if(!WinExist(Stalked_Window))	; if your target is not present, the script will exit.
		ExitApp
	return

Action:
{
    Gui, Submit, NoHide
    If (Choise = "one")
       BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  639,  149
Sleep, 100
MouseClick, left,  531,  566
Sleep, 100
BlockInput, MouseMoveOff
return
    If (Choise = "two")
        MsgBox, 2nd action
    If (Choise = "three")
        MsgBox, 3rd action
    If (Choise = "four")
        MsgBox, 4th action
}
return




;Gui Labels
;----------------------
;---------------------------------------

Mill_Mach_Def: 
BlockInput, MouseMove
CoordMode, Mouse, Screen
MouseClick, left,  3800,  120
Sleep, 100
CoordMode, Mouse, Window
WinWait, ahk_exe Mastercam.exe, 
IfWinNotActive, ahk_exe Mastercam.exe, , ahk_exe Mastercam.exe, 
WinWaitActive, ahk_exe Mastercam.exe, 
MouseClick, left,  258,  66
Sleep, 100
MouseClick, left,  289,  109
Sleep, 100
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, left,  100,  138
Sleep, 800
MouseClick, left,  100,  138
Sleep, 800
Send, {END}{BACKSPACE}{BACKSPACE}{ENTER}
BlockInput, MouseMoveOff
	return






Import_Toolpath:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  639,  149
Sleep, 100
MouseClick, left,  531,  566
Sleep, 100
BlockInput, MouseMoveOff
return
	


Center_Points:
BlockInput, MouseMove
CoordMode, Mouse, Screen
MouseClick, left,  3800,  120
Sleep, 100
CoordMode, Mouse, Window
WinWait, ahk_exe Mastercam.exe, 
IfWinNotActive, ahk_exe Mastercam.exe, , ahk_exe Mastercam.exe, 
WinWaitActive, ahk_exe Mastercam.exe, 
Send, {CTRLDOWN}a{CTRLUP}{CTRLDOWN}{SHIFTDOWN}b{SHIFTUP}{CTRLUP}
Sleep, 300
MouseClick, left,  131,  424
Sleep, 100
MouseClick, left,  48,  747
Sleep, 100
MouseClick, left,  56,  788
Sleep, 100
MouseClick, left,  63,  809
Sleep, 100
MouseClick, left, -1068,  125
Sleep, 100
MouseClick, left,  3000,  123
Sleep, 100
MouseClick, left,  316,  135
Sleep, 100
BlockInput, MouseMoveOff
return





Solid_Stock:
BlockInput, MouseMove
CoordMode, Mouse, Screen
MouseClick, left,  3800,  120
Sleep, 100
CoordMode, Mouse, Window
WinWait, ahk_exe Mastercam.exe, 
IfWinNotActive, ahk_exe Mastercam.exe, , ahk_exe Mastercam.exe, 
WinWaitActive, ahk_exe Mastercam.exe, 
Send, {CTRLDOWN}a{CTRLUP}{CTRLDOWN}{SHIFTDOWN}b{SHIFTUP}{CTRLUP}
Sleep, 300
MouseClick, left,  133,  389
Sleep, 100
MouseClick, left,  44,  785
Sleep, 100
MouseClick, left,  50,  806
Sleep, 100
MouseClick, left,  46,  828
Sleep, 100
MouseClick, left, -1074,  153
Sleep, 100
MouseClick, left,  205,  507
Sleep, 100
BlockInput, MouseMoveOff
return




Change_Offset:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  612,  154
Sleep, 100
MouseClick, left,  566,  254
Sleep, 100
MouseClick, left,  319,  254
Sleep, 100
WinWait, Edit Common Parameters (Mill/Router), 
IfWinNotActive, Edit Common Parameters (Mill/Router), , WinActivate, Edit Common Parameters (Mill/Router), 
WinWaitActive, Edit Common Parameters (Mill/Router), 
MouseClick, left,  558,  311
Sleep, 100
WinWait, Toolpath Coordinate System, 
IfWinNotActive, Toolpath Coordinate System, , WinActivate, Toolpath Coordinate System, 
WinWaitActive, Toolpath Coordinate System, 
MouseClick, left,  510,  367
Sleep, 100
WinWait, Edit Common Parameters (Mill/Router), 
IfWinNotActive, Edit Common Parameters (Mill/Router), , WinActivate, Edit Common Parameters (Mill/Router), 
WinWaitActive, Edit Common Parameters (Mill/Router), 
MouseClick, left,  580,  624
Sleep, 100
BlockInput, MouseMoveOff
return



Stock_Setup:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, left,  39,  163
Sleep, 100
MouseClick, left,  110,  224
Sleep, 100
WinWait, Machine Group Properties, 
IfWinNotActive, Machine Group Properties, , WinActivate, Machine Group Properties, 
WinWaitActive, Machine Group Properties, 
MouseClick, left,  132,  124
Sleep, 100
WinWait, Plane Selection, 
IfWinNotActive, Plane Selection, , WinActivate, Plane Selection, 
WinWaitActive, Plane Selection, 
Send, {DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}
WinWait, Machine Group Properties, 
IfWinNotActive, Machine Group Properties, , WinActivate, Machine Group Properties, 
WinWaitActive, Machine Group Properties, 
MouseClick, left,  45,  321
Sleep, 100
MouseClick, left,  60,  395
Sleep, 100
MouseClick, left,  295,  615
Sleep, 100
MouseClick, left,  383,  679
Sleep, 100
BlockInput, MouseMoveOff
return



Renumber_Tools:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, left,  636,  143
Sleep, 100
MouseClick, left,  16,  68
Sleep, 100
MouseClick, right,  637,  150
Sleep, 100
MouseClick, left,  508,  252
Sleep, 100
MouseClick, left,  336,  339
Sleep, 100
WinWait, Renumber tools, 
IfWinNotActive, Renumber tools, , WinActivate, Renumber tools, 
WinWaitActive, Renumber tools, 
MouseClick, left,  127,  303
Sleep, 100
BlockInput, MouseMoveOff
return




Stock_Model:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  652,  147
Sleep, 100
MouseClick, left,  633,  159
Sleep, 100
MouseClick, left,  295,  522
Sleep, 100
WinWait, Stock model, 
IfWinNotActive, Stock model, , WinActivate, Stock model, 
WinWaitActive, Stock model, 
MouseClick, left,  107,  92
Sleep, 100
MouseClick, left,  420,  515
Sleep, 100
MouseClick, left,  92,  111
Sleep, 100
MouseClick, left,  480,  126
Sleep, 100
MouseClick, left,  98,  126
Sleep, 100
MouseClick, left,  475,  230
Sleep, 100
;CoordMode, Mouse, Screen
;MouseClick, left,  3800,  120
;Sleep, 100
;CoordMode, Mouse, Window
Send, {CTRLDOWN}a{CTRLUP}{ENTER}
WinWait, Stock model, 
IfWinNotActive, Stock model, , WinActivate, Stock model, 
WinWaitActive, Stock model, 
MouseClick, left,  639,  651
Sleep, 100
BlockInput, MouseMoveOff
return





Import_Levels:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
MouseClick, right,  78,  103
Sleep, 100
MouseClick, left,  207,  465
Sleep, 100
WinWait, Open, 
IfWinNotActive, Open, , WinActivate, Open, 
WinWaitActive, Open, 
Clipboard := ""
    Clipboard =
        (
            C:\Users\Public\Documents\shared Mcam2019\mill\Levels.csv
        )
    Send, ^v
	Send, {ENTER}
return



Merge_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\KURT VISE.mcam
        )
    Send, ^v
	Send, {ENTER}
return




Merge_2_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\2 KURT VISE.mcam
        )
    Send, ^v
	Send, {ENTER}
return







Merge_BJ_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\KURT VISE JAWS BACK.mcam
        )
    Send, ^v
	Send, {ENTER}
return







Merge_2BJ_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\2 VISE JAWS BACK.mcam
        )
    Send, ^v
	Send, {ENTER}
return






Merge_ALJ_Vise:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{m Down}{m Up}{Alt Up}
	Sleep, 100
Clipboard := ""
    Clipboard =
        (
           C:\Users\Public\Documents\shared Mcam2019\mill\KURT VISE ALUM JAWS.mcam
        )
    Send, ^v
	Send, {ENTER}
return





Undo:
WinWait, Levels, 
IfWinNotActive, Levels, , WinActivate, Levels, 
WinWaitActive, Levels, 
	Send {Alt Down}{u Down}{u Up}{Alt Up}
	return





New_Group:
BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  92,  141
Sleep, 100
MouseClick, left,  149,  273
Sleep, 100
MouseClick, left,  403,  294
Sleep, 100
Send, {ENTER}
BlockInput, MouseMoveOff
return





GuiClose:
	ExitApp
	return

!Esc::ExitApp
Programinator
Posts: 26
Joined: 22 Dec 2018, 22:20

Re: Gui not on screen after running command

31 Dec 2018, 11:16

ok I figured out problem number 1 by adding { } and a return

Code: Select all

Action:
{
    Gui, Submit, NoHide
    If (Choise = "one")
	{
       BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  639,  149
Sleep, 100
MouseClick, left,  531,  566
Sleep, 100
BlockInput, MouseMoveOff
	return
	}
    If (Choise = "two")
        MsgBox, 2nd action
    If (Choise = "three")
        MsgBox, 3rd action
    If (Choise = "four")
        MsgBox, 4th action
}
return

but I still have not got the FACING text on top of dropdown after selecting other in dropdown list.

any thoughts.....anyone?
Programinator
Posts: 26
Joined: 22 Dec 2018, 22:20

Re: Gui not on screen after running command

31 Dec 2018, 11:52

seems like this worked

Code: Select all

Action:
{
    Gui, Submit, NoHide
    If (Choise = "one")
	{
       BlockInput, MouseMove
WinWait, Toolpaths, 
IfWinNotActive, Toolpaths, , WinActivate, Toolpaths, 
WinWaitActive, Toolpaths, 
MouseClick, right,  639,  149
Sleep, 100
MouseClick, left,  531,  566
Sleep, 100
BlockInput, MouseMoveOff
GuiControl,, Choise, |%List%
	return
	}
    If (Choise = "two")
        MsgBox, 2nd action
    If (Choise = "three")
        MsgBox, 3rd action
    If (Choise = "four")
        MsgBox, 4th action
}

return
added this line: GuiControl,, Choise, |%List%

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], boiler, DanRim, f333t, fatphil, FredOoo, Google [Bot], KHA, mikeyww, Paul H 81, Roiy, scriptor2016, sipureysafta, solidsnake_fear, techmon, zxyzgt and 73 guests