Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › Form field data to word file template using java script?
October 16, 2020 at 7:34 AM #42289
has anyone tried to fill a fields in a Word file (template in Finder) with data from form fields using java script and adding this Word file to a record as file attachment?
Is that even possible?
ChrisOctober 17, 2020 at 11:47 PM #42295
I thought I’d replied to this but I guess I didn’t hit submit or something.
My immediate thought would be to use the clipboard to shuttle data around, encode it in Tap Forms and then use VBA to grab the clipboard and splice it into the template, if you put the file in the script directory for Tap Forms then you might be able to attach it via a script as well though it’s a little janky all told.
Some other folk have had success with AppleScript and also Keyboard Maestro that might be able to automate things.
I’m not sure any of it is a good solution for automating Word but that might help you along.October 18, 2020 at 11:48 PM #42296
But if you don’t need a Word file for this task, you could use Tap Forms with a custom layout and a static Text object on the layout. Within the text object, insert the field names with square brackets around the names and when you print, Tap Forms will substitute the values.
Dear [First Name] [Last Name], We have come to the realization that you need to pay $[Amount Due] by [Due Date] or you will be charged an additional [Penalty Percent]% interest on your loan. Sincerely, The Lending Company
You can even stylize the text within the Text object.
To add a Text object, click the Layout button, then click the A button above the layout inspector panel. Then click on your layout and type in your form. You can even paste from Word into there. But I would probably paste as plain text to remove any formatting and then use Tap Forms to format. Word might add all kinds of crap into the formatting that you don’t want.
If you need more than one page though, you can add another layout and then chain the layouts together.
BrendanOctober 19, 2020 at 12:45 AM #42300
Thanks for the hint.
I’m already using layouts as you described. But the main problem is, using layouts with long texts (so one have to use many layouts)… That is the reason i want to transfer field data from Tap Forms to the docx file …
ChrisOctober 20, 2020 at 1:26 AM #42318
Ah ok. I understand. I would like to enhance the layout engine to allow multiple pages per layout and have a text block span multiple pages automatically. On my wish list.October 20, 2020 at 1:32 AM #42320
That is on my wish list, too!
Do you know someone who can grant wishes? ;-)
You must be logged in to reply to this topic.