Which version of UltraEdit do you use because the macro worked on my computer?
Do you know that when you have selected 1 or more lines and you press Shift+Tab UltraEdit shifts the selected lines one indent to left. How many spaces/tabs an indent is can be configured for all files at once or individually for different groups of files according to their file extensions in the Word Wrap / Tab Settings configuration dialog. See for example
extension based tab settings problem.
Trim all leading spaces in whole file or just a selected block is definitely done best with a regular expression replace either using the Perl / Unix expression pietzcker posted or using
%[ ^t]+ as search string with the UltraEdit regular expression engine.
Hint:
The position of the cursor after Key HOME depends on configuration setting
Home key always goto column 1. Your version works always fine if this setting is enabled. Otherwise you would need additional code like:
Key HOME
IfColNum 1
Else
Key HOME
EndIfor
Key HOME
IfColNumGt 1
Key HOME
EndIfor
GotoLine 0 1Which version you can use depends on your version of UltraEdit.