Trying to create a 6 second delay VBScript

Post Reply
jackson41
Newbie
Posts: 11
Joined: Tue Apr 03, 2012 12:10 pm

Trying to create a 6 second delay VBScript

Post by jackson41 »

Hi I'm trying to create a 6 second delay (in VBScript) before moving a job into the next folder.
My Code:

Code: Select all

 Function jobArrived(s, job)

	job.log 2, "sleeping for 6 seconds..."
	WScript.Sleep 6000
	job.log 2, "6 seconds up"
	job.sendToSingle(job.getPath())

 End Function
I have no idea why it's not working.
loicaigon
Member
Posts: 147
Joined: Wed Jul 10, 2013 10:22 am

Re: Trying to create a 6 second delay VBScript

Post by loicaigon »

Hi,

Is it the forum discarding your parenthesis or the syntax not needing them ? I am a JS man, not a VB one but looking at some doc, it seems they are needed :
WScript.Sleep

Suspend the execution of the current script for the specified number of milliseconds.

Syntax
WScript.Sleep lngTime

Arguments:
lngTime is the delay in milliseconds
Sleep is a wscript method.
Example

WScript.Sleep(5000)
WScript.Echo("5 seconds have passed.")
http://ss64.com/vb/sleep.html
jackson41
Newbie
Posts: 11
Joined: Tue Apr 03, 2012 12:10 pm

Re: Trying to create a 6 second delay VBScript

Post by jackson41 »

I tried that and nothing.. for VBS you don't need the () but thanks anyway
loicaigon
Member
Posts: 147
Joined: Wed Jul 10, 2013 10:22 am

Re: Trying to create a 6 second delay VBScript

Post by loicaigon »

By the way, why would you choose scripting over Hold job configurator ?
jackson41
Newbie
Posts: 11
Joined: Tue Apr 03, 2012 12:10 pm

Re: Trying to create a 6 second delay VBScript

Post by jackson41 »

We have 10 jobs coming in all of the same time. I thought the hold configurator would hold all jobs for a period of time then pass it on to the next folder. So if all 10 jobs came in at the same time then they would be passed through to the next folder at the same time. I need to create a 10 second internal / gap between each job even if they arrive at the same time.
loicaigon
Member
Posts: 147
Joined: Wed Jul 10, 2013 10:22 am

Re: Trying to create a 6 second delay VBScript

Post by loicaigon »

Hi,

It might be a bad configuration of the script within Switch Scripter. What are the log messages ?
Do all of them appear ? Have you noticed any error message ?

Coudl you try javascript like this (almost identical):

Code: Select all

function jobArrived( s : Switch, job : Job )
{
	
	s.sleep(6);
	job.sendToSingle(job.getPath());
}
lombert
Member
Posts: 166
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Re: Trying to create a 6 second delay VBScript

Post by lombert »

jackson41 wrote:We have 10 jobs coming in all of the same time. I thought the hold configurator would hold all jobs for a period of time then pass it on to the next folder. So if all 10 jobs came in at the same time then they would be passed through to the next folder at the same time. I need to create a 10 second internal / gap between each job even if they arrive at the same time.
You have "Space jobs apart" with unit "Seconds/Minutes/Hour/Day" in the Hold configurator.

You find it in the outgoing connection in the botom.
Between jobs!
jackson41
Newbie
Posts: 11
Joined: Tue Apr 03, 2012 12:10 pm

Re: Trying to create a 6 second delay VBScript

Post by jackson41 »

lombert wrote:
jackson41 wrote:We have 10 jobs coming in all of the same time. I thought the hold configurator would hold all jobs for a period of time then pass it on to the next folder. So if all 10 jobs came in at the same time then they would be passed through to the next folder at the same time. I need to create a 10 second internal / gap between each job even if they arrive at the same time.
You have "Space jobs apart" with unit "Seconds/Minutes/Hour/Day" in the Hold configurator.

You find it in the outgoing connection in the botom.

thank you I didn't realise that there were extra properties when you clicked on the arrow.
Post Reply