Jump to content

Recommended Posts

Posted (edited)

Good day,

Many times I thought that I was "Done!"..only to discover later, that I am "Not Done!"

I have two scripts:
1) CombinedF12
2) CombinedF10

I have been attempting [...unsuccessfully...] in combining "CombinedF10" WITH CombinedF12 into one single script!
• Each script is working as it should as independent scripts, but the combination of the two is not!

Here are the two scripts:

Spoiler
; https://www.autoitscript.com/forum/topic/213269-script-critique-enablehotkey/#findComment-1546695
; From ioa747
; Last completed: 9:01 AM 10/20/2025
; -----------------------------------------------------------
#RequireAdmin
; -----------------------------------------------------------
#include <AutoItConstants.au3>
#include <ButtonConstants.au3>
#include "ExtMsgBox.au3"
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
; -----------------------------------------------------------
Opt("GUIOnEventMode", 1)
Opt("MustDeclareVars", 1)
; -----------------------------------------------------------
Global $Form1, $mForm1Button
Global $iWidth = 735, $iHeight = 48, $ixpos = -1, $iypos = -1, $iOpt = 1, $sFontName = "Corbel Bold", $iFontSize = 16, $iFontWt = 800
; -----------------------------------------------------------
Forms()
; -----------------------------------------------
Func Forms()
    $iFontSize = 14
    $Form1 = GUICreate("EnableHotKey", 150, 25, 725, 86, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseForm")
    ; ---------------------
    $mForm1Button = GUICtrlCreateButton(" Enable Hotkey", 0, 0, 150, 25)
    GUICtrlSetOnEvent($mForm1Button, "_ColRow")
    ; -----------------------------------------------
    GUISetState(@SW_SHOW, $Form1)
    ; -----------------------------------------------
    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>Forms
; -----------------------------------------------
Func _ColRow()
    Switch @GUI_CtrlId
        Case $mForm1Button
            _ToggleNUMPADSUB()
    EndSwitch
EndFunc   ;==>_ColRow
; -----------------------------------------------
Func _CloseForm()
    Switch @GUI_WinHandle
        Case $Form1
            Exit
    EndSwitch
EndFunc   ;==>_CloseForm
; -----------------------------------------------
Func _ToggleNUMPADSUB()
    Local Static $bEnabled = True
    Local $aGuiPos = WinGetPos($Form1)
    If $bEnabled Then
        HotKeySet("{NUMPADSUB}", "ReadIniFile")
        GUICtrlSetData($mForm1Button, "Disable Hotkey")
    Else
        WinClose($Form1)
    EndIf
    $bEnabled = Not $bEnabled
EndFunc   ;==>_ToggleNUMPADSUB
; -----------------------------------------------
Func ReadIniFile()
    ; The ReadIniFile procedure is launched.
    ; Upon selecting [Continue], the first line of the .ini file is read and then copied to the clipboard.
    ; -----------------------------------------------
    Local $sFilePath = "E:\Desktop\Working\Assets\IniData\SceneData.ini"
    Local $aArray = IniReadSection($sFilePath, "Scene Data")
    ; -----------------------------------------------
    Opt("GUIOnEventMode", 0) ; when in $hMsgForm - disable <<<<<<<<<<<<<<<
;~  Local $hMsgForm = GUICreate("ReadIniFile", 390, 90, 725, 115, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    Local $hMsgForm = GUICreate("ReadIniFile", 390, 90, 725, 115, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
;~  ; -----------------------------------------------
    Local $idLabel1 = GUICtrlCreateLabel("", 5, 5, 379, 45, $SS_SUNKEN)
    ; ---------------------
    Local $idBtnContinue = GUICtrlCreateButton("Continue", 100, 55, 85, 25, $BS_DEFPUSHBUTTON)
    Local $idBtnCancel = GUICtrlCreateButton("Cancel", 200, 55, 85, 25)
    Local $idBtnAbout = GUICtrlCreateLabel("!", 360, 55, 10, 20)
    ; -----------------------------------------------
    GUISetState(@SW_SHOW, $hMsgForm)
    ; -----------------------------------------------
    Local $nMsg, $idx = 1
    GUICtrlSetData($idLabel1, "To copy [" & $aArray[$idx][1] & "]...select [Continue]..." & @CRLF & "Select [Cancel] to exit...")
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $idBtnCancel
                ExitLoop
            Case $idBtnContinue
                ClipPut($aArray[$idx][1])
                UpdateScenes()
                ; ---------------------
                $idx += 1
                If $idx > $aArray[0][0] Then
                    ExitLoop ; The end of the SceneData.ini data file has been reached!
                EndIf
                GUICtrlSetData($idLabel1, "To copy [" & $aArray[$idx][1] & "]...select [Continue]..." & @CRLF & "Select [Cancel] to exit...")
                ; -----------------------------------------------
            Case $idBtnAbout
                AboutMe()
        EndSwitch
    WEnd
    ; -----------------------------------------------
    GUIDelete($hMsgForm)
    ; -----------------------------------------------
    Opt("GUIOnEventMode", 1) ; when out of $hMsgForm - enable <<<<<<<<<<<<<<<
EndFunc   ;==>ReadIniFile
; -----------------------------------------------
Func UpdateScenes()
    Local $hWnd = "[CLASS:SAC_SCENEPROPERTIES]"
    ; -----------------------------------------------
    ; F Mixer Number Zone[s] is|are [manually] selected
    ; -----------------------------------------------
    WinActivate("[CLASS:SAC_SCENES]", "")
    MouseClick($MOUSE_CLICK_LEFT, 254, 313, 1, 1) ; The Scenes View is selected, x y clicks speed
    Sleep(100)
    MouseClick($MOUSE_CLICK_LEFT, 133, 165, 2, 1) ; The first line of Scenes View is selected. <<[A]>>
    Sleep(100)
    Send("{End}") ; The [End Of List] is selected via the [End] key.
    MouseClick($MOUSE_CLICK_LEFT, 188, 118, 1, 1) ; The [New] button is selected.
    Sleep(100)
    Send("^v") ; The previously copied text from the ReadIniFile procedure is then pasted into the [Enter Scene Name...] dialog.
    Send("{ENTER}") ; [Enter] is selected, for [Ok] - with the [Enter Scene Name...] dialog being summarily exited.
    ; -----------------------------------------------
    Sleep(100)
    WinMove($hWnd, "", 725, 210) ; The Scene Properties window is displayed and is then moved.
    ; -----------------------------------------------
    Sleep(100)
    MouseMove(1300, 295, 0) ; The mouse is moved to the Scene Properties window.
    ; -----------------------------------------------
    ; The Scene Properties are [manually] selected.
    ; [OK] is [manually] selected.
    ; The [Start] scene is [manually] selected. BEING TESTED, SEE [A] ABOVE!!!!
EndFunc   ;==>UpdateScenes
; -----------------------------------------------
Func AboutMe()
    Local $sMsg
    ; -----------------------------------------------
    _ExtMsgBoxSet(64, 4, Default, Default, 14, "Corbel Bold")
    $sMsg = "Enable Hotkey Script" & @CRLF & @CRLF
    $sMsg &= "Version 3.3b" & @CRLF & @CRLF
    $sMsg &= "Scripting by Dell Krauchi" & @CRLF
    $sMsg &= "Sentinel Music Studios" & @CRLF & @CRLF
    $sMsg &= "With the sincerest gratitude of ioa747...whose assistance in this project has been incalculable!" & @CRLF & @CRLF
    $sMsg &= "This script was developed specifically for implementation with the Live_Rig." & @CRLF & @CRLF
    $sMsg &= "Last updated: October 20th, 2025" & @CRLF
;~  $sMsg &= "" & @CRLF & @CRLF
    ; -----------------------------------------------
    _ExtMsgBox(64, "Ok", "About!", $sMsg, 0)
EndFunc   ;==>AboutMe
; -----------------------------------------------

 

Spoiler
; -----------------------------------------------
#RequireAdmin
; -----------------------------------------------
#include <AutoItConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
; -----------------------------------------------
Opt("GUIOnEventMode", 1)
Opt("MustDeclareVars", 1)
; -----------------------------------------------
Global $Form1, $mForm1Button, $mForm1Button2
Global $Form2, $mForm2Button
Global $Form3, $mForm3Button
Global $iWidth = 735, $iHeight = 48, $ixpos = -1, $iypos = -1, $iOpt = 1, $sFontName = "Corbel Bold", $iFontSize = 16, $iFontWt = 800
; -----------------------------------------------
Forms()
; -----------------------------------------------
Func Forms()
    $iFontSize = 14
    ; -----------------
;~  $Form1 = GUICreate("EnableF10", 150, 25, 900, 86, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    $Form1 = GUICreate("EnableF10", 150, 25, 900, 86, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseForm")
    ; -----------------
    $mForm1Button = GUICtrlCreateButton(" Enable [F10]", 0, 0, 150, 25)
    GUICtrlSetOnEvent($mForm1Button, "_ColRow")
    ; -----------------------------------------------
    $Form2 = GUICreate("Form 2", 150, 25, 900, 86, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
;~  ; -----------------
    $mForm2Button = GUICtrlCreateButton(" Enable [F12]", 0, 0, 150, 25)
    GUICtrlSetOnEvent($mForm2Button, "_ColRow")
    ; -----------------------------------------------
    GUISetState(@SW_SHOW, $Form1)
    ; -----------------------------------------------
    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>Forms
; -----------------------------------------------
Func _ColRow()
    ConsoleWrite("@GUI_CtrlId=" & @GUI_CtrlId & @CRLF)
    Switch @GUI_CtrlId
        Case $mForm1Button
            GUISetState(@SW_HIDE, $Form1)   ; From "EnableF10"...
            GUISetState(@SW_SHOW, $Form2)   ; ...to EnableF12"
            EnableF10View()
        Case $mForm2Button
            GUISetState(@SW_HIDE, $Form2)
            EnableF12View()
            Exit
    EndSwitch
EndFunc   ;==>_ColRow
; -----------------------------------------------
Func EnableF10View()
    MsgBox($MB_OK, "", "EnableF10View", 1)
EndFunc   ;==>EnableF10View
; -----------------------------------------------
Func EnableF12View()
    MsgBox($MB_OK, "", "EnableF12View", 1)
EndFunc   ;==>EnableF12View
; -----------------------------------------------
Func _CloseForm()
    Switch @GUI_WinHandle
        Case $Form1
            Exit
    EndSwitch
EndFunc   ;==>_CloseForm
; -----------------------------------------------

 

As always...any assistance in this matter would be greatly appreciated!

Thank you all for your time!

 

Edited by mr-es335
Posted (edited)

Does this get you closer or am I way off? (note: I disabled extmsgbox only because i didn't feel like finding it.)

#RequireAdmin

#include <AutoItConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>

Opt("GUIOnEventMode", 1)
Opt("MustDeclareVars", 1)

Global $Form1, $mForm1Button, $mForm1Button2
Global $Form2, $mForm2Button
Global $Form3, $mForm3Button
Global $iWidth = 735, $iHeight = 48, $ixpos = -1, $iypos = -1, $iOpt = 1, $sFontName = "Corbel Bold", $iFontSize = 16, $iFontWt = 800

Forms()

Func Forms()
    $iFontSize = 14
    
    $Form1 = GUICreate("EnableF10", 150, 25, 900, 86, $WS_POPUP, $WS_EX_TOPMOST)
    
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    
    GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseForm")
    
    $mForm1Button = GUICtrlCreateButton(" Enable [F10]", 0, 0, 150, 25)
    
    GUICtrlSetOnEvent($mForm1Button, "_ColRow")
    
    $Form2 = GUICreate("EnableF12", 150, 25, 900, 86, $WS_POPUP, $WS_EX_TOPMOST)
    
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    
    $mForm2Button = GUICtrlCreateButton(" Enable [F12]", 0, 0, 150, 25)
    
    GUICtrlSetOnEvent($mForm2Button, "_ColRow")
    
    $Form3 = GUICreate("EnableHotKey", 150, 25, 725, 86, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    
    $mForm3Button = GUICtrlCreateButton(" Enable Hotkey", 0, 0, 150, 25)
    
    GUICtrlSetOnEvent($mForm3Button, "_ColRow")
    
    GUISetState(@SW_SHOW, $Form1)
    
    GUISetState(@SW_SHOW, $Form3)
    
    While 1
        Sleep(10)
    WEnd
EndFunc

Func _ColRow()
    ConsoleWrite("@GUI_CtrlId=" & @GUI_CtrlId & @CRLF)
    
    Switch @GUI_CtrlId
        Case $mForm1Button
            GUISetState(@SW_HIDE, $Form1)   ; From "EnableF10"...
            GUISetState(@SW_SHOW, $Form2)   ; ...to EnableF12"
            EnableF10View()
        Case $mForm2Button
            GUISetState(@SW_HIDE, $Form2)
            EnableF12View()
            Exit
        Case $mForm3Button
            _ToggleNUMPADSUB()
    EndSwitch
EndFunc

Func EnableF10View()
    MsgBox($MB_OK, "", "EnableF10View", 1)
EndFunc 

Func EnableF12View()
    MsgBox($MB_OK, "", "EnableF12View", 1)
EndFunc 

Func _CloseForm()
    Switch @GUI_WinHandle
        Case $Form1
            Exit
    EndSwitch
EndFunc

Func _ToggleNUMPADSUB()
    Local Static $bEnabled = True
    Local $aGuiPos = WinGetPos($Form1)
    If $bEnabled Then
        HotKeySet("{NUMPADSUB}", "ReadIniFile")
        GUICtrlSetData($mForm1Button, "Disable Hotkey")
    Else
        WinClose($Form1)
    EndIf
    $bEnabled = Not $bEnabled
EndFunc   ;==>_ToggleNUMPADSUB

Func ReadIniFile()
    ; The ReadIniFile procedure is launched.
    ; Upon selecting [Continue], the first line of the .ini file is read and then copied to the clipboard.
    
    Local $sFilePath = "E:\Desktop\Working\Assets\IniData\SceneData.ini"
    
    Local $aArray = IniReadSection($sFilePath, "Scene Data")
    
    Opt("GUIOnEventMode", 0) ; when in $hMsgForm - disable <<<<<<<<<<<<<<<
;~  Local $hMsgForm = GUICreate("ReadIniFile", 390, 90, 725, 115, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    Local $hMsgForm = GUICreate("ReadIniFile", 390, 90, 725, 115, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    
    Local $idLabel1 = GUICtrlCreateLabel("", 5, 5, 379, 45, $SS_SUNKEN)
    
    Local $idBtnContinue = GUICtrlCreateButton("Continue", 100, 55, 85, 25, $BS_DEFPUSHBUTTON)
    Local $idBtnCancel = GUICtrlCreateButton("Cancel", 200, 55, 85, 25)
    Local $idBtnAbout = GUICtrlCreateLabel("!", 360, 55, 10, 20)
    
    GUISetState(@SW_SHOW, $hMsgForm)
    
    Local $nMsg, $idx = 1
    GUICtrlSetData($idLabel1, "To copy [" & $aArray[$idx][1] & "]...select [Continue]..." & @CRLF & "Select [Cancel] to exit...")
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $idBtnCancel
                ExitLoop
            Case $idBtnContinue
                ClipPut($aArray[$idx][1])
                UpdateScenes()
                
                $idx += 1
                If $idx > $aArray[0][0] Then
                    ExitLoop ; The end of the SceneData.ini data file has been reached!
                EndIf
                GUICtrlSetData($idLabel1, "To copy [" & $aArray[$idx][1] & "]...select [Continue]..." & @CRLF & "Select [Cancel] to exit...")
            Case $idBtnAbout
                AboutMe()
        EndSwitch
    WEnd
    
    GUIDelete($hMsgForm)
    
    Opt("GUIOnEventMode", 1) ; when out of $hMsgForm - enable <<<<<<<<<<<<<<<
EndFunc

Func UpdateScenes()
    Local $hWnd = "[CLASS:SAC_SCENEPROPERTIES]"
    
    ; F Mixer Number Zone[s] is|are [manually] selected
    
    WinActivate("[CLASS:SAC_SCENES]", "")
    MouseClick($MOUSE_CLICK_LEFT, 254, 313, 1, 1) ; The Scenes View is selected, x y clicks speed
    Sleep(100)
    MouseClick($MOUSE_CLICK_LEFT, 133, 165, 2, 1) ; The first line of Scenes View is selected. <<[A]>>
    Sleep(100)
    Send("{End}") ; The [End Of List] is selected via the [End] key.
    MouseClick($MOUSE_CLICK_LEFT, 188, 118, 1, 1) ; The [New] button is selected.
    Sleep(100)
    Send("^v") ; The previously copied text from the ReadIniFile procedure is then pasted into the [Enter Scene Name...] dialog.
    Send("{ENTER}") ; [Enter] is selected, for [Ok] - with the [Enter Scene Name...] dialog being summarily exited.
    
    Sleep(100)
    WinMove($hWnd, "", 725, 210) ; The Scene Properties window is displayed and is then moved.
    
    Sleep(100)
    MouseMove(1300, 295, 0) ; The mouse is moved to the Scene Properties window.
    
    ; The Scene Properties are [manually] selected.
    ; [OK] is [manually] selected.
    ; The [Start] scene is [manually] selected. BEING TESTED, SEE [A] ABOVE!!!!
EndFunc 

Func AboutMe()
    Local $sMsg
    
    ;_ExtMsgBoxSet(64, 4, Default, Default, 14, "Corbel Bold")
    $sMsg = "Enable Hotkey Script" & @CRLF & @CRLF
    $sMsg &= "Version 3.3b" & @CRLF & @CRLF
    $sMsg &= "Scripting by Dell Krauchi" & @CRLF
    $sMsg &= "Sentinel Music Studios" & @CRLF & @CRLF
    $sMsg &= "With the sincerest gratitude of ioa747...whose assistance in this project has been incalculable!" & @CRLF & @CRLF
    $sMsg &= "This script was developed specifically for implementation with the Live_Rig." & @CRLF & @CRLF
    $sMsg &= "Last updated: October 20th, 2025" & @CRLF
;~  $sMsg &= "" & @CRLF & @CRLF

    ;_ExtMsgBox(64, "Ok", "About!", $sMsg, 0)
EndFunc

 

Edited by jaberwacky
Posted

jaberwacky,

Firstly, interesting means of altering the button text!

Secondly, thanks for the offering...appreciated!

You stated, "Does this get you closer or am I way off? (note: I disabled extmsgbox only because i didn't feel like finding it.) "

Thirdly, sadly, "No!"

When Enable Hotkey is selected, which invokes the ToggleNUMPADSUB function, $hMsgForm [ReadIniData] is then invoked.
a) At this point the Enable [F10] button can no longer be invoked.
• Or, in your case, the Disable Hotkey button.
b) However, if $hMsgForm is exited, then the Enable [F10] button can then be invoked.
c) To simplify simply the, UpdateScenes function from CombinedF12 can be replaced with the following:

Func UpdateScenes()
    MsgBox($MB_OK, "", "UpdateScenes", 1)
EndFunc   ;==>UpdateScenes

d) The SceneData.ini data file is not required, as the issue here apparently is with the $hMsgForm [ReadIniData] form.

I hope the above answers your question?

Posted

Let's try again ...

; #RequireAdmin ; temporarily disabled for testing

#include <AutoItConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>

Opt("GUIOnEventMode", 1)
Opt("MustDeclareVars", 1)

Global $enableF10Form, $enableF10Button, $enableF10Button2
Global $enableF12Form, $enableF12Button
Global $enableHotkeyForm, $enableHotkeyButton
Global $iWidth = 735, $iHeight = 48, $ixpos = -1, $iypos = -1, $iOpt = 1, $sFontName = "Corbel Bold", $iFontSize = 14, $iFontWt = 800

Forms()

Func Forms()    
    $enableF10Form = GUICreate("Enable [F10]", 150, 25, 900, 86, $WS_POPUP, $WS_EX_TOPMOST)
    
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    
    GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseForm")
    
    $enableF10Button = GUICtrlCreateButton(" Enable [F10]", 0, 0, 150, 25)
    
    GUICtrlSetOnEvent($enableF10Button, "_ColRow")
    
    
    $enableF12Form = GUICreate("Enable [F12]", 150, 25, 900, 86, $WS_POPUP, $WS_EX_TOPMOST)
    
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    
    $enableF12Button = GUICtrlCreateButton(" Enable [F12]", 0, 0, 150, 25)
    
    GUICtrlSetOnEvent($enableF12Button, "_ColRow")
    
    
    $enableHotkeyForm = GUICreate("Enable HotKey", 150, 25, 725, 86, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    
    $enableHotkeyButton = GUICtrlCreateButton("Enable Hotkey", 0, 0, 150, 25)
    
    GUICtrlSetOnEvent($enableHotkeyButton, "_ColRow")
    
    
    GUISetState(@SW_SHOW, $enableF10Form)
    
    GUISetState(@SW_SHOW, $enableHotkeyForm)
    
    While 1
        Sleep(10)
    WEnd
EndFunc

Func _ColRow()  
    Switch @GUI_CtrlId
        Case $enableF10Button
            ConsoleWrite("$enableF10Button" & @CRLF)
    
            GUISetState(@SW_HIDE, $enableF10Form)   ; From "EnableF10"...
            
            GUISetState(@SW_SHOW, $enableF12Form)   ; ...to EnableF12"
            
            EnableF10View()
            
        Case $enableF12Button
            ConsoleWrite("$enableF12Button" & @CRLF)
            
            GUISetState(@SW_HIDE, $enableF12Form)
            
            EnableF12View()
            
            Exit
            
        Case $enableHotkeyButton
            ConsoleWrite("$enableHotkeyButton" & @CRLF)
            
            _ToggleNUMPADSUB()
    EndSwitch
EndFunc

Func EnableF10View()
    ConsoleWrite("EnableF10View!" & @CRLF)
EndFunc 

Func EnableF12View()
    ConsoleWrite("EnableF12View!" & @CRLF)
EndFunc 

Func _ToggleNUMPADSUB()
    Local Static $bEnabled = True
    
    If $bEnabled Then
        GUISetState(@SW_HIDE, $enableF10Form)  
;~      
        GUISetState(@SW_HIDE, $enableF12Form)
            
        HotKeySet("{NUMPADSUB}", "ReadIniFile")
        
        GUICtrlSetData($enableHotkeyButton, "Disable Hotkey")
    Else
        GUISetState(@SW_SHOW, $enableF12Form)
        
        GUISetState(@SW_SHOW, $enableF10Form)  
        
        HotKeySet("{NUMPADSUB}")
        
        GUICtrlSetData($enableHotkeyButton, "Enable Hotkey")
    EndIf
    
    $bEnabled = Not $bEnabled
EndFunc

Func ReadIniFile()
      ; The ReadIniFile procedure is launched.
    ; Upon selecting [Continue], the first line of the .ini file is read and then copied to the clipboard.
    
    ;Local $sFilePath = "E:\Desktop\Working\Assets\IniData\SceneData.ini"
    
    Local $sFilePath = @ScriptDir & "\SceneData.ini"
    
    Local $aArray = IniReadSection($sFilePath, "Scene Data")
    
    Opt("GUIOnEventMode", 0) ; when in $hMsgForm - disable <<<<<<<<<<<<<<<
    
;~  Local $hMsgForm = GUICreate("ReadIniFile", 390, 90, 725, 115, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))

    Local $hMsgForm = GUICreate("ReadIniFile", 390, 90, 725, 115, $WS_POPUP, $WS_EX_TOPMOST)
    
    GUISetFont($iFontSize, $iFontWt, $GUI_FONTNORMAL, $sFontName)
    
    Local $idLabel1 = GUICtrlCreateLabel("", 5, 5, 379, 45, $SS_SUNKEN)
    
    Local $idBtnContinue = GUICtrlCreateButton("Continue", 100, 55, 85, 25, $BS_DEFPUSHBUTTON)
    
    Local $idBtnCancel = GUICtrlCreateButton("Cancel", 200, 55, 85, 25)
    
    Local $idBtnAbout = GUICtrlCreateLabel("!", 360, 55, 10, 20)
    
    GUISetState(@SW_SHOW, $hMsgForm)
    
    Local $nMsg, $idx = 1
    
    GUICtrlSetData($idLabel1, "To copy [" & $aArray[$idx][1] & "]...select [Continue]..." & @CRLF & "Select [Cancel] to exit...")
    
    While 1
        $nMsg = GUIGetMsg()
        
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $idBtnCancel
                ExitLoop
                
            Case $idBtnContinue
                ClipPut($aArray[$idx][1])
                
                UpdateScenes()
                
                $idx += 1
                
                If $idx > $aArray[0][0] Then
                    ExitLoop ; The end of the SceneData.ini data file has been reached!
                EndIf
                
                GUICtrlSetData($idLabel1, "To copy [" & $aArray[$idx][1] & "]...select [Continue]..." & @CRLF & "Select [Cancel] to exit...")
            
            Case $idBtnAbout
              AboutMe()
        EndSwitch
    WEnd
    
    GUIDelete($hMsgForm)
    
    Opt("GUIOnEventMode", 1) ; when out of $hMsgForm - enable <<<<<<<<<<<<<<<
    
    GUISetState(@SW_SHOW, $enableF12Form)
    
    GUISetState(@SW_SHOW, $enableF10Form)  
EndFunc

Func UpdateScenes()
    ConsoleWrite("Update Scenes!" & @CRLF)
EndFunc 

Func _CloseForm()
    Switch @GUI_WinHandle
        Case $enableF10Form
            Exit
    EndSwitch
EndFunc

Func AboutMe()
    Local $sMsg
    
    ;_ExtMsgBoxSet(64, 4, Default, Default, 14, "Corbel Bold")
    $sMsg = "Enable Hotkey Script" & @CRLF & @CRLF
    $sMsg &= "Version 3.3b" & @CRLF & @CRLF
    $sMsg &= "Scripting by Dell Krauchi" & @CRLF
    $sMsg &= "Sentinel Music Studios" & @CRLF & @CRLF
    $sMsg &= "With the sincerest gratitude of ioa747...whose assistance in this project has been incalculable!" & @CRLF & @CRLF
    $sMsg &= "This script was developed specifically for implementation with the Live_Rig." & @CRLF & @CRLF
    $sMsg &= "Last updated: October 20th, 2025" & @CRLF
;~  $sMsg &= "" & @CRLF & @CRLF

    ;_ExtMsgBox(64, "Ok", "About!", $sMsg, 0)
EndFunc

 

Posted

jaberwacky,

Thanks for the 2nd sampling.

Cursory attempt appears NOT to be working however?!?

PS: I am completing a previous offering, so it may be a bit before I am able to get back to you on this one.

Thanks gain...and I will be in touch!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...