As the title suggests I need to create a variable from 2 parts of a file name to pass to an external program.
The input filename format (from folder capture) would be something like: 123456_xxxx_xxxx_xxxx-ABC001.ps
I need a variable created “on the fly” in workflow which would contain only the first and last parts separated by a space (excluding the extension) so the variable would look like: 123456 ABC001
I then want to use this variable to pass to an external program
Is this possible? If so, how could it be done?
I’m a novice so any help would be greatly appreciated.
In a Run Script plugin add the following VBScript code. In your process, right click the process name and select Insert->Local Variable. Rename the variable to newFileName. The below script takes the first 6 characters of your input file name (stored in myFile, %O is original filename without extension) and stores it into a variable called newFileName1, then the last six characters stored into newFileName2. At the end I set the local variable mentioned before by concatenating the two variables separated by a space.