Page 1 of 1
Trying to create a 6 second delay VBScript
Posted: Wed Mar 02, 2016 12:13 pm
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.
Re: Trying to create a 6 second delay VBScript
Posted: Wed Mar 02, 2016 3:51 pm
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
Re: Trying to create a 6 second delay VBScript
Posted: Wed Mar 02, 2016 4:14 pm
by jackson41
I tried that and nothing.. for VBS you don't need the () but thanks anyway
Re: Trying to create a 6 second delay VBScript
Posted: Wed Mar 02, 2016 10:53 pm
by loicaigon
By the way, why would you choose scripting over Hold job configurator ?
Re: Trying to create a 6 second delay VBScript
Posted: Thu Mar 03, 2016 10:33 am
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.
Re: Trying to create a 6 second delay VBScript
Posted: Thu Mar 03, 2016 11:35 am
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());
}
Re: Trying to create a 6 second delay VBScript
Posted: Thu Mar 03, 2016 1:12 pm
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.
Re: Trying to create a 6 second delay VBScript
Posted: Thu Mar 03, 2016 2:31 pm
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.