ScriptOnIt / Docs
Application options
If you have a file named options.txt
in the app/
folder, you can set some configuration options for Scriptonit that you could not achieve from within your application. Omitting this file is allright; all settings have defaults. But if you don't want your users to be able to exit with Alt+F4, or want to change the default dimensions of the application window, here's how it's done. (the ending comments are optional, thank you Captain Obvious)
Close on ESC yes // it's off by default; if on, app window will close on ESC
Initial window size 900x500 // you can give your app a window dimension on first start
Initial window position 100,100 // if you want to start on a specific part of screen
Initial border style none // usually sizable or none; sizable is the default
Maximum window size 1200x800 // don't let window grow bigger than this
Minimum window size 300x200 // don't let window shrink smaller than this
Always on top no // you can make your window stay-on-top
Remember window position yes // whether to start at the last window position next time
Remember window size yes // whether to start with the last window size next time
Follow document title changes yes // you can change the window title from js (document.title)
Break on script errors yes // whether to stop when there's a javascript error
Use web browser context menu no // right-clicking will pop up the good old browser page menu
Use web browser hotkeys no // things like F5 to refresh; also off by default
Use Scriptonit context menu no // Scriptonit has its own context menu; enabled by default
As you can see, the file format is very simple, it probably doesn't need much explanation. However it's important to note that at least 3 spaces or a tab is required between the columns. (Makes sense btw) Also, there are some non-trivials:
- No quotes needed - anything after the separator spaces will be considered as one string.
- Comments are tricky - you can start a line with
//
, but to append a comment, use 3+ spaces before//
! - AxB means A,B - when specifying coordinate pairs, you can use the letter
x
as a separator. - Many ways to bool - you can say yes, no, true, false, on, off, enabled or disabled.
That's all you need to know.