Project

General

Profile

[script] Scratchpad v0.2 » Scratchpad v0.1.ini

Mr. BS, 03/17/2014 04:34 PM

 
1
; http://dev.adiirc.com/boards/5/topics/169
2
; Scratchpad - quick msl code evaluation
3
; v0.1 by pereba
4

    
5
alias sp { if (!$dialog(Scratchpad)) { dialog -mp Scratchpad Scratchpad } }
6

    
7
dialog Scratchpad {
8
  title "Scratchpad"
9
  size -1 -1 312 220
10
  option dbu
11
  edit "", 1, 0 0 312 198, multi return hsbar vsbar hsbar vsbar
12
  button "Evaluate", 4, 6 202 300 14
13
}
14

    
15
on 1:dialog:Scratchpad:*:*: {
16
  if ($devent = sclick) {
17
    if ($did = 4) {
18
      var %code $did(1).lines
19
      if (%code) {
20

    
21
        write -c scratchpad.txt alias sidentifier $chr(123)
22
        var %line = 1
23
        while (%line <= $did(1).lines) {
24
          write -a scratchpad.txt $did(1, %line).text
25
          inc %line
26
        }
27

    
28
        write -a scratchpad.txt $chr(125)
29
        .load -rs scratchpad.txt
30
        sidentifier
31
        .unload -rs scratchpad.txt
32

    
33
      }
34
    }
35
  }
36
}
(1-1/2)