Script Not working for 2022 Release 1

Have script that pulls version into a constant. Updated version in XOJO (2022 release1) but when I build the app it still has the old version. Xojo shows the new version. Any hints?

Could you show us the script?

var v() as string
v.append PropertyValue(“scus.MajorVersion”)
v.append “.”
v.append PropertyValue(“scus.MinorVersion”)
v.append “.”
v.append PropertyValue(“scus.BugVersion”)
'v.append " ("
'v.append PropertyValue(“scus.NonReleaseVersion”)
'v.append “)”

var m as string=join(v,"")

ConstantValue(“Module1.kVersion”)=m

var v1() as string
v1.append “(”
v1.append PropertyValue(“scus.Copyright”)
v1.append “)”

var m1 as string=join(v1,"")
ConstantValue(“Module1.kCopyright”)=m1

and screen shots where script is located and version info.

Funny think is it is showing the previous version number when I run in simulator or build.

Screen Shot 2022-04-16 at 9.07.08 AM

Uh… in that script, the items that set up the version number are all commented out.

Edit: NM I see that it’s only the last segment.

Try putting Print m after the join.

Also, make sure you remove the old one from the device/simulator. I’ve seen cases where they will launch an older version.

No luck.
It’s like the constant is not getting updated…How is that it is still finding 2.9.6 even though the in xojo shared fields for version shows 2.9.8.

In the window for Xcode transferring the app to phone it has the correct version.

Is there a better way to grab the version?

I had a default value for the constants that’s why they appear to work. If I delete these then the is no copyright or version displayed. So I guess the script is not executing or there is some error.

If I paste script into the IDE New Script menu. And run, it works.

NVM: Script has to be after Build not before. And it works