I have a script attached for a button that resets a PM counter. Im making a template for each line. The Template has a custom property called "PMno"
I would like the PMno to point at the "20" in "WeekADDVAR20" and DateCalc20. What is the correct was the point at the PMno?
I would use an expression on the date tags instead of using a script. The script would write to an "offset" integer tag that would hold the weeks value, 20 for instance. That way you could use the tag value to know the date range without any kind of parsing if you needed it for other scripts.
The 20 is the PM number so i have a screen with a list of 20 PMs. The 20 I want to try to pull is from the custom property(PMno) of the template.
Example:
You are expecting a python string constant with braces in it to magically perform a substitution. Braces are an expression language tool to look up tags and properties, not python.
You need to construct that string with python operations. (It's v7.9, which uses python 2.5 syntax, so modern python's .format() isn't available. Use classic python's % string interpolation operator.)
Just to clarify a bit on what @dkhayes117 shows, if you have multiple values you want to substitute then you provide a tuple of those following the %, order in the tuple needs to match the order the parameters are provided in the string. The %s denotes that you are providing a string value. If you need to substitute formatted numbers then there is a different notation for that.