hufi Posted April 29, 2023 Report Share Posted April 29, 2023 Hi forum, I post my first message on this forum.....I just bought Macro Express Pro 6 yesterday. Is there a way to check if the folder donwload is empty or not if not empty, to simulate the Ctrl +A and then Enter thanks fro your answer Quote Link to comment Share on other sites More sharing options...
rberq Posted April 29, 2023 Report Share Posted April 29, 2023 Something like this should work. It will be a learning experience to look up all these commands and enter them with the correct options. Actually this is overkill -- you don't have to get ALL the file names to know that the folder is not empty. As soon as one file name is returned from the Repeat with Folder command, you could "Repeat Exit" from the loop and do the typing. // Variable Set Integer %counter% to 0 // initialize counter Repeat with Folder c:\folder_name // return names of all files in folder Variable Modify Integer %counter%: Increment // increment counter for each file name End Repeat // If Variable %counter% Is Greater Than "0" // if folder is not empty Text Type (Simulate Keystrokes): <CTRLD>a<CTRLU> // type ctrl + a Delay: 500 milliseconds // delay 1/2 second Text Type (Simulate Keystrokes): <ENTER> // type ENTER End If // 1 Quote Link to comment Share on other sites More sharing options...
hufi Posted April 29, 2023 Author Report Share Posted April 29, 2023 Thanks a lot for your answer, that helps me a lot to do what I want here is my final code <VARIABLE SET INTEGER Option="\x00" Destination="%Counter%" Value="0" _COMMENT="Nombre de fichiers dans téléchargements\r\n"/> <REPEAT WITH FOLDER Path="C:\\Users\\hfaureis\\Downloads" OnlyFiles="TRUE" Destination="%Result%" FullPath="FALSE" ProcSubfolders="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%Counter%"/> <END REPEAT/> <MESSAGEBOX Caption="sq" Message="%Counter%" Icon="0"/> <DELAY Flags="\x02" Time="500"/> <IF VARIABLE Variable="%Counter%" Condition="\x05" Value="2" IgnoreCase="FALSE"/> <MESSAGEBOX Caption="Répertoire Téléchargement" Message="Répertoire déjà vide" Icon="0" _COMMENT="Répertoire déjà vide\r\n"/> <ELSE/> <MESSAGEBOX Caption="Répertoire Téléchargement" Message="On vide le répertoire" Icon="0" _COMMENT="On vide le répertoire\r\n"/> <OPEN FOLDER Path="C:\\Users\\hfaureis\\Downloads" _COMMENT="On ouvre le répertoire download\r\n"/> <DELAY Flags="\x01" Time="1"/> <WINDOW MAXIMIZE Option="\x00" Partial="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/> <MOUSE MOVE Option="\x01" X="949" Y="304" _PROMPT="0x000A"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<CTRLD>a<CTRLU>" _COMMENT="On simule Ctrl + A"/> <DELAY Flags="\x01" Time="1"/> <MOUSE MOVE Option="\x01" X="522" Y="83" _PROMPT="0x000A" _COMMENT="On se deplace sur la croix rouge pour supprimer les fichiers"/> <DELAY Flags="\x01" Time="1"/> <MOUSE LEFT CLICK/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<ENTER>" _COMMENT="On confirme l'effacement"/> <END IF/> Quote Link to comment Share on other sites More sharing options...
rberq Posted April 29, 2023 Report Share Posted April 29, 2023 Bien joué! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.