Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Converting ES / AM Code with SETD #3

Open
FixelAlgorithms opened this issue Mar 30, 2021 · 6 comments
Open

Error Converting ES / AM Code with SETD #3

FixelAlgorithms opened this issue Mar 30, 2021 · 6 comments

Comments

@FixelAlgorithms
Copy link

I have the following Temp.jsx file:

var mainScriptPath = Folder($.fileName).parent.parent ;
var scriptFile = new File(mainScriptPath + '/ad-to-uxp.jsx')
$.evalFile(scriptFile);

cTID = charIDToTypeID;
sTID = stringIDToTypeID;

function s2t(s) {return app.stringIDToTypeID(s);}
function c2t(c) {return app.charIDToTypeID(c);}

var dialogMode = DialogModes.NO

// executeActionForUXP

var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(c2t("Chnl"), s2t("selection"));
desc1.putReference(c2t("null"), ref1);
desc1.putEnumerated(c2t("T   "), c2t("Ordn"), c2t("Al  "));
executeActionForUXP(c2t("setd"), desc1, dialogMode);

It seems it can't be proceed and generates the following error:

image

@FixelAlgorithms
Copy link
Author

@baaygun, any idea about this?

@baaygun
Copy link
Contributor

baaygun commented Apr 7, 2021

Hi @FixelAlgorithms , this is a valid case of an action reference that I haven't accounted for in my script. I will update the script by next week to make sure it can handle these cases, and we're tracking this internally.

In this case, the valid JSON would be:

{
    "_obj": "set",
    "_target": [
        {
            "_property": "selection",
            "_ref": "channel"
        }
    ],
    "to": {
        "_enum": "ordinal",
        "_value": "allEnum"
    }
}

@baaygun
Copy link
Contributor

baaygun commented Apr 7, 2021

I will keep the issue open until the script itself is fixed.

@FixelAlgorithms
Copy link
Author

FixelAlgorithms commented Apr 8, 2021

While you're on the roll there 2 more patterns we have found, so far, that doesn't work:

var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(c2t("Clr "), c2t("Clrs"));
desc1.putReference(c2t("null"), ref1);
executeActionForUXP(c2t("Rset"), desc1, dialogMode);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(c2t("Clr "), c2t("Clrs"));
desc1.putReference(c2t("null"), ref1);
executeActionForUXP(c2t("Exch"), desc1, dialogMode);

@FixelAlgorithms
Copy link
Author

FixelAlgorithms commented Apr 8, 2021

Another one is related to Apply Image where the script ignores the putName() command:

var desc1 = new ActionDescriptor();
var desc2 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(c2t("Chnl"), c2t("Chnl"), s2t("RGB"));
ref1.putName(c2t("Lyr "), "Star suppression");
desc2.putReference(c2t("T   "), ref1);
desc2.putBoolean(c2t("Invr"), true);
desc2.putEnumerated(c2t("Clcl"), c2t("Clcn"), c2t("Add "));
desc2.putDouble(c2t("Scl "), 1);
desc2.putInteger(c2t("Ofst"), 0);
desc2.putBoolean(c2t("PrsT"), true);
desc1.putObject(c2t("With"), c2t("Clcl"), desc2);
executeActionForUXP(s2t("applyImageEvent"), desc1, dialogMode);

The same just with Slct:

var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(c2t("Chnl"), c2t("Chnl"), c2t("Msk "));
ref1.putName(c2t("Lyr "), "Star suppression");
desc1.putReference(c2t("null"), ref1);
desc1.putBoolean(c2t("MkVs"), false);
executeActionForUXP(c2t("slct"), desc1, dialogMode);

You can observe the output ignores the putName() command.

@DennyOl
Copy link

DennyOl commented Jan 22, 2023

Hello,
I'm currently working on the porting of a MASSIVE CEP panel to UXP, and without having the original .atn files, this script was my last hope to be able to do it.
I've encountered few translation issues from ExtendScript commands into batchPlay ones just like mentioned above from @FixelAlgorithms.
Is this script going to get some fixes anytime soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants