Hi Greg,
thanks for your answer. Sad to hear its a bug that has been going for so long, but at least its not me being stupid... ;-)
It appears that 'win -o' works with shortnames only, so I had to adapt your script like this to get it working (not sure if the if-statement is necessary):
// BEGIN SCRIPT
stringarray sa;
doc -e P {
%A = %H;
if(%[%A] > 0) sa.Add(%A); // Just add the name to the array
}
// Now loop over the array elements
loop(ii,1,sa.GetSize())
{
%A = sa.GetAt(ii)$;
win -o %A {save -i %(page.longname$);}; // Make it active, save it
}
But you can use '%(page.longname$)' inside the command given to 'win -o', so the files are saved with the longname as intended.
Thanks for your help, now I know how to work with arrays, too. Very smooth.
Regards,
Johannes