diff --git a/ida_script.py b/ida_script.py
index 07de59525..1e9e4c40c 100644
--- a/ida_script.py
+++ b/ida_script.py
@@ -20,7 +20,10 @@ idaapi.autoWait()
dt = datetime.datetime.now().isoformat().replace(':', '-')
# Save the database so nothing gets lost.
-idc.SaveBase(idc.GetIdbPath() + '.' + dt)
+if idaapi.IDA_SDK_VERSION >= 700:
+ idaapi.save_database(idc.GetIdbPath() + '.' + dt)
+else:
+ idc.SaveBase(idc.GetIdbPath() + '.' + dt)
xmlrpclib.Marshaller.dispatch[type(0L)] = lambda _, v, w: w("%d" % v)
xmlrpclib.Marshaller.dispatch[type(0)] = lambda _, v, w: w("%d" % v)