Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › Auto create records with photos
Tagged: automation
- This topic has 6 replies, 4 voices, and was last updated 4 years, 5 months ago by Daniel Leu.
-
AuthorPosts
-
May 25, 2020 at 7:15 AM #40682
Marc ReichertParticipantHello everyone,
Tap Forms seems like the perfect solution to what I have to do and I think I will buy the Mac version regardless of the outcome of this question.
I am not sure if I can create a fully automated solution to the following problem as I have read about the problem of local file access restrictions in this forum. Nevertheless, I did not find an entry in the forum or in the support area that was specific enough to give me a final answer and I could imagine that this could also help others.The task is to catalog a really large amount of artwork, including photographing and collecting all of the metadata like size and type with a small preview image in a database (which appears to be Tap Forms).
To achive maximum throughput, I want to print labels with barcodes in advance (they have to be durable and good thermal transfer label printers are prohibitively expensive, so printing the labels afterwards is not an option). Then I would place a barcode on the back of the artwork and scan the code in the photo software to generate coherent file names for the images. These images are saved, for example, in a shared folder.
The perfect solution from there on would be to use Automator to create a “folder action” that runs a script to generate a new database record with the image and ID based on the file name each time an image is added to the folder.Am I right that this is not possible due to the limitations of sandboxing? Or can I bypass those by sending those files to the Mac via the FTP-Connection or by directly writing them into the Tap Forms Documents area?
Are there other ways to automate something in this process?Thanks in advance
MarcMay 25, 2020 at 12:32 PM #40688
BrendanKeymasterHi Marc,
Well, Tap Forms does have a function for importing photos in batches. But it’s tied to the Import Records feature. You need to also have a CSV file that has a photo field in it that has names that match the filenames of the photos. On the Import Records screen you select the CSV file to import plus a folder of photos. Tap Forms will then match up the photo filenames in the CSV file with the actual photo files on disk and will then import them into the document. Perhaps that’s a way you can get the data and photos into Tap Forms.
Thanks,
Brendan
May 25, 2020 at 3:33 PM #40695
Sam MoffattParticipantI have a bunch of processes where I scan in receipts and have those automatically upload into a Tap Forms document via the CouchDB sync. I wrote a blog post on using PHP and CouchDB to upload receipts which could be modified to do a similar thing for your own project.
I have some local changes that I need to clean up as well that make it a little easier to configure but that approach would work. I use it with a scanner but if you dropped files in the directory using any program then it’ll pick them up and import them. If there is special encoding in your filename then you could also use the PHP script to extract that into a field as you import them into CouchDB as well. CouchDB sync with Tap Forms then will pull the changes back into Tap Forms where you can edit the newly uploaded entries.
I have a few different uses these days beyond my fuel receipts that I wrote in the blog post, I set one up for my work related expenses as receipts and I also now scan invoices for purchases I receive from different vendors. In the past I’ve used similar scripts to bulk import images as well, at one point I imported a copy of Digital Blasphemy’s ZIP files into a Tap Forms document.
May 28, 2020 at 1:43 PM #40714
Marc ReichertParticipantThank you for both of your answers!
@Brendan I will keep that in mind for other projects, but here I won’t be able to import the data in bulk, because the process should be streamlined like a production line. An artwork will be captured by one person while the other will then generate all the archival details needed, then it will brought into storage and the process starts again.
@Sam Moffatt I think I can follow your description and read your blog post but I’m not shure if I’m competent enough to modify your project to my own needs. Do I get this right that you directly inject database entries in the correct structure into the (sync)storage of TF which will then replicate to the local application data? I guess for the start we will go the manual way and create the records by hand and as it won’t be me hitting the select button some hundred times I’m not too bothered ;) But perhaps I could use this project to finally learn some JS programming.
May 28, 2020 at 7:09 PM #40719
Sam MoffattParticipantWhen you enable the CouchDB integration, Tap Forms writes to the CouchDB server in Tap Forms’ own format and sync’s that with each of the devices that are connected to that server. You can get to that data using the standard HTTP REST interface that CouchDB exposes and do interesting things with it, that’s how my TF Tools repository on GitHub works to do stuff like backups, dump document structures and pump data to ElasticSearch for visualisation (before Brendan added charts natively). All of that code is in PHP rather than Javascript because PHP is a language I’ve done a lot of code in and is reasonably portable.
Since the CouchDB API is a standard open interface, we can see what the format is that Tap Forms is writing and whilst it’s a little opaque with the field names it’s not impossible understand the format. If we write data in the same format that Tap Forms is expecting, then Tap Forms will display the records and let you interact with them. As far as your Tap Forms app knows the record came from another instance of Tap Forms.
I’m working on another blog post on how I use Safari to scrape this forum as I navigate it with a Tampermonkey script that writes to CouchDB. I then use Tap Forms to do my own search of the forum and create custom saved searches. Follows a similar concept where I create the structure in Tap Forms and then create records matching the structure via CouchDB’s REST API using Tampermonkey. I have a few tricks around record ID generation to make sure I don’t import something more than once as I navigate around.
May 28, 2020 at 8:28 PM #40720
Daniel LeuParticipantI would try something different: Save the image into a Dropbox folder, then have an AppleScript get the URL link and launch a Form script using the tapformz URL and use the shared link (and whatever else you need) as a parameter. Then in the Form script, you can create a new record, add data entries given via the parameter and fetch the image from the Dropbox link and attach it to the record.
I think this should work, but haven’t tried it!
June 3, 2020 at 7:24 PM #40793
Daniel LeuParticipantHi Marc,
I looked into my approach of using Dropbox and it works. Have a look at my blog post where I show how to automate photo import with Automator and Dropbox: http://lab.danielleu.com/blog/using-automator-and-dropbox-to-automate-photo-import/
-
AuthorPosts
You must be logged in to reply to this topic.