<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: VBS Script: Wait, Pause, Sleep in Additional Q&amp;A</title>
    <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638158#M90703</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scriptman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, I just noticed that my code below does perform the first step, (simulate F8), and only then begins to ask about the Object Required: WScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That gives me the idea that at least partially the script is running successfully, but needs something to do the second step (simulate F3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Nick&lt;/P&gt;&lt;P&gt;*********************************************************&lt;/P&gt;&lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;&lt;P&gt;   Set SapGuiAuto  = GetObject("SAPGUI")&lt;/P&gt;&lt;P&gt;   Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(connection) Then&lt;/P&gt;&lt;P&gt;   Set connection = application.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(session) Then&lt;/P&gt;&lt;P&gt;   Set session    = connection.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If IsObject(WScript) Then&lt;/P&gt;&lt;P&gt;   WScript.ConnectObject session,     "on"&lt;/P&gt;&lt;P&gt;   WScript.ConnectObject application, "on"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").resizeWorkingPane 263,47,false&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2012 13:18:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-03-09T13:18:44Z</dc:date>
    <item>
      <title>VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaq-p/8638151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear EXperts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Newbie here.&lt;/P&gt;&lt;P&gt;I was able to record something (picking progress in TC LT45) and thus generate a VBS file.&lt;/P&gt;&lt;P&gt;Now, running this script is doing what it should do, except for the timing: It runs way too fast and therefore I am searching for adding some command/code to pause.&lt;/P&gt;&lt;P&gt;I found examples like Application.Wait("0:00:1000") but SAP does not like that.&lt;/P&gt;&lt;P&gt;See 'my' code below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any answer will be appreciated.&lt;/P&gt;&lt;P&gt;Thanks, Nick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;&lt;P&gt;   Set SapGuiAuto  = GetObject("SAPGUI")&lt;/P&gt;&lt;P&gt;   Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(connection) Then&lt;/P&gt;&lt;P&gt;   Set connection = application.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(session) Then&lt;/P&gt;&lt;P&gt;   Set session    = connection.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If IsObject(WScript) Then&lt;/P&gt;&lt;P&gt;   WScript.ConnectObject session,     "on"&lt;/P&gt;&lt;P&gt;   WScript.ConnectObject application, "on"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").resizeWorkingPane 263,47,false&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;Application.Wait("0:00:1000")&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;Application.Wait("0:00:5000")&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;Application.Wait("0:00:1000")&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: N. Lagace on Mar 8, 2012 1:37 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 12:35:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaq-p/8638151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-08T12:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638152#M90697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello N. Lagace,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in vbs-scripts you have to use this::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wscript.sleep milliseconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;wscript.sleep 6000&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;The script will wait 60 seconds an then continue the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I allways use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at:&lt;/P&gt;&lt;P&gt;&lt;A href="http://technet.microsoft.com/en-us/library/ee156589.asp" target="test_blank"&gt;http://technet.microsoft.com/en-us/library/ee156589.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;           Listing 3.13 Setting the Time-out Value of a Script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;netkid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 16:18:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638152#M90697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-08T16:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638153#M90698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi netkid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;absolutely right, just a little note: 6000 miliseconds = 6 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does not work if the script is started from within SAP. Then you should use a different method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ScriptMan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 16:40:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638153#M90698</guid>
      <dc:creator>script_man</dc:creator>
      <dc:date>2012-03-08T16:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638154#M90699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Scriptman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I knew you would respond to my post. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The WScript.Sleep 4000 I already had in place, and yes I start the thing from SAP, and you are right it does not work becaus it says Object Required: WScript&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to deal with that object requirement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, your advise to use an other method, is that feasible for a newbie? I already was proud to be digging in VB as a strictly functional guy. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;&lt;P&gt;   Set SapGuiAuto  = GetObject("SAPGUI")&lt;/P&gt;&lt;P&gt;   Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(connection) Then&lt;/P&gt;&lt;P&gt;   Set connection = application.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(session) Then&lt;/P&gt;&lt;P&gt;   Set session    = connection.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If IsObject(WScript) Then&lt;/P&gt;&lt;P&gt;   WScript.ConnectObject session,     "on"&lt;/P&gt;&lt;P&gt;   WScript.ConnectObject application, "on"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").resizeWorkingPane 263,47,false&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000  &lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: N. Lagace on Mar 9, 2012 12:17 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 11:14:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638154#M90699</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-09T11:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638155#M90700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Netkid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for responding to my post. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The WScript.Sleep 4000 I already had in place, and yes I start the thing from SAP, and you are right it does not work becaus it says Object Required: WScript&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to deal with that object requirement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;&lt;P&gt;Set SapGuiAuto = GetObject("SAPGUI")&lt;/P&gt;&lt;P&gt;Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(connection) Then&lt;/P&gt;&lt;P&gt;Set connection = application.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(session) Then&lt;/P&gt;&lt;P&gt;Set session = connection.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If IsObject(WScript) Then&lt;/P&gt;&lt;P&gt;WScript.ConnectObject session, "on"&lt;/P&gt;&lt;P&gt;WScript.ConnectObject application, "on"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").resizeWorkingPane 263,47,false&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000 &lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 11:59:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638155#M90700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-09T11:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638156#M90701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ScriptMan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for yor note. The same mistake is at the microsoft page . . .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement "wscript.sleep xxxx" does work on my computer.&lt;/P&gt;&lt;P&gt;This little vbs-program works when I start it in SAP itself&lt;/P&gt;&lt;P&gt;and i don't kwow why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If Not IsObject(application) Then
   Set SapGuiAuto  = GetObject("SAPGUI")
   Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
   Set connection = application.Children(0)
End If
Set session = application.ActiveSession

wscript.sleep 3000
session.findById("wnd[0]/tbar[0]/okcd").text = "SP01"		'Spools
wscript.sleep 3000
session.findById("wnd[0]/tbar[0]/btn[0]").press
wscript.sleep 3000
session.findById("wnd[0]/tbar[1]/btn[8]").press
wscript.sleep 3000
session.findById("wnd[0]/usr/chk[1,3]").selected = true
wscript.sleep 3000
session.findById("wnd[0]/usr/chk[1,3]").setFocus

Set SapGuiAuto = Nothing
Set application = Nothing
Set connection = Nothing
Set session = Nothing&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I work with SAP-Frontend für Windows (720 Final Release) and&lt;/P&gt;&lt;P&gt;Microsoft Windows XP 5.1 (2600) Service Pack 3.&lt;/P&gt;&lt;P&gt;Maybe the reason is: there is C:WINDOWSsystem32VBScript.dll (Version 5.7.6002.22589) loaded.&lt;/P&gt;&lt;P&gt;I don't know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;netkid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: netkid on Mar 9, 2012 1:04 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 12:03:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638156#M90701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-09T12:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638157#M90702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Netkid &amp;amp; Sriptman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case: My VBScript.dll version in System32 is 5.8.7600.16762&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: N. Lagace on Mar 9, 2012 1:42 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 12:28:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638157#M90702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-09T12:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638158#M90703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scriptman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, I just noticed that my code below does perform the first step, (simulate F8), and only then begins to ask about the Object Required: WScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That gives me the idea that at least partially the script is running successfully, but needs something to do the second step (simulate F3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Nick&lt;/P&gt;&lt;P&gt;*********************************************************&lt;/P&gt;&lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;&lt;P&gt;   Set SapGuiAuto  = GetObject("SAPGUI")&lt;/P&gt;&lt;P&gt;   Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(connection) Then&lt;/P&gt;&lt;P&gt;   Set connection = application.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If Not IsObject(session) Then&lt;/P&gt;&lt;P&gt;   Set session    = connection.Children(0)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;If IsObject(WScript) Then&lt;/P&gt;&lt;P&gt;   WScript.ConnectObject session,     "on"&lt;/P&gt;&lt;P&gt;   WScript.ConnectObject application, "on"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").resizeWorkingPane 263,47,false&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;WScript.Sleep 4000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 13:18:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638158#M90703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-03-09T13:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638159#M90704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nick,&lt;/P&gt;&lt;P&gt;If you still should not have any other solution to your problem, you can try the following suggestion:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set wshell = createObject("WScript.Shell")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Set SapGuiAuto&amp;nbsp; = GetObject("SAPGUI")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 8&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;wshell.run "c:\tmp\sleep_4000.vbs",1,true&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]").sendVKey 3&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file c:\tmp\sleep_4000.vbs contains the following command:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;wscript.sleep 4000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ScriptMan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2012 16:47:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638159#M90704</guid>
      <dc:creator>script_man</dc:creator>
      <dc:date>2012-04-06T16:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638160#M90705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scriptman,&lt;/P&gt;&lt;P&gt;. . . . . it works! I am speechless...&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" height="1" src="https://community.sap.com/5.0.1/images/emoticons/happy.gif" width="1"&gt;&lt;/SPAN&gt;. Thank you for your multiple replies; I will reward you as soon as I have found out how that works here. &lt;/P&gt;&lt;P&gt;Again, thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 12:00:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638160#M90705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-04-11T12:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638161#M90706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi scriptman &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to create this step by step pls....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file c:\tmp\sleep_4000.vbs contains the following command:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;wscript.sleep 4000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;coz I cannot open vbs here unless I press alt f11...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please advise.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Aug 2013 04:54:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638161#M90706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-24T04:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638162#M90707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I deal with that object requirement as follows.&lt;/P&gt;&lt;P&gt;Simply change your first 15 lines in your vbs-code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;If Not IsObject(application) Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; Set SapGuiAuto&amp;nbsp; = GetObject("SAPGUI")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; Set application = SapGuiAuto.GetScriptingEngine&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;If Not IsObject(connection) Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; Set connection = application.Children(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;If Not IsObject(session) Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; Set session&amp;nbsp;&amp;nbsp;&amp;nbsp; = connection.Children(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;If IsObject(WScript) Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; WScript.ConnectObject session,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "on"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; WScript.ConnectObject application, "on"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;session.findById("wnd[0]").maximize&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with these 9 new&amp;nbsp; lines of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;If Not IsObject(application) Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; Set SapGuiAuto&amp;nbsp; = GetObject("SAPGUI")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; Set application = SapGuiAuto.GetScriptingEngine&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;If Not IsObject(connection) Then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; Set connection = application.Children(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Set session = application.ActiveSession&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;session.findById("wnd[0]").maximize&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then write this line down when it's needed in your vbs code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;wscript.sleep 3000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'waiting for 3000 milliseconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In every of mine vbs code it still works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards, netkid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Aug 2013 14:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638162#M90707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-25T14:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638163#M90708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scriptman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are working on one of the VB Script , i would like to execute in SAP Application server using SM69 configuration ,&amp;nbsp; but i could not able to do that it is going into error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 11:45:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638163#M90708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-24T11:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638164#M90709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srini,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;It is best to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;open&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a new thread and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;post&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;there&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;your&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sample script&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt;ScriptMan&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 06:40:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638164#M90709</guid>
      <dc:creator>script_man</dc:creator>
      <dc:date>2014-06-27T06:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: VBS Script: Wait, Pause, Sleep</title>
      <link>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638165#M90710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From a programming standpoint using sleep states and wait states is not optimal, it makes the script unreliable and take longer to run than it strictly needs to.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will usually reference fields directly by ID and then write directly to them.&amp;nbsp; IE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,0]").text = "CC*"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or a simpler reference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;session.findById("wnd[0]/usr/txtMAX_SEL").text = "1000000 "&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wnd is the window, then there is a simple hierarchy, so wnd(window number]/[part of window]/[field name]).[text] = [in quotes, the text that should go into the field, or a variable/parameter (no quotes for those)]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the script recording feature to find out what the individual fields references are, or you can use GuiXT, navigate to a field, and note the field name in the GuiXT info box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using direct references like this, the system will automatically wait until a field entry is completed before moving to the next one.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel this is a more elegant solution than programing wait periods into the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 16:02:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/additional-q-a/vbs-script-wait-pause-sleep/qaa-p/8638165#M90710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-06-09T16:02:46Z</dc:date>
    </item>
  </channel>
</rss>

