Saving external file in standalone script editor



  • {
      "Type": "HorizontalTile",
      "StyleData": {
      },
      "LayoutData": {
        "ID": "anonymous",
        "Size": -0.5,
        "Folded": -1,
        "Visible": true,
        "ForceFoldButton": 0,
        "MinSize": -1
      },
      "ColourData": {
      },
      "Content": [
        {
          "Type": "VerticalTile",
          "StyleData": {
          },
          "LayoutData": {
            "ID": "anonymous",
            "Size": -0.78887251,
            "Folded": -1,
            "Visible": true,
            "ForceFoldButton": 0,
            "MinSize": -1
          },
          "ColourData": {
          },
          "Content": [
            {
              "Type": "Tabs",
              "StyleData": {
              },
              "LayoutData": {
                "ID": "anonymous",
                "Size": -0.203125,
                "Folded": -1,
                "Visible": true,
                "ForceFoldButton": 0,
                "MinSize": -1
              },
              "ColourData": {
              },
              "Content": [
                {
                  "Type": "ApiCollection",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.5,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  }
                },
                {
                  "Type": "FileBrowser",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.5,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  }
                },
                {
                  "Type": "ModuleBrowser",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.5,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  }
                }
              ],
              "CurrentTab": 0
            },
            {
              "Type": "Tabs",
              "StyleData": {
              },
              "LayoutData": {
                "ID": "anonymous",
                "Size": -1.1253906,
                "Folded": -1,
                "Visible": true,
                "ForceFoldButton": 0,
                "MinSize": -1
              },
              "ColourData": {
              },
              "Content": [
                {
                  "Type": "ScriptEditor",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.5,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  },
                  "ProcessorId": "",
                  "Index": -1
                },
                {
                  "Type": "ScriptEditor",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.5,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  },
                  "ProcessorId": "",
                  "Index": -1
                },
                {
                  "Type": "ScriptEditor",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.5,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  },
                  "ProcessorId": "",
                  "Index": -1
                },
                {
                  "Type": "ScriptEditor",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.5,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  },
                  "ProcessorId": "",
                  "Index": -1
                },
                {
                  "Type": "ScriptEditor",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.5,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  },
                  "ProcessorId": "",
                  "Index": -1
                }
              ],
              "CurrentTab": 0
            }
          ]
        },
        {
          "Type": "VerticalTile",
          "StyleData": {
          },
          "LayoutData": {
            "ID": "anonymous",
            "Size": -0.21112749,
            "Folded": -1,
            "Visible": true,
            "ForceFoldButton": 0,
            "MinSize": -1
          },
          "ColourData": {
          },
          "Content": [
            {
              "Type": "Console",
              "StyleData": {
              },
              "LayoutData": {
                "ID": "anonymous",
                "Size": -0.82851562,
                "Folded": 0,
                "Visible": true,
                "ForceFoldButton": 0,
                "MinSize": -1
              },
              "ColourData": {
              }
            }
          ]
        }
      ]
    }
    


  • I've found a little bug with this, if I have my popout window on another desktop and I right-click in the API browser it will switch to the desktop with the main HISE interface on instead of opening the info where I clicked. I've only tested this on Windows.


  • administrators

    I made some of the containers not Dynamic, which causes the close button to appear and give it a more "hardcoded" style. I also changed some size values to absolute values (eg. the left panel doesn't need to increase in size when the window gets bigger). I also added a "Global Script Connector", which sets the processor of all child panels (so you don't have to set each script editor explicitely.

    This is the updated JSON:

    {
          "Type": "HorizontalTile",
          "StyleData": {
          },
          "LayoutData": {
            "ID": "anonymous",
            "Size": -0.5,
            "Folded": -1,
            "Visible": true,
            "ForceFoldButton": 0,
            "MinSize": -1
          },
          "ColourData": {
          },
          "Dynamic": false,
          "Content": [
            {
              "Type": "VerticalTile",
              "StyleData": {
              },
              "LayoutData": {
                "ID": "anonymous",
                "Size": -0.97559917,
                "Folded": -1,
                "Visible": true,
                "ForceFoldButton": 0,
                "MinSize": -1
              },
              "ColourData": {
              },
              "Dynamic": false,
              "Content": [
                {
                  "Type": "Tabs",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": 357,
                    "Folded": 0,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  },
                  "Dynamic": false,
                  "Content": [
                    {
                      "Type": "ApiCollection",
                      "StyleData": {
                      },
                      "LayoutData": {
                        "ID": "anonymous",
                        "Size": -0.5,
                        "Folded": 0,
                        "Visible": true,
                        "ForceFoldButton": 0,
                        "MinSize": -1
                      },
                      "ColourData": {
                      }
                    },
                    {
                      "Type": "FileBrowser",
                      "StyleData": {
                      },
                      "LayoutData": {
                        "ID": "anonymous",
                        "Size": -0.5,
                        "Folded": 0,
                        "Visible": true,
                        "ForceFoldButton": 0,
                        "MinSize": -1
                      },
                      "ColourData": {
                      }
                    },
                    {
                      "Type": "ModuleBrowser",
                      "StyleData": {
                      },
                      "LayoutData": {
                        "ID": "anonymous",
                        "Size": -0.5,
                        "Folded": 0,
                        "Visible": true,
                        "ForceFoldButton": 0,
                        "MinSize": -1
                      },
                      "ColourData": {
                      }
                    }
                  ],
                  "CurrentTab": 2
                },
                {
                  "Type": "HorizontalTile",
                  "StyleData": {
                  },
                  "LayoutData": {
                    "ID": "anonymous",
                    "Size": -0.58047337,
                    "Folded": -1,
                    "Visible": true,
                    "ForceFoldButton": 0,
                    "MinSize": -1
                  },
                  "ColourData": {
                  },
                  "Dynamic": false,
                  "Content": [
                    {
                      "Type": "GlobalConnectorJavascriptProcessor",
                      "StyleData": {
                      },
                      "LayoutData": {
                        "ID": "anonymous",
                        "Size": 18,
                        "Folded": 0,
                        "Visible": true,
                        "ForceFoldButton": 0,
                        "MinSize": -1
                      },
                      "ColourData": {
                      },
                      "ProcessorId": "",
                      "Index": -1
                    },
                    {
                      "Type": "Tabs",
                      "StyleData": {
                      },
                      "LayoutData": {
                        "ID": "anonymous",
                        "Size": -0.5,
                        "Folded": -1,
                        "Visible": true,
                        "ForceFoldButton": 0,
                        "MinSize": -1
                      },
                      "ColourData": {
                      },
                      "Content": [
                        {
                          "Type": "ScriptEditor",
                          "StyleData": {
                          },
                          "LayoutData": {
                            "ID": "anonymous",
                            "Size": -0.5,
                            "Folded": 0,
                            "Visible": true,
                            "ForceFoldButton": 0,
                            "MinSize": -1
                          },
                          "ColourData": {
                          },
                          "ProcessorId": "",
                          "Index": -1
                        },
                        {
                          "Type": "ScriptEditor",
                          "StyleData": {
                          },
                          "LayoutData": {
                            "ID": "anonymous",
                            "Size": -0.5,
                            "Folded": 0,
                            "Visible": true,
                            "ForceFoldButton": 0,
                            "MinSize": -1
                          },
                          "ColourData": {
                          },
                          "ProcessorId": "",
                          "Index": -1
                        },
                        {
                          "Type": "ScriptEditor",
                          "StyleData": {
                          },
                          "LayoutData": {
                            "ID": "anonymous",
                            "Size": -0.5,
                            "Folded": 0,
                            "Visible": true,
                            "ForceFoldButton": 0,
                            "MinSize": -1
                          },
                          "ColourData": {
                          },
                          "ProcessorId": "",
                          "Index": -1
                        },
                        {
                          "Type": "ScriptEditor",
                          "StyleData": {
                          },
                          "LayoutData": {
                            "ID": "anonymous",
                            "Size": -0.5,
                            "Folded": 0,
                            "Visible": true,
                            "ForceFoldButton": 0,
                            "MinSize": -1
                          },
                          "ColourData": {
                          },
                          "ProcessorId": "",
                          "Index": -1
                        }
                      ],
                      "CurrentTab": 0
                    }
                  ]
                }
              ]
            },
            {
              "Type": "Console",
              "StyleData": {
              },
              "LayoutData": {
                "ID": "anonymous",
                "Size": -0.31327334,
                "Folded": 0,
                "Visible": true,
                "ForceFoldButton": 0,
                "MinSize": -1
              },
              "ColourData": {
              }
            }
          ]
        }
    


  • That's great Christoph, thanks!



  • When I add a MIDI processor and use connect to an external script, any changes I make to the script within HISE don't seem to be written to the external file.


  • administrators

    Ah, nice catch! Connecting a script to a MIDI processor is a read-only connection (that's why the script editor will be hidden in the main panel). However, it's still fully accessible in the Scripting workspace, but it will not write to the file because of the "read-onlyness".

    It has to be read only in order to make sure that multiple scripts that use the same external file have the same state.

    I "fixed" it by removing connected script processors from the editor drop down - not sure if this is a satifying answer for you though :)



  • Well it solves the problem :) however it creates another question for me. What if I want to edit the file in the HISE editor? I'm trying to remove the need for an external text editor and do everything in HISE.


  • administrators

    Well, I added this feature for scripts that are somewhat "finished" and just need to be reused (so as long as you're working on a script, it's recommended to not connect it to an external file). However if you want to make changes to this script - nobody's perfect :), you can:

    1. disconnect the processor (which will load the script's content back into the processor)
    2. change it until it works
    3. Save the script as file (and overwrite the old file).
    4. Connect it back to the overwritten file
    5. Recompile all scripts (Shift + F5) so that the changes will be applied to all other instances.


  • Cool, that seems pretty straightforward


Log in to reply

Looks like your connection to Saving external file in standalone script editor was lost, please wait while we try to reconnect.