executes the script
        :return: boolean if execution of script finished succesfully

def run(self):
        """
        executes the script
        :return: boolean if execution of script finished succesfully
        """
        self.log_data.clear()
        self._plot_refresh = True  # flag that requests that plot axes are refreshed when self.plot is called next time
        self.is_running = True
        self.start_time = datetime.datetime.now()


        self._current_subscript_stage = {
            'current_subscript': None,
            'subscript_exec_count':{},
            'subscript_exec_duration':{}
        }

        # update the datapath of the subscripts, connect their progress signal to the receive slot
        for subscript in list(self.scripts.values()):
            subscript.data_path = os.path.join(self.filename(create_if_not_existing=False), self.SUBSCRIPT_DATA_DIR)
            subscript.updateProgress.connect(self._receive_signal)
            subscript.started.connect(lambda: self._set_current_subscript(True))
            subscript.finished.connect(lambda: self._set_current_subscript(False))
            self._current_subscript_stage['subscript_exec_count'].update({subscript.name:0})
            self._current_subscript_stage['subscript_exec_duration'].update({subscript.name: datetime.timedelta(0)})

                #todo: 170202JG (search for this to find related todos) need to test this:
                # do we need to connect the log functions of the subscript to the mother script?, e.g
                # subscript.log.connect(self.log)


        self.log('starting script {:s} at {:s} on {:s}'.format(self.name, self.start_time.strftime('%H:%M:%S'),self.start_time.strftime('%d/%m/%y')))
        self._abort = False

        #saves standard to disk
        if self.settings['save']:
            self.save_b26()

        self.started.emit()

        self._function()
        self.end_time  = datetime.datetime.now()
        self.log('script {:s} finished at {:s} on {:s}'.format(self.name, self.end_time.strftime('%H:%M:%S'),self.end_time.strftime('%d/%m/%y')))

        #saves standard to disk
        if self.settings['save']:
            self.save_data()
            self.save_log()
            self.save_image_to_disk()

        success = not self._abort

        # disconnect subscripts
        for subscript in list(self.scripts.values()):
            subscript.started.disconnect()
            subscript.updateProgress.disconnect()
            subscript.finished.disconnect()
        self.is_running = False
        self.finished.emit()