I'm not quite sure I understand what you want, but if you want a scripted private parameter to add double backslashes to a public parameter containing a filename, you could use the following code in your Python scripted parameter:
import fme
file_path = fme.macroValues.get('FILE_PATH', '')
return file_path.replace('\\', '\\\\')
Be aware that there are no checks on whether FILE_PATH already contains double backslashes.
I'm not quite sure I understand what you want, but if you want a scripted private parameter to add double backslashes to a public parameter containing a filename, you could use the following code in your Python scripted parameter:
import fme
file_path = fme.macroValues.get('FILE_PATH', '')
return file_path.replace('\\', '\\\\')
Be aware that there are no checks on whether FILE_PATH already contains double backslashes.
@david_r Yes, i want to grab the file path from a public parameter(C:\Users\Username\Documents\file.txt'), modify it through the scripted parameter (Private) by adding double slashes C:\\Users\\Username\\Documents\\file.txt to be used as value in the transformer PDF2TEXTREADER
@david_r Yes, i want to grab the file path from a public parameter(C:\\Users\\Username\\Documents\\file.txt'), modify it through the scripted parameter (Private) by adding double slashes C:\\\\Users\\\\Username\\\\Documents\\\\file.txt to be used as value in the transformer PDF2TEXTREADER
You could also simply drop the Python code and use a ParameterFetcher to retrieve the path, then a StringReplacer to replace \\ with \\\\ before sending it to the PDF2TEXTREADER.