XToolKit / Mac OS X / Photoshop CS 2 French

Discussion of the xtools Toolkit

Moderators: Tom, Kukurykus

macfurax

XToolKit / Mac OS X / Photoshop CS 2 French

Post by macfurax »

In fact I create the Action(s) on my machine, and run it on an other, to keep my machine usable. So I must transfer the images and the Action (Via an action file "some-name.atn"). These Actions only use photoshop tools action, levels, selective color, color balance, ...

To make it simple :

I want one Action file (batch.atn), with one to tree action in it (BatchAct01-03).

Transfer the Action File and images on an other machine.

On this other machine run the action(s) on the list of file.

(Don't take it for you I just try to be clear

I will have a look to the ActionStepper.

Read U

Constant
macfurax

XToolKit / Mac OS X / Photoshop CS 2 French

Post by macfurax »

I'm still digging.

I look at ActionStepper, It look like it cannot load Action file (something.atn), or I miss something.

So I make some test, and I discover a strange behaviour about try .. catch.

I try this bunch of code to understand how everythings work :

var i=1;
while (true) {
var ref = new ActionReference();
ref.putIndex(cTID("ASet"), i); // ActionSet
var desc;
try {
desc = executeActionGet(ref);
} catch (e) {
break; // all done
}

// Name
if (desc.hasKey(cTID("Nm "))) {
$.writeln( desc.getString(cTID("Nm ")) );
}
// NumberOfChildren
if (desc.hasKey(cTID("NmbC"))) {
$.writeln( desc.getInteger(cTID("NmbC")) );
}
i++;
}

When the try part failed, ExtendScript stop telling me that there is an error. So the script doesn't continue, normally it should not do that because the error is catched ? I must put "$.level =0;" at the beginning of the srcipt, is it normal ?


I got the same problem running the "ChangeScriptPaths.jsx" on the

try {
eval("main");
} catch (e) {

part. It stop telling me that main is not defined. And adding "$.level = 0;" I receive an error mesage saying that there is an uncatched exception ???????

I'm bit lost ....

Constant
xbytor

XToolKit / Mac OS X / Photoshop CS 2 French

Post by xbytor »

In ESTK, you can have debugger stop whenever it sees any exception or only when it sees an (unguarded) exception that is not caught in a try/catch block. Under the Debug menu at the bottom there is a "Don't Break On Guarded Exceptions" menu item that will toggle back and forth between the two behaviours.

Even if ESTK does stop, if you press play again the debugger will ask if you want to continue with the exception active or if you want to continue and ignore the exception.

The two exceptions that you have noted are expected. Normally I hate using try/catch blocks as a form of program flow control, but in situations like these two, it's sometimes the only solution.