By any chance, is the "folder x" a variable on the source file data card, then you can use that information in building the PDF output path.
Maybe not the best example, but it took little effort to test and the concept should be clear:
My project folders consists of two variables, project number and project name, like 2017-0003 Body Kit.
The files i put in this project will inherit those values to their data cards.
When i run PDF task on a Word doc, these values will be part of building the output folder path, so in Task setup it will look like:
<RootFolder>\Projects\<%Project number%> <%Project Name%>\Documentation\PDF\<FileName>
Where the values within %% are my "folder x".
Anyway, just an idea
Thank you for your response.
Unfortunately, 'Folder X" isn't a variable at the moment. And to complicate things, "Folder C" could have subfolders with subfolders in it. Also, "Folder C" could be "Folder E", "Folder F, etc. So basically the only fixed folders are "Folder A", "Folder B" and "Folder X".
I could look into using variables to drive the output path, as your suggest, but because of the previous it's going to be a bit challenging to derive the folder structure under and name of "Folder C", so to speak, unless all folders are assigned a variable perhaps.
This all can be avoided if with a couple of lines of code that replace "Folder B" with "Folder X".
Any coding gurus out there?
So, I've made some progress but it's still not quite resolved yet.
In the Advanced Scripting Options I've added the following lines of code at the location shown in the attachment:
'Build destination filenames
Dim Ext = Path.GetExtension("<SourceFileName>")
Dim Path1 As Object = Path.Combine("<SourceFolderPath>", "<SourceFileName>")
Dim convFileName As Object = Path1.Replace("Folder B", "Folder X").Replace(Ext, ".pdf")
I'm sure there are better ways to do this but this creates the desired filepath including the filename.pdf
Then, I've replaced all occurences of "<OutputPath>" in the rest of the script with convFileName.
So, the result is that the task creates the pdf in the desired location but it leaves it checked out with no data card variables copied to the pdf.
The task shows up in the task list as failed and the error log gives me the following error:
Error: The supplied object ID is not valid
Would anybody have an idea what causes this error? I feel like I'm so close to resolving this