-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Export.aplf
28 lines (26 loc) · 1.06 KB
/
Export.aplf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{files}←{regex}Export path;path;⎕USING;sourceKey;subKey;subKeys;⎕IO;reg;home;hex;file
⍝ path can also be:
⍝ 0 for "colSchemes" in the current version's folder (e.g. "Dyalog APL-64 19.0 Unicode Files")
⍝ 1 for "colSchemes" in the user's version agnostic folder ("Dyalog APL Files")
⎕IO←0
:If 900⌶0
regex←''
:EndIf
(reg home)←4070⌶0
reg←18↓reg,'\Colours\Schemes\'
path←{⍬≡0⌿⍵:'\colSchemes',⍨('Dyalog APL Files',⍨⊃⍤⎕NPARTS)⍣⍵⊢home ⋄ ⍵}path
1 ⎕MKDIR path
⎕USING←'Microsoft.Win32,Microsoft.Win32.Registry'
sourceKey←Registry.CurrentUser.OpenSubKey⊂reg
subKeys←sourceKey.GetSubKeyNames
sourceKey.Close
files←0⍴⊂''
:For subKey :In regex ⎕S'%'⍠'ML' 1⊢subKeys
sourceKey←Registry.CurrentUser.OpenSubKey⊂reg,subKey
hex←(⎕D,⎕A)[16 16⊤sourceKey.GetValue⊂'Data']
hex←⊂3↓¨@0↓':'@2⍤1⊢15(1↓⍤1⊢⍴⍨÷⍨∘≢,⊣),' '⍪⍉' '⍪hex
sourceKey.Close
file←path,'\',subKey,'.dcs'
files,←⊂file
hex ⎕NPUT file 1
:EndFor