Jump to content

Recommended Posts

Posted (edited)

Good day,

I developed a script to test the various modes. Following are the test notes:

Spoiler
#cs
Mode Test
1) In this test, I need to determine the status of the MouseCoordMode Option and Parameter.
2) The default MouseCoordMode is [1].
3) In this test, various functions will consist of various modes.
4) My objective is to see if modes persist...or not.
5) If modes DO persist, then do I need to reset the mode back to default - it would appear that I do.
6) If so,
a) Where is the best place to set the mode? and.
b) Where is the best place to reset the mode back to default?
#ce

 

...and here is the test script:

Spoiler
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
Global $hNotepad = "[CLASS:Notepad]"
; -----------------------------------------------
ModeTests()
; -----------------------------------------------
Func ModeTests()
    ModeTest()
    ModeTest0()
    ModeTest()
    ModeTest1()
    ModeTest()
    ModeTest2()
    ModeTest()
EndFunc   ;==>ModeTests
; -----------------------------------------------
Func ModeTest()
    Local $currentMode = Opt("MouseCoordMode")
    ConsoleWrite("Current MouseCoordMode of ModeTest: " & $currentMode & @CRLF)
    ; ---------------------
    WinActivate($hNotepad)
    MouseMove(10, 10)
EndFunc   ;==>ModeTest
; -----------------------------------------------
Func ModeTest0()
    Local $currentMode = Opt("MouseCoordMode")
    ConsoleWrite("Current MouseCoordMode of ModeTest0: " & $currentMode & @CRLF)
    ; ---------------------
    Opt("MouseCoordMode", 0)
    WinActivate($hNotepad)
    MouseMove(10, 10)
EndFunc   ;==>ModeTest0
; -----------------------------------------------
Func ModeTest1()
    Local $currentMode = Opt("MouseCoordMode")
    ConsoleWrite("Current MouseCoordMode of ModeTest1: " & $currentMode & @CRLF)
    ; ---------------------
    Opt("MouseCoordMode", 1)
    WinActivate($hNotepad)
    MouseMove(10, 10)
EndFunc   ;==>ModeTest1
; -----------------------------------------------
Func ModeTest2()
    Local $currentMode = Opt("MouseCoordMode")
    ConsoleWrite("Current MouseCoordMode of ModeTest2: " & $currentMode & @CRLF)
    ; ---------------------
    Opt("MouseCoordMode", 2)
    WinActivate($hNotepad)
    MouseMove(10, 10)
EndFunc   ;==>ModeTest2
; -----------------------------------------------

 

With regards, to #6 and the two questions then:

a) Where is the best place to set the mode? and.
b) Where is the best place to reset the mode back to default?

Any assistance would be greatly appreciated!

PS: Here is my completed script...which appears to be working...would really appreciate a look-see, however...

Spoiler
; -----------------------------------------------
#include <AutoItConstants.au3>
#include "ExtMsgBox.au3"
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
Global $iTimeOut = 100
Global $iExtTimeOut = 1000
Global $iEMBWidth = 475
Global $iMsgDelay = 2
; ---------------------
Global $hSAC_MAIN = "[CLASS:SAC_MAIN]"
Global $hSAC_FKEYPROPERTIES = "[CLASS:SAC_FKEYPROPERTIES]"
Global $sSrcMixSessionPath = "C:\RML\SAC\SAC64.exe G:\Session_Master\Session_Master.mxs"
; ---------------------
Global $hSAWSTUDIO_MAIN = "[CLASS:SAWSTUDIO_MAIN]"
Global $sSrcSessionPath = "C:\RML\SAW\SAWStudio64.exe G:\Session_Master\Session_Master.edl"
; -----------------------------------------------
Procedure2Insert()
; -----------------------------------------------
Func Procedure2Insert()
    LaunchBothWSF()
    PSAW()
    SelectSACLink()
    PSAC()
    ExitBoth()
EndFunc   ;==>Procedure2Insert
; -----------------------------------------------
Func LaunchBothWSF()
    LaunchSACWSF()
    LaunchSAWWSF()
EndFunc   ;==>LaunchBothWSF
; -----------------------------------------------
Func LaunchSACWSF()
    Local $sSrcPath = $sSrcMixSessionPath
    ; -----------------------------------------------
    Run($sSrcPath)
    ; ---------------------
    WinWait($hSAC_MAIN)
    WinActivate($hSAC_MAIN)
    ; ---------------------
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 27, 54, 1, 0)
    ; ---------------------
    Sleep($iExtTimeOut)
EndFunc   ;==>LaunchSACWSF
; -----------------------------------------------
Func LaunchSAWWSF()
    Local $sSrcPath = $sSrcSessionPath
    ; -------------------------------------------
    Run($sSrcPath)
    ; ---------------------
    WinWait($hSAWSTUDIO_MAIN)
    ; ---------------------
    MouseMove(959, 576, 0)
    ; ---------------------
    Sleep($iExtTimeOut)
EndFunc   ;==>LaunchSAWWSF
; -----------------------------------------------
Func PSAW()
    SelectStartF1ViewSAW()
    UpdateWorkspaceSAW()
    StoreF1ViewsSAW()
    StoreAltF1ViewsSAW()
    SelectEndF1ViewSAW()
    FileMenuSAW()
EndFunc   ;==>PSAW
; -----------------------------------------------
Func SelectStartF1ViewSAW()
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; Select F1 View
    Send("{F1}")
EndFunc   ;==>SelectStartF1ViewSAW
; -----------------------------------------------
Func UpdateWorkspaceSAW()
    MaximizeWorkspaceSAW()
    RemoveF1ViewsSAW()
EndFunc   ;==>UpdateWorkspaceSAW
; -----------------------------------------------
Func MaximizeWorkspaceSAW()
    WinActivate($hSAWSTUDIO_MAIN)
    ; ---------------------
    ; Title Bar > Maximize
    WinActivate($hSAWSTUDIO_MAIN)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 1869, 32, 1, 0)
EndFunc   ;==>MaximizeWorkspaceSAW
; -----------------------------------------------
Func RemoveF1ViewsSAW()
    Opt("MouseCoordMode", 1)
    ; -----------------------------------------------
    ; Remove all SAW F1 views
    WinActivate("[CLASS:SAWSTUDIO_ZOOMMIXER]")
    WinClose("[CLASS:SAWSTUDIO_ZOOMMIXER]")
    ; ---------------------
    WinActivate("[CLASS:SAWSTUDIO_MULTITRACK]")
    WinClose("[CLASS:SAWSTUDIO_MULTITRACK]")
    ; ---------------------
    WinActivate("[CLASS:SAWSTUDIO_SOUNDFILE]")
    WinClose("[CLASS:SAWSTUDIO_SOUNDFILE]")
    ; ---------------------
    WinActivate("[CLASS:SAWSTUDIO_REGIONS]")
    WinClose("[CLASS:SAWSTUDIO_REGIONS]")
    ; ---------------------
    WinActivate("[CLASS:SAWSTUDIO_LIBRARY]")
    WinClose("[CLASS:SAWSTUDIO_LIBRARY]")
    MouseClick($MOUSE_CLICK_LEFT, 645, 819, 1, 0)
    ; ---------------------
    WinActivate("[CLASS:SAWSTUDIO_AUTOGALLERY]")
    WinClose("[CLASS:SAWSTUDIO_AUTOGALLERY]")
    ; ---------------------
    WinActivate("[CLASS:SAWSTUDIO_CTRLTRACK]")
    WinClose("[CLASS:SAWSTUDIO_CTRLTRACK]")
    ; ---------------------
    WinActivate("[CLASS:SAWSTUDIO_FULLMIXER]")
    WinClose("[CLASS:SAWSTUDIO_FULLMIXER]")
EndFunc   ;==>RemoveF1ViewsSAW
; -----------------------------------------------
Func StoreF1ViewsSAW()
    StoreF1MessageSAW()
    CallF1ViewsSAW()
EndFunc   ;==>StoreF1ViewsSAW
; -----------------------------------------------
Func StoreF1MessageSAW()
    Local $sMsg = "The storing of the SAW Shift+F1 to Shift+F12 F-Key Views will now commence..."
    ; -----------------------------------------------
    _ExtMsgBoxSet(64, 4, Default, Default, 16, "Corbel Bold", $iEMBWidth)
    _ExtMsgBox(0, " ", " Notice!", $sMsg, $iMsgDelay)
EndFunc   ;==>StoreF1MessageSAW
; -----------------------------------------------
Func CallF1ViewsSAW()
    Opt("MouseCoordMode", 1)
    ; -----------------------------------------------
    ; Store F1 Views
    StoreShiftF1ViewSAW()
    StoreShiftF2ViewSAW()
    StoreShiftF3ViewSAW()
    StoreShiftF4ViewSAW()
    StoreShiftF5ViewSAW()
    StoreShiftF6ViewSAW()
    StoreShiftF7ViewSAW()
    StoreShiftF8ViewSAW()
    StoreShiftF9ViewSAW()
    StoreShiftF10ViewSAW()
    StoreShiftF11ViewSAW()
    StoreShiftF12ViewSAW()
EndFunc   ;==>CallF1ViewsSAW
; -----------------------------------------------
Func StoreShiftF1ViewSAW()
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; Select Shift+F1
    Sleep($iTimeOut)
    Send("+{F1}")
EndFunc   ;==>StoreShiftF1ViewSAW
; -----------------------------------------------
Func StoreShiftF2ViewSAW()
    Sleep($iTimeOut)
    Send("+{F2}")    ; Select Shift+F2
EndFunc   ;==>StoreShiftF2ViewSAW
; -----------------------------------------------
Func StoreShiftF3ViewSAW()
    Sleep($iTimeOut)
    Send("+{F3}")    ; Select Shift+F3
EndFunc   ;==>StoreShiftF3ViewSAW
; -----------------------------------------------
Func StoreShiftF4ViewSAW()
    Sleep($iTimeOut)
    Send("+{F4}")    ; Select Shift+F4
EndFunc   ;==>StoreShiftF4ViewSAW
; -----------------------------------------------
Func StoreShiftF5ViewSAW()
    Sleep($iTimeOut)
    Send("+{F5}")    ; Select Shift+F5
EndFunc   ;==>StoreShiftF5ViewSAW
; -----------------------------------------------
Func StoreShiftF6ViewSAW()
    Sleep($iTimeOut)
    Send("+{F6}")    ; Select Shift+F6
EndFunc   ;==>StoreShiftF6ViewSAW
; -----------------------------------------------
Func StoreShiftF7ViewSAW()
    Sleep($iTimeOut)
    Send("+{F7}")    ; Select Shift+F7
EndFunc   ;==>StoreShiftF7ViewSAW
; -----------------------------------------------
Func StoreShiftF8ViewSAW()
    Sleep($iTimeOut)
    Send("+{F8}")    ; Select Shift+F8
EndFunc   ;==>StoreShiftF8ViewSAW
; -----------------------------------------------
Func StoreShiftF9ViewSAW()
    Sleep($iTimeOut)
    Send("+{F9}")    ; Select Shift+F9
EndFunc   ;==>StoreShiftF9ViewSAW
; -----------------------------------------------
Func StoreShiftF10ViewSAW()
    Sleep($iTimeOut)
    Send("+{F10}")    ; Select Shift+F10
EndFunc   ;==>StoreShiftF10ViewSAW
; -----------------------------------------------
Func StoreShiftF11ViewSAW()
    Sleep($iTimeOut)
    Send("+{F11}")    ; Select Shift+F11
EndFunc   ;==>StoreShiftF11ViewSAW
; -----------------------------------------------
Func StoreShiftF12ViewSAW()
    Sleep($iTimeOut)
    Send("+{F12}")    ; Select Shift+F12
EndFunc   ;==>StoreShiftF12ViewSAW
; -----------------------------------------------
Func StoreAltF1ViewsSAW()
    StoreAltF1MessageSAW()
    CallAltF1ViewsSAW()
EndFunc   ;==>StoreAltF1ViewsSAW
; -----------------------------------------------
Func StoreAltF1MessageSAW()
    Local $sMsg = "The storing of the SAW Alt+Shift+F1 to Alt+Shift+F12 F-Key Views will now commence..."
    ; -----------------------------------------------
    _ExtMsgBoxSet(64, 4, Default, Default, 16, "Corbel Bold", $iEMBWidth)
    _ExtMsgBox(0, " ", " Notice!", $sMsg, $iMsgDelay)
EndFunc   ;==>StoreAltF1MessageSAW
; -----------------------------------------------
Func CallAltF1ViewsSAW()
    Opt("MouseCoordMode", 1)
    ; -----------------------------------------------
    ; Store Alt+F1 Views
    StoreAltShiftF1ViewSAW()
    StoreAltShiftF2ViewSAW()
    StoreAltShiftF3ViewSAW()
    StoreAltShiftF4ViewSAW()
    StoreAltShiftF5ViewSAW()
    StoreAltShiftF6ViewSAW()
    StoreAltShiftF7ViewSAW()
    StoreAltShiftF8ViewSAW()
    StoreAltShiftF9ViewSAW()
    StoreAltShiftF10ViewSAW()
    StoreAltShiftF11ViewSAW()
    StoreAltShiftF12ViewSAW()
EndFunc   ;==>CallAltF1ViewsSAW
; -----------------------------------------------
Func StoreAltShiftF1ViewSAW()
    WinActivate($hSAWSTUDIO_MAIN) ; FOR TESTING ONLY!!
    ; -----------------------------------------------
    Sleep($iTimeOut)
    Send("!+{F1}")    ; Select Alt+Shift+F1
EndFunc   ;==>StoreAltShiftF1ViewSAW
; -----------------------------------------------
Func StoreAltShiftF2ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F2}")    ; Select Alt+Shift+F2
EndFunc   ;==>StoreAltShiftF2ViewSAW
; -----------------------------------------------
Func StoreAltShiftF3ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F3}")    ; Select Alt+Shift+F3
EndFunc   ;==>StoreAltShiftF3ViewSAW
; -----------------------------------------------
Func StoreAltShiftF4ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F4}")    ; Select Alt+Shift+F4
EndFunc   ;==>StoreAltShiftF4ViewSAW
; -----------------------------------------------
Func StoreAltShiftF5ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F5}") ; Select Alt+Shift+F5
EndFunc   ;==>StoreAltShiftF5ViewSAW
; -----------------------------------------------
Func StoreAltShiftF6ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F6}")    ; Select Alt+Shift+F6
EndFunc   ;==>StoreAltShiftF6ViewSAW
; -----------------------------------------------
Func StoreAltShiftF7ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F7}")    ; Select Alt+Shift+F7
EndFunc   ;==>StoreAltShiftF7ViewSAW
; -----------------------------------------------
Func StoreAltShiftF8ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F8}")    ; Select Alt+Shift+F8
EndFunc   ;==>StoreAltShiftF8ViewSAW
; -----------------------------------------------
Func StoreAltShiftF9ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F9}")    ; Select Alt+Shift+F9
EndFunc   ;==>StoreAltShiftF9ViewSAW
; -----------------------------------------------
Func StoreAltShiftF10ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F10}")    ; Select Alt+Shift+F10
EndFunc   ;==>StoreAltShiftF10ViewSAW
; -----------------------------------------------
Func StoreAltShiftF11ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F11}")    ; Select Alt+Shift+F11
EndFunc   ;==>StoreAltShiftF11ViewSAW
; -----------------------------------------------
Func StoreAltShiftF12ViewSAW()
    Sleep($iTimeOut)
    Send("!+{F12}")    ; Select Alt+Shift+F12
EndFunc   ;==>StoreAltShiftF12ViewSAW
; -----------------------------------------------
Func SelectEndF1ViewSAW()
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; Select F1 View
    Send("{F1}")
EndFunc   ;==>SelectEndF1ViewSAW
; -----------------------------------------------
Func FileMenuSAW()
    Opt("MouseCoordMode", 0)
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; F-Key File > Save > 1_SAW_Empty.fky
    WinMenuSelectItem($hSAWSTUDIO_MAIN, "", "&File", "F-Key File", "Save")
    ControlSetText("Save F-Key File", "", "[CLASS:Edit; INSTANCE:1]", "G:\F-Key_Data\1_SAW_Empty.fky")
    ControlClick("Save F-Key File", "", "&Save")
    Send("y")
    ; ---------------------
    ; F-Key File > Save > 1_SAW_Empty.fky
    WinMenuSelectItem($hSAWSTUDIO_MAIN, "", "&File", "F-Key File", "Save Alternate")
    ControlSetText("Save F-Key File", "", "[CLASS:Edit; INSTANCE:1]", "G:\F-Key_Data\2_SAW_Alt_Empty.fky")
    ControlClick("Save F-Key File", "", "&Save")
    Send("y")
    ; ---------------------
    ; Save Default > NOTICE! > Ok
    WinMenuSelectItem($hSAWSTUDIO_MAIN, "", "&File", "F-Key File", "Save Default")
    ControlSend("[CLASS:SAWSTUDIO_MESSAGE]", "", "", "{ENTER}")
    ; ---------------------
    ; Save And Update Session {Ctrl+S}
    WinMenuSelectItem($hSAWSTUDIO_MAIN, "", "&File", "&Save And Update Session")
    ; ---------------------
    Sleep($iExtTimeOut)
EndFunc   ;==>FileMenuSAW
; -----------------------------------------------
Func SelectSACLink()
    WinActivate($hSAWSTUDIO_MAIN)
    ; -----------------------------------------------
    ; Select: [SAC - Link]
    Send("{ALTDOWN}+{ALTUP}+{ENTER}")
    ; -----------------------------------------------
    WinActivate($hSAC_MAIN)
EndFunc   ;==>SelectSACLink
; -----------------------------------------------
Func PSAC()
    SelectStartF1ViewSAC()
    UpdateWorkspaceSAC()
    StoreF1ViewsSAC()
    StoreAltF1ViewsSAC()
    SelectEndF1ViewSAC()
    FileMenuSAC()
EndFunc   ;==>PSAC
; -----------------------------------------------
Func SelectStartF1ViewSAC()
    WinActivate($hSAC_MAIN)
    ; -----------------------------------------------
    ; Select F1 View
    Send("{F1}")
EndFunc   ;==>SelectStartF1ViewSAC
; -----------------------------------------------
Func UpdateWorkspaceSAC()
    MaximizeWorkspaceSAC()
    RemoveF1ViewsSAC()
EndFunc   ;==>UpdateWorkspaceSAC
; -----------------------------------------------
Func MaximizeWorkspaceSAC()
    WinActivate($hSAC_MAIN)
    ; ---------------------
    ; Title Bar > Maximize
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 1869, 32, 1, 0)
EndFunc   ;==>MaximizeWorkspaceSAC
; -----------------------------------------------
Func RemoveF1ViewsSAC()
    Opt("MouseCoordMode", 1)
    ; -----------------------------------------------
    ; Remove all SAC F1 views
    WinActivate("[CLASS:SAC_ZOOMMIXER]")
    WinClose("[CLASS:SAC_ZOOMMIXER]")
    ; ---------------------
    WinActivate("[CLASS:SAC_SCENES]")
    WinClose("[CLASS:SAC_SCENES]")
    ; ---------------------
    WinActivate("[CLASS:SAC_FULLMIXER]")
    WinClose("[CLASS:SAC_FULLMIXER]")
EndFunc   ;==>RemoveF1ViewsSAC
; -----------------------------------------------
Func StoreF1ViewsSAC()
    StoreF1MessageSAC()
    CallF1ViewsSAC()
EndFunc   ;==>StoreF1ViewsSAC
; -----------------------------------------------
Func StoreF1MessageSAC()
    Local $sMsg = "The storing of the SAC Shift+F1 to Shift+F12 F-Key Views will now commence..."
    ; -----------------------------------------------
    _ExtMsgBoxSet(64, 4, Default, Default, 16, "Corbel Bold", $iEMBWidth)
    _ExtMsgBox(0, " ", " Notice!", $sMsg, $iMsgDelay)
EndFunc   ;==>StoreF1MessageSAC
; -----------------------------------------------
Func CallF1ViewsSAC()
    Opt("MouseCoordMode", 1)
    ; -----------------------------------------------
    ; Store F1 Views
    StoreShiftF1ViewSAC()
    StoreShiftF2ViewSAC()
    StoreShiftF3ViewSAC()
    StoreShiftF4ViewSAC()
    StoreShiftF5ViewSAC()
    StoreShiftF6ViewSAC()
    StoreShiftF7ViewSAC()
    StoreShiftF8ViewSAC()
    StoreShiftF9ViewSAC()
    StoreShiftF10ViewSAC()
    StoreShiftF11ViewSAC()
    StoreShiftF12ViewSAC()
EndFunc   ;==>CallF1ViewsSAC
; -----------------------------------------------
Func StoreShiftF1ViewSAC()
    WinActivate($hSAC_MAIN)
    ; -----------------------------------------------
    ; Select Shift+F1
    Sleep($iTimeOut)
    Send("+{F1}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF1ViewSAC
; -----------------------------------------------
Func StoreShiftF2ViewSAC()
    ; Select Shift+F2
    Sleep($iTimeOut)
    Send("+{F2}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF2ViewSAC
; -----------------------------------------------
Func StoreShiftF3ViewSAC()
    ; Select Shift+F3
    Sleep($iTimeOut)
    Send("+{F3}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF3ViewSAC
; -----------------------------------------------
Func StoreShiftF4ViewSAC()
    Sleep($iTimeOut)
    ; Select Shift+F4
    Send("+{F4}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF4ViewSAC
; -----------------------------------------------
Func StoreShiftF5ViewSAC()
    ; Select Shift+F5
    Sleep($iTimeOut)
    Send("+{F5}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF5ViewSAC
; -----------------------------------------------
Func StoreShiftF6ViewSAC()
    Sleep($iTimeOut)
    Send("+{F6}") ; Select Shift+F6
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF6ViewSAC
; -----------------------------------------------
Func StoreShiftF7ViewSAC()
    ; Select Shift+F7
    Sleep($iTimeOut)
    Send("+{F7}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF7ViewSAC
; -----------------------------------------------
Func StoreShiftF8ViewSAC()
    ; Select Shift+F8
    Sleep($iTimeOut)
    Send("+{F8}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF8ViewSAC
; -----------------------------------------------
Func StoreShiftF9ViewSAC()
    ; Select Shift+F9
    Sleep($iTimeOut)
    Send("+{F9}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF9ViewSAC
; -----------------------------------------------
Func StoreShiftF10ViewSAC()
    ; Select Shift+F10
    Sleep($iTimeOut)
    Send("+{F10}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF10ViewSAC
; -----------------------------------------------
Func StoreShiftF11ViewSAC()
    ; Select Shift+F11
    Sleep($iTimeOut)
    Send("+{F11}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF11ViewSAC
; -----------------------------------------------
Func StoreShiftF12ViewSAC()
    ; Select Shift+F12
    Sleep($iTimeOut)
    Send("+{F12}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreShiftF12ViewSAC
; -----------------------------------------------
Func StoreAltF1ViewsSAC()
    StoreAltF1MessageSAC()
    CallAltF1ViewsSAC()
EndFunc   ;==>StoreAltF1ViewsSAC
; -----------------------------------------------
Func StoreAltF1MessageSAC()
    Local $sMsg = "The storing of the SAC Alt+Shift+F1 to Alt+Shift+F12 F-Key Views will now commence..."
    ; -----------------------------------------------
    _ExtMsgBoxSet(64, 4, Default, Default, 16, "Corbel Bold", $iEMBWidth)
    _ExtMsgBox(0, " ", " Notice!", $sMsg, $iMsgDelay)
EndFunc   ;==>StoreAltF1MessageSAC
; -----------------------------------------------
Func CallAltF1ViewsSAC()
    AutoItSetOption("MouseCoordMode", 1)
    ; -----------------------------------------------
    ; Store Alt+F1 Views
    StoreAltShiftF1ViewSAC()
    StoreAltShiftF2ViewSAC()
    StoreAltShiftF3ViewSAC()
    StoreAltShiftF4ViewSAC()
    StoreAltShiftF5ViewSAC()
    StoreAltShiftF6ViewSAC()
    StoreAltShiftF7ViewSAC()
    StoreAltShiftF8ViewSAC()
    StoreAltShiftF9ViewSAC()
    StoreAltShiftF10ViewSAC()
    StoreAltShiftF11ViewSAC()
    StoreAltShiftF12ViewSAC()
EndFunc   ;==>CallAltF1ViewsSAC
; -----------------------------------------------
Func StoreAltShiftF1ViewSAC()
    WinActivate($hSAC_MAIN)
    ; -----------------------------------------------
    ; Select Alt+Shift+F1
    Sleep($iTimeOut)
    Send("!+{F1}")
    ; F-Key Properties dialog
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF1ViewSAC
; -----------------------------------------------
Func StoreAltShiftF2ViewSAC()
    ; Select Alt+Shift+F2
    Sleep($iTimeOut)
    Send("!+{F2}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF2ViewSAC
; -----------------------------------------------
Func StoreAltShiftF3ViewSAC()
    ; Select Alt+Shift+F3
    Sleep($iTimeOut)
    Send("!+{F3}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF3ViewSAC
; -----------------------------------------------
Func StoreAltShiftF4ViewSAC()
    ; Select Alt+Shift+F4
    Sleep($iTimeOut)
    Send("!+{F4}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF4ViewSAC
; -----------------------------------------------
Func StoreAltShiftF5ViewSAC()
    ; Select Alt+Shift+F5
    Sleep($iTimeOut)
    Send("!+{F5}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF5ViewSAC
; -----------------------------------------------
Func StoreAltShiftF6ViewSAC()
    ; Select Alt+Shift+F6
    Sleep($iTimeOut)
    Send("!+{F6}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF6ViewSAC
; -----------------------------------------------
Func StoreAltShiftF7ViewSAC()
    ; Select Alt+Shift+F7
    Sleep($iTimeOut)
    Send("!+{F7}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF7ViewSAC
; -----------------------------------------------
Func StoreAltShiftF8ViewSAC()
    ; Select Alt+Shift+F8
    Sleep($iTimeOut)
    Send("!+{F8}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF8ViewSAC
; -----------------------------------------------
Func StoreAltShiftF9ViewSAC()
    ; Select Alt+Shift+F9
    Sleep($iTimeOut)
    Send("!+{F9}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF9ViewSAC
; -----------------------------------------------
Func StoreAltShiftF10ViewSAC()
    ; Select Alt+Shift+F10
    Sleep($iTimeOut)
    Send("!+{F10}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF10ViewSAC
; -----------------------------------------------
Func StoreAltShiftF11ViewSAC()
    ; Select Alt+Shift+F11
    Sleep($iTimeOut)
    Send("!+{F11}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF11ViewSAC
; -----------------------------------------------
Func StoreAltShiftF12ViewSAC()
    ; Select Alt+Shift+F12
    Sleep($iTimeOut)
    Send("!+{F12}")
    ; Position the view
    WinMove($hSAC_FKEYPROPERTIES, "", 382, 350)
    ; F-Key Properties dialog
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 500, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 416, 450, 1, 0)
    Sleep($iTimeOut)
    MouseClick($MOUSE_CLICK_LEFT, 430, 392, 1, 0)
EndFunc   ;==>StoreAltShiftF12ViewSAC
; -----------------------------------------------
Func SelectEndF1ViewSAC()
    WinActivate($hSAC_MAIN)
    ; -----------------------------------------------
    ; Select F1 View
    Send("{F1}")
EndFunc   ;==>SelectEndF1ViewSAC
; -----------------------------------------------
Func FileMenuSAC()
    Opt("MouseCoordMode", 0)
    WinActivate($hSAC_MAIN)
    ; -----------------------------------------------
    ; F-Key File > Save > 3_SAC_Empty.fky
    WinMenuSelectItem($hSAC_MAIN, "", "&File", "F-Key File", "Save")
    ControlSetText("Save F-Key File", "", "[CLASS:Edit; INSTANCE:1]", "G:\F-Key_Data\3_SAC_Empty.fky")
    ControlClick("Save F-Key File", "", "&Save")
    Send("y")
    ; ---------------------
    ; F-Key File > Save Alternate > 4_SAC_Alt_Empty.fky
    WinMenuSelectItem($hSAC_MAIN, "", "&File", "F-Key File", "Save Alternate")
    ControlSetText("Save F-Key File", "", "[CLASS:Edit; INSTANCE:1]", "G:\F-Key_Data\4_SAC_Alt_Empty.fky")
    ControlClick("Save F-Key File", "", "&Save")
    Send("y")
    ; ---------------------
    ; Save Default > NOTICE! > Ok
    WinMenuSelectItem($hSAC_MAIN, "", "&File", "F-Key File", "Save Default")
    ControlSend("[CLASS:SAC_MESSAGE]", "", "", "{ENTER}")
    ; ---------------------
    ; Save And Update Mix Session {Ctrl+S}
    WinMenuSelectItem($hSAC_MAIN, "", "&File", "&Save And Update Mix Session")
    ; ---------------------
    Sleep($iExtTimeOut)
EndFunc   ;==>FileMenuSAC
; -----------------------------------------------
Func ExitBoth()
    ExitSAC()
    ExitSAW()
EndFunc   ;==>ExitBoth
; -----------------------------------------------
Func ExitSAC()
    WinActivate($hSAC_MAIN)
    WinMenuSelectItem($hSAC_MAIN, "", "&File", "E&xit")
    Send("{n}")
    ; -----------------------------------------------
    Sleep($iExtTimeOut)
EndFunc   ;==>ExitSAC
; -----------------------------------------------
Func ExitSAW()
    WinActivate($hSAWSTUDIO_MAIN)
    WinMenuSelectItem($hSAWSTUDIO_MAIN, "", "&File", "E&xit")
    Send("{n}")
    ; -----------------------------------------------
    Sleep($iExtTimeOut)
EndFunc   ;==>ExitSAW
; -----------------------------------------------

 

Edited by mr-es335
Posted

Hello!

Anyone care to comment on the above.

I am still in the "testing phases" - and am attempting to discover the best practices for the implementation of MouseCoordMode!

Any assistance, comments and|or suggestions...would be greatly appreciated!

 

Posted

Hello,

How is this snippet?

#cs
Opt("MouseCoordMode", 0)
MouseMove(27, 54, 0)    ; Preferred

Opt("MouseCoordMode", 1)
MouseMove(24, 52, 0)    ; Preferred

Opt("MouseCoordMode", 2)
MouseMove(24, 32, 0)    ; Preferred
#ce
; -----------------------------------------------
Opt("MustDeclareVars", 1)
Opt("MouseCoordMode", 1)
; -----------------------------------------------
Global $hSAC_MAIN = "[CLASS:SAC_MAIN]"
; -----------------------------------------------
MouseMoveTest()
; -----------------------------------------------
Func MouseMoveTest()
    WinActivate($hSAC_MAIN)
    ; -----------------------------------------------
    Local $currentMode = Opt("MouseCoordMode")
    ; -----------------------------------------------
    If $currentMode = 0 Then
        MouseMove(27, 54, 0)
    ElseIf $currentMode = 1 Then
        MouseMove(24, 52, 0)
    ElseIf $currentMode = 2 Then
        MouseMove(24, 32, 0)
    EndIf
    ConsoleWrite("Current MouseCoordMode: " & $currentMode & @CRLF)
EndFunc   ;==>MouseMoveTest
; -----------------------------------------------

 

Posted (edited)

Hello,

How is this?

; -----------------------------------------------
Opt("MustDeclareVars", 1)
Opt("MouseCoordMode", 0)
; -----------------------------------------------
Global $hSAC_MAIN = "[CLASS:SAC_MAIN]"
; -----------------------------------------------
IfMode()
; -----------------------------------------------
Func IfMode()
    WinActivate($hSAC_MAIN)
    ; -----------------------------------------------
    Local $iCurrentMode = Opt("MouseCoordMode")
    ; -----------------------------------------------
    ConsoleWrite("Current MouseCoordMode: " & $iCurrentMode & @CRLF)
    ; -----------------------------------------------
    ; If MouseCoordMode is not "1", reset to "1", then call the function
    If $iCurrentMode <> 1 Then
        Opt("MouseCoordMode", 1)
        ; Insert function name
        OK()
    ; If MouseCoordMode is "1", then call the function
    ElseIf $iCurrentMode = 1 Then
        ; Insert function name
        OK()
    EndIf
EndFunc   ;==>IfMode
; -----------------------------------------------
Func OK()
    Local $iCurrentMode = Opt("MouseCoordMode")
    ; -----------------------------------------------
    ConsoleWrite("Current OK MouseCoordMode: " & $iCurrentMode & @CRLF)
EndFunc   ;==>OK
; -----------------------------------------------

 

Edited by mr-es335
Posted

...ore even better...{Came across this by accident..."

; -----------------------------------------------
Opt("MustDeclareVars", 1)
Opt("MouseCoordMode", 1)
; -----------------------------------------------
Global $hSAWSTUDIO_MAIN = "[CLASS:SAWSTUDIO_MAIN]"
Global $hSAC_MAIN = "[CLASS:SAC_MAIN]"
; -----------------------------------------------
ConfirmMode()
; -----------------------------------------------
Func ConfirmMode()
    ; -----------------------------------------------
    Local $iCurrentMode = Opt("MouseCoordMode")
    ConsoleWrite("ConfirmMode " & $iCurrentMode & @CRLF)
    ; -----------------------------------------------
    If $iCurrentMode <> 1 Then
        Opt("MouseCoordMode", 1)
        WinActivate($hSAC_MAIN)
        ConsoleWrite("No " & $iCurrentMode & @CRLF)
    Else
        WinActivate($hSAC_MAIN)
        ConsoleWrite("Yes " & $iCurrentMode & @CRLF)
    EndIf
EndFunc   ;==>ConfirmMode
; -----------------------------------------------

 

Posted

I can't say I have a lot of experience, so not much to offer, but in my opinion:

Assuming Mouse Coord mode 1 is what most of your functions need (I think that's what you meant in point 2), I would set and reset the mode in the function that needs it otherwise than 1. Since you don't return early in any of your functions this should work best to keep things simple, and straight.

As for your tests (if needed, if you were to re-set coord mode to 1 in each function, it may not be?), this last looks best. In your example you activate the same windows in both cases, if this is what you need done each time, you could simplify it down more,

If $iCurrentMode <> 1 Then
        Opt("MouseCoordMode", 1)
        ConsoleWrite("No " & $iCurrentMode & @CRLF)
EndIf
    
WinActivate($hSAC_MAIN)

 

LibreOffice UDF  

Scite4AutoIt Spell-Checker Using LibreOffice

WPS Office adapter — Use MS Word UDFs with WPS Office!

LibreOffice API Inspector tools

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

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
×
×
  • Create New...