Hi,
Since we have no control over the names of the snap shot images (graph1, etc.), the only solution is to create each report in a separate folder.
In the
Report object you can specify the unique part number for the
Output directory. This way you are ensured that each report is created in its own folder and the graphics are unique to that report.
HOWEVER, there's a problem as you might have discovered. The
Output directory data member of the Report object expects a pre-existing folder -- it will not create a folder if it's not already there.
So, the problem boils down to how to create new folders from within Lookout. Windows scripting is a relatively easy option. We will have to run the script using the
Run object.
I am attaching a Windows Host Script which takes an argument (folder path) and creates the folder. In the example I input this folder path in a TextEntry object (you can replace this with whatever is the source of your part numbers).
Executing this script with the Run object is tricky because we first need to launch the WScript.exe, then pass the script file, and finally the folder. This means a whole bunch of double qoutes and &s!
The command line of my Run object looks like this:
"""WScript.exe"" ""c:\temp\cfolder.wsf """&" "&TextEntry1.value
Please detach the cfolder.wsf script file to your c:\temp folder, or change the path in the above command line. You can test this with the attached Lookout process file: createfolder.lks (change file types to LKS when opening this in Lookout).
Here's more info' on Windows Host Scripting
And here's a KB article on using the Run object with arguments.
The other option is to move the report as soon as it is created to a different folder so that the next report doesn't overwrite the graphics. This too can be accomplished using the move methods available in Windows scripting.
Hope this helps.
Regards,
Khalid