Abstract: This disclosure discloses a method for generating a description code of a user interface, and the method includes the steps of displaying a programmable user interface having a first object and a second object; grouping the first object and the second object to form a grouping block; cutting the grouping block into a first sub-block and a second sub-block; setting the first sub-block to have a first display attribute; displaying a first attribute element on the programmable user interface; detecting whether the first attribute element is selected; changing the first display attribute to a second display attribute when it is detected that the first attribute element is selected; and generating a first description code corresponding to the first sub-block according to the second display attribute. This disclosure also discloses a system for generating a description code of a user interface.