Skip to content
OnDevice OCR Business Guides
Language

Extract the Invoice Number and Other Values for File Naming

How to extract the invoice number and insert it into the finished file name.

To demonstrate automatic file naming, we use this fictitious invoice in this example.

Option 1: Suggestions from the Document#

  1. Open OnDevice OCR Business and click “Name Files” → “New Template”.
  2. Click “Test with Sample Files” and choose one or more invoices.
  1. Remove the “Original Name” component by clicking the “x”.
  1. Click the “Custom Text” component, enter “Invoice”, and confirm the name with the Return key. Then add a “Space” by clicking that component.

    The preview already shows you what the future files would look like.

  1. Click “Suggestions from the Document” and then “Invoice No.”.

    In this case, OnDevice OCR Business analyzes the selected document to find the terms it contains along with their associated values. If the term you are looking for is not included, you can enter it explicitly as described in Option 2 and have the app search for it.

  1. You now see the invoice number that was found and can check whether it was found correctly.
  2. Now click “Add”.
  1. Give the template a name and click “Save”.

Done

You have now created your first custom template.

All files that you process with this template in the future and that have an invoice number will be named according to the pattern “Invoice invoice number.pdf”.

The invoice number here serves as an example of a changing value. It could just as well be a case number, a property number, a patient number, or something similar.

Of course, you can also combine several components – for example, to use the sender, invoice number, and amount in the file name.

Since all documents are processed and named exclusively locally on your Mac, the entire process is completely confidential.

Option 2: Search for your own terms#

  1. Open OnDevice OCR Business and click “Name Files” → “New Template”.
  2. Click “Test with Sample Files” and choose one or more invoices.
  1. Remove the “Original Name” component by clicking the “x”.

    Original Name = the original file name before naming.

  1. Click the “Custom Text” component, enter “Invoice”, and confirm the name with the Return key. Then add a “Space” by clicking that component.

    Custom Text = a fixed name of your choosing that all files with this template receive, e.g. “Invoice”.

  2. Click “Value from Document”.

  1. Now enter all spellings of the invoice number that appear in your invoices (e.g. “Invoice number, Invoice no.”), separated by commas.

    By specifying several spellings, extraction also works on different documents.

    Optionally, you can specify the position and length of the value.

  2. Confirm the entry with the Return key.

  1. The preview now shows you how the selected document would be named after processing.

    All files that you process with this template in the future and that have an invoice number in the document text will be named according to the pattern “Invoice invoice number.pdf”.

  2. Now give the template a name and click “Save”.

Done

Your template is now ready to use. Whenever you process documents – whether via a hot folder, in the processing window, or through Apple Shortcuts – you can now select it for naming.

Still have a question? Write to [email protected].