From 5777ca33fc6c5ac01065d88d682e7f144881b0f0 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Tue, 25 Jun 2024 17:52:32 -0700 Subject: [PATCH] Determine scanned pdf date upon completion This ensures that multi-page documents and documents where input is awaited for a long time before writing use the time the file is written, as opposed to the time the first page started scanning, in the filename. --- src/.bin/manuscan.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/.bin/manuscan.sh b/src/.bin/manuscan.sh index b64fc04..a3500fb 100755 --- a/src/.bin/manuscan.sh +++ b/src/.bin/manuscan.sh @@ -13,8 +13,6 @@ SCAN_OUTPUT_DIR=~/Pictures/Scans TMP_DIR="$(mktemp -d --suffix='scans')" while - scan_output_filename=scan_"$(date +%Y-%m-%d-%H-%M-%S)" - page_number=1 while echo "Scanning page $page_number" @@ -29,6 +27,7 @@ while echo # convert image sequence to pdf + scan_output_filename=scan_"$(date +%Y-%m-%d-%H-%M-%S)" convert "$TMP_DIR"/*.tiff "${SCAN_OUTPUT_DIR}/${scan_output_filename}_raw.pdf" # compress pdf