Repeated script actions crash script.

General Discussion of Scripting for Flex, Flash & CS SDK

Moderators: Tom, Kukurykus


Repeated script actions crash script.

Post by GuyOxford »

I have an issue with certain scripted actions that work perfectly the first time they are called but can not be called a second time without invoking the "This functionality may not be available in this version of Photoshop" error. The scripted actions include flatten image, merge visible and duplicate image.

The issue appears to be centred around Photoshop losing reference to the document but that is just speculation as I'm not sure how I came to that conclusion. Doing things like adding a levels layer work fine but I have tried at least seven different ways of merging layers and they all fail on the second call. The only way of resetting is to close and re-open the document. I am writing in Action script but even if I call a JavaScript function the result is the same.

I'm guessing that the document (or Photoshop) need to be re-set in some way after calling the functions that cause this issue but I don't know of any way to do this. I did see it suggested in one post that changing the selected tool can do this but that hasn't worked for me.

I'm sure I can't be the first person to have come across this issue so, please, has anyone come up with a solution?