To execute debugger commands from a script, use the source command as follows:
(idb) source filename
The source command causes the debugger to read and execute debugger commands from the file named filename.
The source command is not yet available in the GDB mode.