Code: Select all
<#> Start of the macro
<#> Only commands takes effect in the macro, new lines and other text is ignored
<cmds>
<#> Read registry keys in to array vKey[]
<reg_enumsubkeys>("HKEY_CURRENT_USER\Software","vKey","vNumOfKeys")
<#> If no key
<if_num>("vNumOfKeys==0")
<#> Show message
<msg>(-100,-100,"No keys found under HKEY_CURRENT_USER\Software.","Message",1)
<#> Exit macro
<exitmacro>
<endif>
<#> Start Notepad and make it active window
<execappex>("notepad.exe","","",0,0)
<#> Wait while Notepad not opened
<waitfor>("WIN","OPEN","[*- Notepad|Notepad|#164|#18]",15,0)
<#> Activate Notepad window
<actwin>("[*- Notepad|Notepad|#164|#18]",0,0,"no")
<#> If Notepad window is active - on top
<if_win>("[*- Notepad|Notepad|#164|#18]","ACT",0)
<#> For each line in array vKey[]
<begloop>(vNumOfKeys)
<#> Write current line of array vKey[] in to Notepad
<varout>("vKey[_vLoopCounter0]",0)
<#> Create new line (like Enter)
<newline>
<endloop>
<endif>
<#> End of the macro