Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Photoshop commands undefined. Using Generator Settings #138
When writing a node js photoshop plugin, I've noticed that certain code causes issues that would normally be acceptable if used in an ordinary .jsx script.
var idslct = charIDToTypeID( "slct" );
I researched a little bit and came to this: generator settings.
How do these work?
The setGeneratorSettings.jsx and getGeneratorSettings.jsx seem to be closely related to my issue. Do we need to write some sort of require line at the beginning of our plugin to get access to these?
I'm a bit confused. Are you trying to write statements like
Or, are you trying to execute that code inside node? If you're trying to do that, it definitely won't work. ExtendScript code is different than node code. The only way to execute ExtendScript code is to pass it to the functions I mentioned above. This is how all of the JSX files are executed in the directory you linked to.
Happy to try to help further if you can provide me with some more details. In the mean time, this doesn't sound like a bug, so I'm closing the issue.
Great! So it's just photoshop .js code that can be ran in node without passing it to Generator.prototype.evaluateJSXFile or Generator.prototype.evaluateJSXString?
Anyway, in Tom Krcha's "generator-getting-started" repository, I found the code:
Using this worked perfectly. I was looking in the "generator-core-master" repository but I couldn't find this same logic. Where in that repository does this same code for passing jsx exist?
Alternatively, you might consider using the
That method takes two parameters: a path to the file to execute, and an object named
So, if you call:
Both methods return a Promise that resolves when the execution is complete. Look elsewhere in the
Hope that helps!