Applescript Auto Levels

Any AppleScripters out there? I recently upgraded form Acorn 4 to 6. My old applescript to batch process my photos is not working correctly in Acorn 6.5.3.

The Acorn part of the script is pretty simple:
tell application “Acorn”
set activeDoc to open theRenamedFilePath as alias
tell activeDoc to auto levels
close activeDoc saving yes
end tell

It’s the Auto Levels line. It used to just apply auto levels. It now looks like it opens a filter layer and then the save can’t run. Seems like there is a step that I need to apply the auto level layer or merge/flatten that layer. But I can’t figure out how to do that.

Any advice?

Can you post the complete AppleScript? When I load that part, you’ve shared, I only get error messages because of undefined variables in Script Debugger.

Thanks for the reply. I have this working now. I added an “Activate” line after the tell acorn line. That seems to make the save command work, for some reason. Maybe the sandboxing issue that the documentation mentions about the app store version (that’s what I have). Maybe the app can’t do anything file system related in the background? Totally guessing, but I have it working.

There’s a good chance it’s a problem with the sandboxing restrictions. If you do run into any more issues with it, I’d love to see the whole script.