Get version of XD that saved the project and if possible created the project

Get version of XD that saved the project. And if possible get the version of XD that created the project.

var createdByVersion = rootNode.projectCreatedVersion;
var savedByVersion = rootNode.projectSavedVersion;

Use Case
John and Linda are working together on a project for NOAA. John lives on the east coast and Linda on the west. They are sending an XD project back and forth. Over time they have had issues where John would have to upgrade XD to use the project Linda saved and vice versa.

They are using a plugin to bring data on climate change and populate a repeat grid. To make versioning more simple the plugin author wants to show the version the XD project was saved with. Then Linda knows ahead of time that if John is using XD 24 and she is using 26 and then she knows to tell him to upgrade or be on the same page when writing their documentation.

You can store application.version in pluginData of root node and update it on each plugin command execution if application.version > pluginData.appVersion. If application.version < pluginData.appVersion you can prevent command execution and show some kind of dialog with update instructions.

Hope this helps somehow

3 Likes

Thank you. I started doing something like with the version in the plugin data on the root node but it would be a good idea in my case to start saving my plugin version number and XD version number in the plugin data for each scene node. :slight_smile:

FYI XD has that save information saved in the file already because when you go to open a project that is newer than the XD you have installed it will say,

~This project has been saved with a newer version of XD than what you have installed. Upgrade XD to open this project.

The created version would be helpful since in the past there were a few major changes to UXP when pluginData was introduced and CSS parity was introduced. So if a user or I am having issues I can check the project created version and see if that is related to the issues or not and have them copy and paste their artboard into a new project and test or reset the plugin data and test to see if that fixes it.

1 Like