Have a look at the variable FME_MacroValues['WORKSPACE_NAME'], it will return the filename of the current workspace, without the fmw extension.
To see what is available in the FME_MacroValues dictionary, try the following in a PythonCaller:
import fmeobjects import pprint def showAllMacroValues(feature): pp = pprint.PrettyPrinter(indent=4) pp.pprint(FME_MacroValues)
Hi Goochy, I think there is no simple way, but FMW file contains each Workspace Property as a text line, form of the line is: #! <Tag>="<Value>" So, if the FMW file path of the target workspace can be clear, we can get Workspace Properties from the file.
The following script would get Title and Last Save Date from "C:\\test.fmw", for example. ----- import re, os # Define regular expressions (patterns) to find properties
# and change each pattern to Regular Expression Object. regex = { 'Title': '^#! TITLE="([^"]*)"$', 'Last Save Date': '^#! LAST_SAVE_DATE="([^"]*)"$' } for name in regex: regex[name] = re.compile(regex[name]) # Set FMW file path of the target workspace. fmwPath = 'C:\\\\test.fmw' # Get properties from the file. property = {} if os.path.exists(fmwPath): for line in [line.rstrip() for line in open(fmwPath)]: for name in regex: match = regex[name].search(line) if match: property[name] = match.group(1) # Use properties. for name in property: print '%s: %s' % (name, property[name]) ----- Oh, it'll be useless if the specification of FMW file format was changed...