IDE scripting set app version

Is there any way to set the application (build) version by ide scripting?

I do have a few apps that I build after each other driven by one IDE script.
Open project, build, save, close, open other project, build, save close …
I need a ide scripting line to set the version. So i can made them equal to all the projects.

Try

PropertyValue("app.majorversion") = "17"

MinorVersion and BugVersion also work.

HI Greg,

I tried this but it didn’t result in a new version.

Also strange: print PropertyValue(“app.majorversion”) result in a blank messagebox.
I would expect the major version of my app in a messagebox. In my case 7

How have you done this? Works fine for me with Xojo 2017r1 on Sierra. I created a blank new project and added a script with just the line

print PropertyValue("app.majorversion")

before the build step and got a “1” as result.

[quote=325260:@Marc van Buel]HI Greg,

I tried this but it didn’t result in a new version.

Also strange: print PropertyValue(“app.majorversion”) result in a blank messagebox.
I would expect the major version of my app in a messagebox. In my case 7[/quote]
Where did you put this code? An ide script that you run from the file menu? A build script in the project itself? Or as part of a script that you send using IDECommunicator?

I made a simple script, saved it in .xojo_script extention and start it from Windows File Explorer.
A xojo screen with script, play and stop buttom comes up. I run it by pressing play.

[code]Dim strFolder as string
Dim strMajorVersion as String
Dim strMinorVersion as string
'--------------------------------------------
strMajorVersion = “7”
strMinorVersion = “4”
strfolder = “D:\Projects\Orca”
'--------------------------------------------

'main project
OpenFile(strfolder + “OrcaV7.xojo_binary_project”)
PropertyValue(“app.majorversion”) = strMajorVersion
PropertyValue(“app.minorversion”) = strMinorVersion
BuildWin32 = True
DoCommand(“BuildApp”)
DoCommand(“Savefile”)
DoCommand(“CloseWindow”)
Print(“Orca Build Complete”)
speak(“Orca Build Complete”)

'module projects 1
OpenFile(strfolder + “Orca_Sync.xojo_binary_project”)
PropertyValue(“app.majorversion”) = strMajorVersion
PropertyValue(“app.minorversion”) = strMinorVersion
BuildWin32 = True
DoCommand(“BuildApp”)
DoCommand(“Savefile”)
DoCommand(“CloseWindow”)
Print(“Sync Build Complete”)
speak(“Sync Build Complete”)

'module project 2
OpenFile(strfolder + “Orca_Docs.xojo_binary_project”)
PropertyValue(“app.majorversion”) = strMajorVersion
PropertyValue(“app.minorversion”) = strMinorVersion
BuildWin32 = True
DoCommand(“BuildApp”)
DoCommand(“Savefile”)
DoCommand(“CloseWindow”)
Print(“Docs Build Complete”)
speak(“Docs Build Complete”)[/code]

Do me a favor and use the native BuildApp command instead of trying to call a menu…

[code] // 3 = Windows, 4 = Linux, 7 = Mac
Dim Target as integer = 3

// Whether or not you want the build folder to appear afterwards
Dim Reveal as Boolean = False

// If successful, BuiltPath will contain the path to the built app, if not, it’ll be an empty string
Dim BuiltPath as String

BuildPath = BuildApp(Target, Reveal)[/code]

More build targets and syntax can be found here.