Using VBScript with Printer Code Modifiers |
'The variable found defines whether the portion
'of code has already been modified
'Initially, the code has not been modified, and is set to False
found = False
'Read each line of print code in the object PCM
Do Until PCM.FileAtEOF
'Define a variable that holds the line of print code being read
variableLine = PCM.ReadLine()
'Check to see if the line of code needs to be modified
If variableLine = "My criteria" Then
'Check to see that the line has not already been modified
If found = False Then
'Modify the contents of the line
PCM.WriteLine("My New Value")
'Set found to True
found = True
Else
'If none of the previous are true,
'rewrite the unmodified line to PCM
PCM.WriteLine(variableLine)
End If
End If
Loop
Related Topics