This script will search the text the comments, scenario’s and linked document of the selected elements for terms in the domain model. If it finds a match it will create a trace from your selected element to the element in the domain model.
In order to import the script into an Enterprise Architect model select Model|Data Management|Import Reference Data… Then select the xml file, select Automation Scripts and click Import
In order to execute the script you have to select either one or more elements in the project browser, or select a package in the project browser. Then select Scripts|Link To Domain Model
More details at Automatically trace elements to domain model in Enterprise Architect