JavierAroche / brackets-to-photoshop

An extension for Brackets to execute a JSX file in Photoshop.
MIT License
26 stars 4 forks source link

console.log show messages only after script is finished working #7

Closed mrbodich closed 6 years ago

mrbodich commented 6 years ago

When script is being working no any messages are being appeared in console. All messages appeared in console only after script is done. Not because of high processor load because I am showing UI script window and send console.info( 'Hello' ); before the window is being showed. But no any message until script is finished work.

JavierAroche commented 6 years ago

Hey @mrbodich, that is the expected behavior for this particular plugin, due to ExtendScript's limitations on this feature, and the way the script is executed.

console.[log/info/error] is actually not available in ExtendScript. I added the console "polyfill" so the user could at least see it after the execution is done. The only option you have to log during execution is to use $.write or $.writeln, but that will take you back to ExtendScript Toolkit.

mrbodich commented 6 years ago

$.write or $.writeln are not working during execution unfortunately... I've created my own log function that is logging to the text file and watching it on the second screen.

JavierAroche commented 6 years ago

Yeah, that’s exactly what this plugin does in the console “polyfill” I mentioned. https://github.com/JavierAroche/brackets-to-photoshop/blob/master/jsx/Console.jsx And this is the text file inside the plugin where all the logs are stored. https://github.com/JavierAroche/brackets-to-photoshop/blob/master/tmp/log.txt

mrbodich commented 6 years ago

Unfortunately only own script function works in real time. But that’s not a big problem.

JavierAroche commented 6 years ago

The console polyfill should be writting in real time to the text file. Either way I’m glad you have a workaround 👍

Closing this since it’s more of a limitation with ExtendScript than a plugin issue. Feel free to reopen this if you have any ideas on how to enhance this feature.