This is the script looking for the static text trigger!
'********************************************************************
' Simple VBScript that will count the number of lines to determine the
' number of pages within the document.
' NOTE - There is no variable passed for a form feed so we will be going
' a static text identifier.
'********************************************************************
'********************************************************************
' Variable declaration
'********************************************************************
Option Explicit
Dim objFSO, objInputFile, objOutputFile
Dim strTempName, strTempPath, strLine
Dim lineCount, pageCount, firstTime, hasStars
pageCount = 0 'Counter for the number of pages
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Variable for the input file name
Dim m_FileName
m_FileName = PW_GetJobFileName
'********************************************************************
' Main
'********************************************************************
' Create the input text file object
Set objInputFile = objFSO.OpenTextFile(m_FileName, 1)
' Get the temp path
strTempPath = objFSO.GetFile(m_FileName).ParentFolder.Path
' Get the temp file name
strTempName = objFSO.GetTempName
' Create an opened temp output file
Set objOutputFile = objFSO.GetFolder(strTempPath).CreateTextFile(strTempName)
' First need to loop through the file to count the number instances of the trigger
Do While objInputFile.AtEndOfStream <> True
strLine = objInputFile.Readline
If (InStr(1, strLine, "SOME TEXT TRIGGER", 1)) Then
pageCount = pageCount + 1 'Incrimenting the page counter
End If
Loop
objInputFile.Close
objOutputFile.Close
' Replace the input file by the output file
objFSO.DeleteFile m_FileName, true
objFSO.MoveFile strTempPath & "" & strTempName, m_FileName
' Setting the jobInfo variables
' jobInfo 8 = pageCount
watch.setjobinfo 8,pageCount
_________________________
Wonderboy!