# Replace string with date or number on save

**URL:** <https://forums.creativeclouddeveloper.com/t/replace-string-with-date-or-number-on-save/1815>\
**Category:** UXP Plugin API\
**Created:** [June 2, 2020, 4:14am UTC](https://forums.creativeclouddeveloper.com/t/replace-string-with-date-or-number-on-save/1815 "2020-06-02T04:14:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Velara](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/velara/32/1278_2.png) [@Velara](https://forums.creativeclouddeveloper.com/u/Velara)\
**Post date:** [June 2, 2020, 4:14am UTC](https://forums.creativeclouddeveloper.com/t/replace-string-with-date-or-number-on-save/1815/1 "2020-06-02T04:14:57Z")

</div>

I’d like to be able show the current version or date saved of the XD project in an artboard or somewhere visible every time I save the project.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/1X/cfa96a8e05757e413d7c8566d49b16e40c5cbbad.png)

When I save the document right before hand update a version or date string.

Let’s say I’m working on a XD project every day that others are using. I want to make sure that they are using the same version.

It might be possible to do this with a plugin that would find a text field and replace it’s value but that would mean being able to detect a `before-save` event, modify the text field and then allow the save to continue.

Or have a Save API where a plugin would update a version number and then save the document.

Or a plugin that updates the version number (this is possible now) and then the user manually saves. That’s more error prone because the user could forget to update the version string.

In summary:

- Feature request for `before-save` event for UXP
- Feature request for a `save` event for UXP
- Feature request for API to call `save()` on a document
- XD feature to automatically update a specified text field with version or date on save

Related Feature Request

> [@Get version of XD project](http://forums.creativeclouddeveloper.com/t/get-version-of-xd-project/1494):
>
> It looks like a sort of versioning is supported in XD projects. Is it incremented on save? Would it possible to get this value? Use Case Sasha is working on new project at her university. They’ve chosen to put their projects to version control. But working on a team they have no idea what version of the project is what. So they’ve created a plugin that creates a text file with the current XD project version in it. Every time the document is saved, they run their plugin that creates a new text …
