How to open Py->JS autoconverter

I am trying to find where to open the Py->JS autoconverter in v2020.1.2. I’ve found lots of helpful information about using it but can’t for the life of me find out how to simply open the window.

Apologies for how basic this question is! I’m new to online experiments but am grateful for this new option given the COVID restrictions. Many thanks.

Have you created a code component and written some Python in it?

If so then you should get automatic Javascript as soon as you press enter (switch code type to auto if it isn’t already).

Some things don’t translate automatically so you then have to switch to both and edit the Javascript. I’m working on a document to help with this.

Best wishes,

Wakefield

Thank you, Wakefield! I built the whole experiment in Builder. What I’m looking for is actually even more basic though. When I click “compile to script” and open the coder window, I don’t see a place to change the code type. Here is a screenshot of what I see after compiling to script.

Screen Shot 2020-04-08 at 9.50.42 AM|637x500

The reason I’m looking is that there are a few issues with my experiment when I run it online, and I thought it might be a problem with how things were translated, like you mentioned. But I just need to be able to see the translation first.

Oh, compile to script only generates the python script. If you want the JS script, you have to sync it to Pavlovia. It will auto-generate the JS script and save it locally (as well as upload it), but there’s no separate way to get it to just make the JS script.

The auto translate is for code snippets. To see the whole code sync with Pavlovia and click on view code (to the left of piloting) and then look in the html folder, or go to File Export HTML and do the same thing locally.

That’s helpful, thanks! I see now where the full code is. What I’m ultimately trying to get to though is this window that’s shown in this youtube tutorial.

That’s what you see when you open a code component in the builder. If you set the “code type” to “Auto->JS”, you should see exactly what’s in that video. Note that you need to have PsychoPy version 2020.1.0 or later.

Ah, okay, thank you everyone! I think I get it now. I appreciate your patient help!

Hi, I still cannot get it. Can you give me some screenshoot about how to open that window?

That’s helpful, thanks! I see now where the full code is. What I’m ultimately trying to get to though is this window that’s shown in this youtube tutorial.

Oh, compile to script only generates the python script. If you want the JS script, you have to sync it to Pavlovia. It will auto-generate the JS script and save it locally (as well as upload it), but there’s no separate way to get it to just make the JS script.

Did I miss some steps? I have synced it to Pavlovia, but there was nothing in my right panel. Python code didn’t translate into JS

You need to work in Builder not coder.