Jump to content

Run the script in background


Recommended Posts

Hi Guys, I want to run the scripts in the background so that I can continue other work. To be specific, when I am running my Job from Jenkins then it should run in the background.

I have seen a couple of posts but they are not much help. Is anyone done recently? 

Any pointer would be really appreciated.

 

Link to comment
Share on other sites

  • Developers

What isn't working from the background? Just like I mentioned in the other thread... it really helps when you share details to be able to help you.

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi Jos, Below is my script and I want to run the actual navigation in the background from beginning till the end. So when I start running the scripts, it will run in the background and once it's finished, I can directly go to my folder and see the log file. 

Hope this help and if you need any more details can you please be specific as I am new to this.

 

#include <Date.au3>

;Set variable and path
$exePath =".exe path"
$logPath="log path"
$saveAsWin = "Save As"

;Locators
$winTitle = "windiw title name here"

;Launch the executable filC:\Autoite
Run($exePath,"")


While Not WinExists($winTitle,"")
   WEnd
;Wait for some seconds

;Check  the CiAssign window is launch or No

if WinExists($winTitle,"") Then
   SendKeepActive($winTitle)
      Sleep(500)
   ;Wait for some seconds and navigate to the database
   Sleep(2000)
   Send("!f")
   Sleep(2000)
   Send("{ENTER}")
   SendKeepActive("")
   ;Setup a mechanism to to get the System current date and time
   ;and contcatinated with generated log files
   $tCur = _Date_Time_GetSystemTime()
   $string = _Date_Time_SystemTimeToDateTimeStr($tCur)
   $string2 = StringReplace($string,'/','')
   $string3 = StringReplace($string2,':','')
   ConsoleWrite($string3)
   $text = ControlGetText("Save As","","[CLASS:Edit; INSTANCE:1]")
   ConsoleWrite($text)

   ;Logic to save to log file at given location
   Sleep(2000)
   Send($logPath)
   SendKeepActive($saveAsWin)
   Sleep(2000)
   Send("{ENTER",false)
   Sleep(2000)
   Send("^a")
   Sleep(2000)
   Send("{BACKSPACE}")
   Sleep(2000)
   Send("CiAssignLog_ " & $string3 & ".txt")
   Sleep(5000)
   Send("{ENTER}",false)
   SendKeepActive("")
EndIf


 

Link to comment
Share on other sites

  • Developers

I am sorry, but am not your "on demand scripting boy" so please show some patience. I am now off to the beach as I am still enjoying a vacation. ;)

Jos

Edited by Jos
Typos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...