Hi,
long time reader, first time poster. I know a little about AS, but a lot is just do and learn as I go! Forgive me if this is in the wrong forum.
I’ve created a script that activates from a csv being dropped in my Dropbox folder (so can activate this from my phone), moves the file to a folder where Excel picks it up, does some formatting and sorting, saves in another folder which then opens InDesign, opens a template, opens the data.csv, merges the doc, saves as a PDF, closes both docs (without saving, they’re not needed), trashes the .csv, rename the PDF with the date and timestamp of that second, uploads the PDF to an FTP and back to Dropbox where I get a notification on my phone.
That part was easy (if you want this script, let me know and I’ll post it up, except for the Excel script as it’s not mine to distribute…).
What I need to do is insert an action after Excel has done its’ bit. I started writing the script, but I’m having all sorts of issues, so it’s not really worth posting up how little I made.
Excel is going to break the csv down in to smaller bite-size chunks so InDesign can process it quicker/easier as there’s a varying amount of letters to merge. Could be 1,000 could be 10,000. Excel is going to save them in 2,000 chunks.
Here’s the challenge;
An unknown amount of data.csv’s (data.csv, data1.csv, data2.csv etc) will be in saved to folder1 and this number needs to be saved for later. I’d like a script that moves ‘data.csv’ to folder2 which will trigger the above action. That much I can do. Then when the above script delets the data.csv, the new script must rename the next file in the queue (so data1.csv) to data.csv and move it to folder2 to fire InDesign again, and so forth until folder1 is empty. The the saved file amount number is passed to the next part of the script (or a new one) where it’ll wait for the same number of PDFs to be made and put in to folder3, then combine all the PDFs and move to the last folder4 (where it gets renamed and moved accordingly).
It’s taken a while just to think of how I can break this down like this, open to suggestions if anyone else knows better…?
I’ve been breaking down a possible script in to chunks, but the waiting for folder2 to be empty to rename and move the next file is a bit of a kicker for me!
Any thoughts? Thanks in advance for any replies!