Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting “Error 25: Expected: ;” in this function definition?

I am debugging a function for a Photoshop script:

function artboardRename (artboard, param1, param2, param3) {
    let vis = artboard.visible;
    alert(vis);
}
// artboard is a layerSet

but I keep getting an error:

Error 25: Expected: ;. Line 202 -> let vis = artboard.visible;

Why do I keep getting this error?

like image 536
Ryan Walker Avatar asked Aug 31 '25 22:08

Ryan Walker


1 Answers

There's no let in photoshop scripting because Adobe ExtendScript is based currently on EcmaScript version 3. This also means there's no very basic features such as Array.indexOf(), nevermind the ES5 and 6 syntaxes.

The correct code that should work is:

function artboardRename (artboard, param1, param2, param3) {
var vis = artboard.visible;
alert(vis);

}

like image 113
Vasily Hall Avatar answered Sep 03 '25 12:09

Vasily Hall