mr-es335 Posted November 12, 2023 Share Posted November 12, 2023 (edited) Good day, expandcollapse popup; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> ; ----------------------------------------------- Call_Me_A() Call_Me_B() Call_Me_C() ; ----------------------------------------------- Func Call_Me_A() Call_Me_A1() Call_Me_A2() EndFunc ;==>Call_Me_A ; ----------------------------------------------- Func Call_Me_A1() ; Insert code here! EndFunc ;==>Call_Me_A1 ; ----------------------------------------------- Func Call_Me_A2() ; Insert code here! EndFunc ;==>Call_Me_A2 ; ----------------------------------------------- Func Call_Me_B() Call_Me_B1() Call_Me_B2() EndFunc ;==>Call_Me_B ; ----------------------------------------------- Func Call_Me_B1() ; Insert code here! EndFunc ;==>Call_Me_B1 ; ----------------------------------------------- Func Call_Me_B2() ; Insert code here! EndFunc ;==>Call_Me_B2 ; ----------------------------------------------- ; ----------------------------------------------- Func Call_Me_C() Call_Me_C1() Call_Me_C2() EndFunc ;==>Call_Me_C ; ----------------------------------------------- Func Call_Me_C1() ; Insert code here! EndFunc ;==>Call_Me_C1 ; ----------------------------------------------- Func Call_Me_C2() ; Insert code here! EndFunc ;==>Call_Me_C2 ; ----------------------------------------------- Any assistance in this matter would be greatly appreciated! Edited November 12, 2023 by mr-es335 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Xandy Posted November 12, 2023 Share Posted November 12, 2023 (edited) Looks like a good start. 33 minutes ago, mr-es335 said: Any assistance in this matter would be greatly appreciated! Sure, what would you like this script to do? What type of 'call' would you like the script to make? Will it be voice telephone calls, or something else? Edited November 12, 2023 by Xandy TheDcoder 1 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
mr-es335 Posted November 12, 2023 Author Share Posted November 12, 2023 (edited) Xandy, Thanks for the reply...appreciated! Quite simply really... 1. To create a folder structure 2. Copy specific data to some of those folders That is pretty much "it"! Would the following would be consider "inappropriate"? expandcollapse popup; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> ; ----------------------------------------------- Call_Me_A() Call_Me_B() Call_Me_C() ; ----------------------------------------------- Func Call_Me_A() Call_Me_A1() Call_Me_A2() EndFunc ;==>Call_Me_A ; ----------------- Func Call_Me_A1() ; Insert code here! EndFunc ;==>Call_Me_A1 ; ----------------- Func Call_Me_A2() ; Insert code here! EndFunc ;==>Call_Me_A2 ; ----------------------------------------------- ; ----------------------------------------------- Func Call_Me_B() Call_Me_B1() Call_Me_B2() EndFunc ;==>Call_Me_B ; ----------------- Func Call_Me_B1() ; Insert code here! EndFunc ;==>Call_Me_B1 ; ----------------- Func Call_Me_B2() ; Insert code here! EndFunc ;==>Call_Me_B2 ; ----------------------------------------------- ; ----------------------------------------------- Func Call_Me_C() Call_Me_C1() Call_Me_C2() EndFunc ;==>Call_Me_C ; ----------------- Func Call_Me_C1() ; Insert code here! EndFunc ;==>Call_Me_C1 ; ----------------- Func Call_Me_C2() ; Insert code here! EndFunc ;==>Call_Me_C2 ; ----------------------------------------------- ; ----------------------------------------------- How about this? expandcollapse popup; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> ; ----------------------------------------------- Call_Me_A() ; ----------------------------------------------- Func Call_Me_A() Call_Me_A1() Call_Me_A2() Call_Me_B() Call_Me_C() EndFunc ;==>Call_Me_A ; ----------------- Func Call_Me_A1() ; Insert code here! EndFunc ;==>Call_Me_A1 ; ----------------- Func Call_Me_A2() ; Insert code here! EndFunc ;==>Call_Me_A2 ; ----------------- ; ----------------- Func Call_Me_B() Call_Me_B1() Call_Me_B2() EndFunc ;==>Call_Me_B ; ----------------- Func Call_Me_B1() ; Insert code here! EndFunc ;==>Call_Me_B1 ; ----------------- Func Call_Me_B2() ; Insert code here! EndFunc ;==>Call_Me_B2 ; ----------------- ; ----------------- Func Call_Me_C() Call_Me_C1() Call_Me_C2() EndFunc ;==>Call_Me_C ; ----------------- Func Call_Me_C1() ; Insert code here! EndFunc ;==>Call_Me_C1 ; ----------------- Func Call_Me_C2() ; Insert code here! EndFunc ;==>Call_Me_C2 ; ----------------------------------------------- ; ----------------------------------------------- Edited November 12, 2023 by mr-es335 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Xandy Posted November 12, 2023 Share Posted November 12, 2023 (edited) 1 hour ago, mr-es335 said: Would the following would be consider "inappropriate"? No, I don't think so. Seems legit to me. 1 hour ago, mr-es335 said: 1. To create a folder structure 2. Copy specific data to some of those folders That can certainly be done. DirCreate(path) DirMove(source, dest, flag); use help file for flags FileMove(source, dest, flag); use help file for flags There could be better ways, but those are some tools above. Edited November 12, 2023 by Xandy TheDcoder 1 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
mr-es335 Posted November 12, 2023 Author Share Posted November 12, 2023 Xandy, One more... ; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> ; ----------------------------------------------- Call_Me_A() ; ----------------------------------------------- Func Call_Me_A() Call_Me_A1() EndFunc ;==>Call_Me_A ; ----------------- Func Call_Me_A1() ; Insert code here! Call_Me_B() EndFunc ;==>Call_Me_A1 ; ----------------- ; ----------------- Func Call_Me_B() Call_Me_B1() EndFunc ;==>Call_Me_B ; ----------------- Func Call_Me_B1() ; Insert code here! Call_Me_C() EndFunc ;==>Call_Me_B1 ; ----------------- ; ----------------- Func Call_Me_C() Call_Me_C1() EndFunc ;==>Call_Me_C ; ----------------- Func Call_Me_C1() ; Insert code here! EndFunc ;==>Call_Me_C1 ; ----------------------------------------------- ; ----------------------------------------------- mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Xandy Posted November 12, 2023 Share Posted November 12, 2023 Honestly I don't really know. It's difficult for me to approve your structure logic without the code meat. I worked all day, if there is a slight structure fail. I'm not likely to notice it right now. Best of luck mate. I hope you enjoy your time programming. I always do. TheDcoder 1 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
TheDcoder Posted November 12, 2023 Share Posted November 12, 2023 @mr-es335 Anything is appropriate if you have the right use case, even some "inappropriate" things like GOTO are appropriate in the right circumstances. (It doesn't exist in AutoIt by the way.) Xandy 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
mr-es335 Posted November 12, 2023 Author Share Posted November 12, 2023 (edited) Thanks for the replies and the comments...appreciated! Would some of the above be referred to as "nested" functions? If so, I have heard that it is NOT appropriate to to employ such function-ality! Edited November 12, 2023 by mr-es335 Xandy 1 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Xandy Posted November 12, 2023 Share Posted November 12, 2023 (edited) My understanding of a nested function would be: Func Fruit() Func Apple() ; Apple Code EndFunc; Apple Func Cavendish() ; Cavendish Code EndFunc; Cavendish EndFunc; Fruit As far as I know, the above would not execute and be improper in AutoIt. Edited November 12, 2023 by Xandy TheDcoder and mr-es335 1 1 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
mr-es335 Posted November 12, 2023 Author Share Posted November 12, 2023 Xandy, You are absolutely correct...no matter how you attempt to rectify the above sampling... I do find this "interesting: to-say-the-least, in that in all of the examples that I have provided, that all "return" successfully! Thus, we could assume, that such implementations are "appropriate"! PS: I am completing a script, which, when completed, I will then post for "critique"! Thanks again, Xandy, for your insight! Appreciated! mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
junkew Posted November 12, 2023 Share Posted November 12, 2023 More indentation doesnt matter in general code beautyfiers can do styling and formatting. Maybe you look for recursive function? https://www.autoitscript.com/wiki/Recursion Xandy 1 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
mr-es335 Posted November 12, 2023 Author Share Posted November 12, 2023 Good day, Okay...following is my completed script... expandcollapse popup; ----------------------------------------------- #include <AutoItConstants.au3> #include <FileConstants.au3> #include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; ----------------------------------------------- Local $hGUI = GUICreate("Session_Master Folder Development", 345, 155) GUISetFont(12, $FW_BOLD, $GUI_FONTNORMAL, "Calibri") ; ----------------------------------------------- Local $Dev_Fldrs = GUICtrlCreateButton("Dev Fldrs", 20, 20, 150, 25) Local $Copy_SM_Folder = GUICtrlCreateButton("Copy SM Folder", 20, 50, 150, 25) Local $Launch_Both = GUICtrlCreateButton("Launch Both", 20, 80, 150, 25) Local $Exit_Both = GUICtrlCreateButton("Exit Both", 20, 110, 150, 25) ; ----------------- Local $ExitMe = GUICtrlCreateButton("Exit", 175, 20, 150, 25) ; ----------------------------------------------- GUISetState(@SW_SHOW, $hGUI) ;$Pic1=GUICtrlCreatePic("@ScriptDir & "\Data\bg_img.bmp", 640, 120, 150, 175) ; ----------------------------------------------- While 1 Switch GUIGetMsg() Case $Dev_Fldrs Dev_Fldrs() Case $Copy_SM_Folder Copy_SM_Folder() Case $Launch_Both Launch_Both() Case $Exit_Both Exit_Both() Case $ExitMe ExitMe() EndSwitch WEnd ; ----------------------------------------------- Func Dev_Fldrs() Call_Intro() EndFunc ;==>Dev_Fldrs Func Call_Intro() SplashTextOn("NOTICE!!", "Create Session_Master folders...", 450, 50, -1, -1) Sleep(2000) SplashOff() Create_Main_Folder() EndFunc ;==>Call_Intro ; ----------------- Create_Main_Folder() Func Create_Main_Folder() Local $_main_folder = "E:\Master_Backup\Session_Master" ; ------ DirCreate($_main_folder) Create_Sub_Folders1() EndFunc ;==>Create_Main_Folder ; ----------------- Create_Sub_Folders1() Func Create_Sub_Folders1() Local $_main_folder = "E:\Master_Backup\Session_Master" Local $_show_folder = "E:\Master_Backup\Session_Master\Show" Local $_scenes_folder = "E:\Master_Backup\Session_Master\Scenes" Local $_su_folder = "E:\Master_Backup\Session_Master\Session_Undo" ; ------ FileChangeDir($_main_folder) DirCreate($_show_folder) DirCreate($_scenes_folder) DirCreate($_su_folder) Create_Sub_Folders2() EndFunc ;==>Create_Sub_Folders1 ; ----------------- Create_Sub_Folders2() Func Create_Sub_Folders2() Local $_show_folder = "E:\Master_Backup\Session_Master\Show" Local $_sd_folder = "E:\Master_Backup\Session_Master\Show\Session_Data" Local $_su_folder = "E:\Master_Backup\Session_Master\Show\Session_Undo" ; ------ FileChangeDir($_show_folder) DirCreate($_sd_folder) DirCreate($_su_folder) Copy_Scenes() EndFunc ;==>Create_Sub_Folders2 ; ----------------- Func Copy_Scenes() Local $src_folder="E:\Master_Backup\3_Integrated\Session_Master\Scenes" Local $dest_folder="E:\Master_Backup\Session_Master\Scenes" ; ------ DirCopy($src_folder, $dest_folder, $FC_OVERWRITE) Copy_Show_Data() EndFunc ; ----------------- Func Copy_Show_Data() Local $src_data="E:\Master_Backup\3_Integrated\Session_Master\Shows\Master_Show.shw" Local $dest_folder="E:\Master_Backup\Session_Master\Show" ; ------ FileCopy($src_data, $dest_folder, $FC_OVERWRITE) Copy_Session_Data() EndFunc ;==>Copy_Show_Data ; ----------------- Func Copy_Session_Data() Local $src_data1="E:\Master_Backup\3_Integrated\Session_Master\*.edl" Local $src_data2="E:\Master_Backup\3_Integrated\Session_Master\*.mxs" Local $dest_folder="E:\Master_Backup\Session_Master" ; ----------------- FileCopy($src_data1, $dest_folder, $FC_OVERWRITE) FileCopy($src_data2, $dest_folder, $FC_OVERWRITE) Copy_Doc_Data() EndFunc ;==>Copy_Session_Data ; ----------------- Func Copy_Doc_Data() Local $src_data="E:\Master_Backup\3_Integrated\Session_Master\Sets\Type_1\Session_Data\*.doc" Local $dest_folder="E:\Master_Backup\Session_Master\Show\Session_Data" ; ----------------- FileCopy($src_data, $dest_folder, $FC_OVERWRITE) Call_Outro() EndFunc ;==>Copy_Doc_Data ; ----------------- Call_Outro() Func Call_Outro() SplashTextOn("NOTICE!!", "Create Session_Master folders completed...", 450, 50, -1, -1) Sleep(2000) SplashOff() EndFunc ;==>Call_Outro ; ----------------------------------------------- Func Copy_SM_Folder() Local $_src_fldr="E:\Master_Backup\Session_Master" Local $_dest_fldr="G:\Session_Master" ; ----------------- SplashTextOn("NOTICE!!", "Copy Session_Master folder...", 450, 50, -1, -1) Sleep(2000) SplashOff() ; ----------------- DirCopy($_src_fldr, $_dest_fldr, $FC_OVERWRITE) ; ----------------- SplashTextOn("NOTICE!!", "Copy Session_Master folder completed...", 450, 50, -1, -1) Sleep(2000) SplashOff() EndFunc ;==>Copy_SM_Folder ; ----------------------------------------------- Func Launch_Both() Local $_app1 = "C:\Windows\toggleTaskbarAutohide.exe" Local $_app2 = "C:\RML\SAC\SAC64.exe" Local $_app3 = "C:\RML\SAW\SAWStudio64.exe" ; ------ Run($_app1) Sleep(100) ; ------ Run($_app2) Sleep(250) MouseClick($MOUSE_CLICK_RIGHT, 27, 56, 1, 2) Send("{F11}") Sleep(2500) ; ------ Run($_app3) EndFunc ;==>Launch_Both ; ----------------------------------------------- Func Exit_Both() Local $_app1 = "C:\Windows\toggleTaskbarAutohide.exe" Local $_app2 = "C:\RML\SAC\SAC64.exe" Local $_app3 = "C:\RML\SAW\SAWStudio64.exe" Local $PID = 0 ; ------ ProcessClose($_app3) $PID = ProcessExists("SAWStudio64.exe") If $PID Then ProcessClose($PID) ProcessClose($_app2) ; ------ $PID = ProcessExists("SAC64.exe") If $PID Then ProcessClose($PID) ; ------ Run($_app1) Sleep(100) EndFunc ;==>Exit_Both ; ----------------------------------------------- Func ExitMe() Exit EndFunc ;==>ExitMe ; ----------------------------------------------- Observations A: All within Func Dev_Fldrs() B: Standalone Xandy 1 mr-es335 Sentinel Music Studios Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now