Unique document number/identifier custom meta data with auto increment

Is it possible to have an unique document number/identifier (integer) as custom metadata which is automatically incremented for each document?

That’s already possible, see Bates Number placeholder and same AppleScript property.

1 Like

It is possible to use a Bate Number placeholder in a smart rule.

As an example…

1 Like

@cgrunenberg @BLUEFROG Thank you very much.

@BLUEFROG @cgrunenberg Is it possible to have a custom bate number for each database? Or is it possible to create my own kind of bate number and save the current value in a plist file?

Is it possible to have a custom bate number for each database?

You’re welcome and no. A Bates number is global.

Currently you can’t change it on your own but the next release will have an AppleScript property to set the Bates number’s intiial value.

You could try to simulate that by having a record bates or so that contains the last number used. A script would then read this number, increment it, add it to the current record and write the new value back to bates. Although I can’t tell you if this might run into a race condition or not.

1 Like

@chrillek Thanks. Do you have an example for creating and saving such a record?

You mean for creating a text record and typing „0“ in it? I don’t think I can add anything to that description.

@chrillek How Do I access and update this record within in a script?

I suggest that you try your hand at it. There are a lot of AppleScript scripts available here in the forum, and some JavaScript code, too.

More on JavaScript and DT (as well as some basic stuff) here: Scripting with JXA | JavaScript for Automation (JXA)

If you have a concrete question, I’m happy to help.

1 Like