# Programmatic file versioning

**URL:** <https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457>\
**Category:** Automation\
**Created:** [August 11, 2026, 5:54pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457 "2026-08-11T17:54:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![b3d0u1n](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e495f1/32.png) [@b3d0u1n](https://discourse.devontechnologies.com/u/b3d0u1n)\
**Post date:** [August 11, 2026, 5:54pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/1 "2026-08-11T17:54:06Z")

</div>

Is it possible to create a versioned file programmatically ? I would like to be able to set up some automatic rules/batch processes to create versions for certain files on a scheduled basis.

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [August 11, 2026, 6:02pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/2 "2026-08-11T18:02:05Z")

</div>

So, you want to create a new verson every second day or so? Why, if nothing changed?

---

<div class="post-metadata">

**Author:** ![b3d0u1n](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e495f1/32.png) [@b3d0u1n](https://discourse.devontechnologies.com/u/b3d0u1n)\
**Post date:** [August 11, 2026, 6:09pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/3 "2026-08-11T18:09:08Z")

</div>

This is for a very small set of files … specifically they are tinderbox files. Due to the nature of that application there are modifications made in the background, so they change quite regularly even without direct modification on my part.

From my perspective, having a batch process that I could apply to a smart group which collects files changed within - to use your parameter - the past 2 days, would avoid mindlessly adding revisions.

It would be extremely helpful to be able to augment my workflow.

Thanks

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [August 11, 2026, 6:15pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/4 "2026-08-11T18:15:02Z")

</div>

A customized version of these former smart rules might be useful:

> [@I deleted the default smart rules 'Create Version' and 'Remove Obsolete Versions'. Where can I recover them?](https://discourse.devontechnologies.com/t/i-deleted-the-default-smart-rules-create-version-and-remove-obsolete-versions-where-can-i-recover-them/76981):
>
> I deleted these two default smart rules, which would be very useful for me now. I didn’t think I would ever use them, but turns out I need them. How can I recreate or reproduce them? Could someone kindly provide guidance or simply share a screenshot? Thank you.

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [August 11, 2026, 6:16pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/5 "2026-08-11T18:16:53Z")

</div>

You could try to use a smart group selecting all files whose “change date” is two days or so. And then create new version for all files in that group. Though I don’t know how fine-grained the date check is. If a file is changed two days ago, that condition might be true for the next 23 hours.

And that can be combined with a small script creating a new version. There’s code showing how to do that in DT’s scripting dictionary.

---

<div class="post-metadata">

**Author:** ![DTLow](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/dtlow/32/18161_2.png) [@DTLow](https://discourse.devontechnologies.com/u/DTLow)\
**Post date:** [August 11, 2026, 6:23pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/6 "2026-08-11T18:23:35Z")

</div>

I use Smart Rules and AppleScript

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [August 11, 2026, 8:42pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/7 "2026-08-11T20:42:01Z")

</div>

Foundation models from Apple Intelligence are quite limited but can be suitable for a task this light. Here is a batch processing configuration using the `Chat - Continue if` action we blogged about recently.

[Increment Counter in Name (AI).dtBatchProcess.zip](https://discourse.devontechnologies.com/uploads/short-url/yJk4BLqtZ1KiM9cDX7XSpNrP5Ci.zip) (1.5 KB)

The only requirement is to have a filename with a counter in it. I tested with e.g., `test 0001.txt` so a four digit zeropadded counter before the file extension.

PS: This is a proof-of-concept to show a possible approach. Logically, you’d need to adjust the config for your own situation.

PPS: Add a custom shortcut key to launch it and you can quickly increment your filenames.

---

<div class="post-metadata">

**Author:** ![b3d0u1n](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e495f1/32.png) [@b3d0u1n](https://discourse.devontechnologies.com/u/b3d0u1n)\
**Post date:** [August 14, 2026, 6:02pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/8 "2026-08-14T18:02:30Z")

</div>

This is an interesting approach - I will experiment with this further.

---

<div class="post-metadata">

**Author:** ![b3d0u1n](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/b/e495f1/32.png) [@b3d0u1n](https://discourse.devontechnologies.com/u/b3d0u1n)\
**Post date:** [August 14, 2026, 6:04pm UTC](https://discourse.devontechnologies.com/t/programmatic-file-versioning/87457/9 "2026-08-14T18:04:10Z")

</div>

The create version smart rule does the trick. I learned a lot from it. I actually understand how the built in versioning facility with versioned databases works now 🙂

For my requirements the script does what I need.

thanks
