List files from selected folder in Notepad

Share your macros, knowledge, solutions, services, ...
Post Reply
Posts: 106
Joined: Tue Oct 18, 2016 1:12 pm

List files from selected folder in Notepad

Post by Petr » Wed Nov 23, 2016 4:47 pm

This example allows user to select a folder and then the macro opens Notepad and lists the folder content in it.

Code: Select all

<#> Start of the macro

<#> Get folder for counting files... 
<var_oper>(gm_vbiDirectory,"",SELECT_FOLDER,"","", "0")


<#> Get list of files in folder and count these files 


   <msg>(-100,-100,"No files found in selected directory.","Message",1)


<#> Start Notepad and make it active window
<waitfor>("WIN","OPEN","[Untitled - Notepad|Notepad|#164|#18]",15,0)
<actwin>("[Untitled - Notepad|Notepad|#164|#18]",0,0,"no")
<if_win>("[Untitled - Notepad|Notepad|#164|#18]","ACT",0)

   <#> Write each file name to new line in Notepad 
<#> End of the macro

Post Reply