View Full Version : ExportLayer in script - working twice then stops script.

Martin Hill
07-23-2020, 01:04 PM
Hi All,

I have a problem with a script that I'm really confused by and wondering if anyone has any insight, or could suggest any other way to achieve the same result.

I'm looking in a script to paint a few stokes, export an image using ExportLayer, paint some more strokes, export, rinse and repeat.

EvType: Command CommandID: ExportLayer Idx: -1 Channels: NO Path: "/Users/martin/Desktop/test0003.png"

The odd thing is my script exports the first 2 times, then stops executing on the third, even though the code is identical as far as I can see. I've saved in UTF16 and working on osx and on artrage6.

Attached a simplified script, will need to replace filepath for the save location. This plays and exhibits the problem on a fresh scene.


Many thanks!

07-24-2020, 12:21 AM
Hello Martin and welcome to the ArtRage forums :)
OK, so I’m not an expert on AR scripting (or any other kind of scripting for that matter!) but I shall tell you what happens with your example script for me;
1: Ran it as is. Unaltered.
Same as for you, it stops after 2 exports with the same error message.

2: Using BBEdit text editor I changed only your name ‘martin’ in all the file export paths to my name 'mark'.
Then used Save As…
Ran the new edited script which played to end of the script without stopping on multiple tries.
Total of 8 exported layers with each run.

Although an export path and file type are specified in the script these are actually ignored with only the Export Window being triggered which will use the same settings as the last export used.
The last line calls for another export, No: 9 but it never seems to do it as I consistently only get 8 exports in total.

Why just changing your name to mine in the export path made it work correctly I have no idea!!!
Why is there no export 9???
Make of my experiments what you will!