<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply_clicked(self, button):
 """Triggered when the Apply-Shortcut in the editor is triggered. """

        if isinstance(self.model.state, LibraryState):
            return

        self.set_script_text(self.view.get_text())