Manual - Scripts

The management window opens, initially on the Script panel, listing all scripts existing on the selected device and allowing the user to rename or enable/disable them. The following operations can also be performed from here:
  • Run / Stop;
  • Delete;
  • Creation;
  • Edit (thanks to a simple text editor);
  • Download and upload;
  • Scripts restore from backup files (simply upload a backup file and choose the script to be restored on the selected position).

Editor
scripts editor scripts editor scripts editor
Editor - Appearance may change depending on version and OS.
The editor window is split into two parts: in the upper part there is the actual editor, in the lower part there are the logs relating to the script running; the results of any print and console.log statement and error messages appear there.
From the editor, using the toolbar buttons, you can upload the script to the device and run it or save/load the script from the local disk.
The main programming aid functions such as automatic indentation, highlighting of corresponding brackets and the possibility of commenting multiple lines in bulk have been implemented; some behaviour of the editor can be modified from the application settings of Shelly Scanner in the "IDE" tab.
Many of the functions associated to the toolbar buttons (plus other) can be activated with keyboard shortcuts:
cut, copy, paste, undo and redo are associated respectively, as normally happens, with ctrl-X, ctrl-C, ctrl-V, ctrl-Z, ctrl-Y; additional shortcuts are:
TabBlock indent
shift - TabRemove block indent
ctrl - IAutoindent selection
ctrl - / or ctrl-shift - 7  Comment / Uncomment block
shift - EnterNew line with no indentation
ctrl - SpaceAutocomplete
ctrl-shift - UTo uppercase
ctrl-shift - LTo lowercase
ctrl - GGo to line (number)
ctrl - FFind / Replace
ctrl - SSave the current script to disk
A summary of the keyboard shortcuts can be viewed at any time with the "help" button .