I am new to data merge so can be missing something obvious.
Here I posted the whole script and the test file, in case someone would like to play with it.
It exports multiple pdf files using Data Merge feature: each record corresponds to a specific language.
The problem is that for the last language in the chain – Hungarian – it should execute another script (via doScript) which runs a few find-change queries. (Both scripts should be located in the same folder.) But before that I should activate the record 3 (for Hungarian)
Manually, I just turn the Preview on and select, say, record 3, but I can’t find the scripting equivalent for these two steps.
I tried the following trick, but it didn’t work:
I made Hungarian the 1st language to be exported in the code.
Activated manually Preview and selected the 3rd record
But this resulted in an error on export command:
Obviously, the same happens with hidden panel.
I tried to cheat it and turned Preview off leaving the 3rd record active, like so:
But this also resulted in the same wrong output as before.
As far as I understand, the only option is to split this script into two: one for Hungarian and another for the rest of languages.