diff --git a/python/ldtpeditor b/python/ldtpeditor
index baa849e..7c49e39 100755
--- a/python/ldtpeditor
+++ b/python/ldtpeditor
@@ -285,9 +285,13 @@ class LdtpEditorGui (gnome.Program):
             self.chkGenerateKeyEvents = self.wTree.get_widget ("chkGenerateKeyEvents").get_active ()
             self.chkGenerateWaitTime  = self.wTree.get_widget ("chkGenerateWaitTime").get_active ()
             self.chkGenerateMemCpuStat = self.wTree.get_widget ("chkGenerateMemCpuStat").get_active ()
+            self.chkGenerateOoldtp = self.wTree.get_widget ("chkGenerateOoldtp").get_active () 
             if self.chkGenerateLdtpCode == True:
                 xml = ''
                 lines = 'from ldtp import *\nfrom ldtputils import *\n\n'
+                if self.chkGenerateOoldtp == True:
+                    lines = '%sfrom ooldtp import *\n' % lines
+                    ldtplib.libldtpcodegen.initContext ()
                 if self.chkGenerateDataXml == True:
                     lines = '%sxmlParser = LdtpDataFileParser (datafilename)\n\n' % lines
                     xml = '%s<data>\n' % xml
@@ -342,6 +346,8 @@ class LdtpEditorGui (gnome.Program):
                                     % (lines, code [0], component, component) 
                             xml = '%s<%s>%s</%s>\n' % (xml, component, saxutils.escape (data), component)
                             continue
+                    if self.chkGenerateOoldtp == True and line.strip() != '' and re.match ('wait', line) == None:
+                        line = ldtplib.libldtpcodegen.objectOrient (line)
                     lines = '%s\t%s\n' % (lines, line)
                 #lines += '\n\tlog (\"test script\", \"pass\")\n'
                 #lines += '\tlog (\"test script\", \"testend\")\n'
diff --git a/python/ldtpeditor.glade b/python/ldtpeditor.glade
index af95422..e88549b 100644
--- a/python/ldtpeditor.glade
+++ b/python/ldtpeditor.glade
@@ -490,6 +490,27 @@
 	    </packing>
 	  </child>
             <child>
+              <widget class="GtkCheckButton" id="chkGenerateOoldtp">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip" translatable="yes">Generate ooldtp scripts</property>
+                <property name="label" translatable="yes">Generate ooldtp scripts</property>
+                <property name="use_underline">True</property>
+                <property name="response_id">0</property>
+                <property name="draw_indicator">True</property>
+                <accessibility>
+                  <atkproperty name="AtkObject::accessible_name" translatable="yes">GenerateOoldtp</atkproperty>
+                </accessibility>
+                <signal name="toggled" handler="on_GenerateOoldtp_toggled"/>
+                <accelerator key="X" modifiers="GDK_MOD1_MASK" signal="clicked"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">7</property>
+              </packing>
+            </child>
+            <child>
               <widget class="GtkButton" id="appListEdit">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -499,7 +520,7 @@
                 <signal name="clicked" handler="on_appListEdit_clicked"/>
 	</widget>
 	<packing>
-                <property name="position">7</property>
+                <property name="position">8</property>
 	</packing>
       </child>
     </widget>
diff --git a/python/ldtplib/libldtpcodegen.py b/python/ldtplib/libldtpcodegen.py
index 45ff7ff..5616150 100644
--- a/python/ldtplib/libldtpcodegen.py
+++ b/python/ldtplib/libldtpcodegen.py
@@ -47,6 +47,9 @@ appList = []
 APPHOME = "%s/.ldtp" % os.environ['HOME']
 APPROOT = "/usr/share/ldtp"
 
+#ooldtp support Global
+context = []
+
 # Let us not register our application under at-spi application list
 os.environ ['GTK_MODULES'] = ''
 
@@ -686,6 +689,28 @@ def saveAppList (newAppList):
         f.write (item)
     f.close ()
 
+#oldtp support specific function... initContext
+def initContext():
+    global context
+    context = []
+
+#ooldtp support specific function... objectOrient
+def objectOrient (line):
+    global context
+    re1 = re.compile ('\".*?\"')
+    shrink = re1.findall(line)[0]
+    re2 = re.compile ('\".*?\"\,\s')
+    parts = re2.split (line, 1)
+    for all in context:
+        if all == shrink:
+            line = 'context%d.%s%s' % (context.index(all), parts[0], parts[1])
+            return line
+    context.append (shrink)
+    last = len(context) - 1
+    line = 'context%d = context(%s)\n\t' % (last, shrink)
+    line = '%scontext%d.%s%s' % (line, last, parts[0], parts[1])
+    return line
+
 def callback (guiCallbackFunc, data, timeElapsed = None):
     global generatedCode
     if timeElapsed is not None:
