I'm trying to keep this all within the same process.
If I use a branch with a Send to Folder printer to create the Optimized Postscript file and then use a folder capture to pick up the file and continue on.
Is the Optimized Postscript file fully created before the process moves on to the next step of the workflow or will I need to use a script
(example below) that checks for the existance of the file before proceeding to the next step?
Dim objExists
Dim sFileName, sFilePath, i
' Set initial variable values
sFilePath = "C:\Print2Folder\"
sFileName = sFilePath & Watch.GetVariable("sUnique")
' Use all UPPERCASE for constants
Const SCRIPTID = "FXST"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Main
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
OpenFiles()
ProcessFile()
CloseFiles()
Call xWriteToLog("F", SCRIPTID, "Loop count = :" & i, 3)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Sub-Routines
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ProcessFile()
For i = 1 To 100
If objExists.FileExists(sFileName) Then
Exit for
Else
Watch.Sleep 100
End If
Next
End Sub
Sub OpenFiles()
' Startup FSO
Set objExists = CreateObject("Scripting.FileSystemObject")
End Sub
Sub CloseFiles()
' Clean House
Set objExists = nothing
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Functions
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function xWriteToLog(debug, scriptid, msg,level)
' Valid level values
' 1 = Error
' 2 = Warning
' 3 = Information
' 4 = Debug
' Gather current date from PlanetPress Watch
Dim processDate
processDate = Watch.ExpandString("SCRIPTLOG: %y-%m-%d - %h:%n:%s")
' Write entry to the PlanetPress Watch Log
If debug = "T" then
Watch.ShowMessage(processDate & " - " & scriptid & " - " & msg & " - " & level)
Else
Watch.Log processDate & " - " & scriptid & " - " & msg, level
End If
End Function
I would also need to use a JobInfo along with a local variable to identify which file to pick back up.