Skip to main content
Inspiring
June 17, 2024
Answered

Is there a variable for the current batch round when using batch actions?

  • June 17, 2024
  • 2 replies
  • 369 views

Hi,

For years I've been using scripts in batch actions, because I often need to make designs with different QR-codes. Until now I could always make it work with my limited C# knowledge and scripts I found online. But now I'm facing a new challenge: besides a different QR-code, I now also need to change the displayed name in every file. I know I can do the latter with the Variables panel, but I don't think I can make this work with my other scripts. So I would like to script something like the Variables feature does. What I can't seem to find however, is how to target the batch round number. Something like "batchround(n)"? I assume there is an existing variable for this, but I can't find anything about it. With this, I can target a row in an .xml of .txt file with the names in it. So; anyone who knows this? 🙂 Thanks!

This topic has been closed for replies.
Correct answer Mark5C74

For now I found another workaround, which is even better for this situation actually; I turned the QR-code into a dynamic object in the Variables panel.  With this method they become variable, and if I save the QR-codes as separate .ai files, they work just like the names. I list the names and the QR-code locations in a .csv file, and batch process them as a dataset.

 

So for now I'm good and I'll leave this solution here in case it's helpful for anyone else. But I would still really like to know the answer to my question, so I'll leave that open as well. 🙂

2 replies

Mark5C74AuthorCorrect answer
Inspiring
June 20, 2024

For now I found another workaround, which is even better for this situation actually; I turned the QR-code into a dynamic object in the Variables panel.  With this method they become variable, and if I save the QR-codes as separate .ai files, they work just like the names. I list the names and the QR-code locations in a .csv file, and batch process them as a dataset.

 

So for now I'm good and I'll leave this solution here in case it's helpful for anyone else. But I would still really like to know the answer to my question, so I'll leave that open as well. 🙂

CarlosCanto
Community Expert
Community Expert
June 17, 2024

what's a batchround? is it a row in a txt file or spreadsheet that represents a record?

Mark5C74Author
Inspiring
June 17, 2024

No, it's the index of the iteration of the loop. So if you batch action 20 files, the first file would be [0], and the last file would be [19]. 🙂

 

I used the wrong brackets in my example, sorry. That should be "batchround[n]".