Home
dialog filecreator {
title "Filecreator by Nick© 20.09.2008 Version: 0.1a"
size -1 -1 500 428
option pixels
combo 1, 16 19 79 70, drop
box "Fileendung:", 2, 5 4 257 100
button ">>>", 3, 449 406 50 20, disable default
text "Filename:", 4, 268 10 50 17
edit "", 5, 324 10 172 20
text "", 6, 116 121 267 17
box "", 7, 3 142 492 16
edit "", 8, 4 162 495 241, autohs multi return vsbar
radio "Post to Aktiv when finish", 9, 270 36 150 17
radio "Post to @Window when finish", 10, 270 55 174 17
radio "Run Textfile when finish", 11, 270 74 150 17
text "Other Name:", 12, 125 21 100 17, hide
edit ".other", 13, 126 51 100 20, hide center
}
on *:dialog:filecreator:*:*:{
if ($devent == init) {
did -a $dname 1 .txt
did -a $dname 1 .mrc
did -a $dname 1 .rtf
did -a $dname 1 .doc
did -a $dname 1 .html
did -a $dname 1 other..
unset %tc.*
}
if ($devent == sclick) {
if ($did == 1) {
if ($did($dname,1) == other..) { did -v $dname 12 | did -v $dname 13 | set %tc.domain other }
else {
set %tc.domain $did($dname,1).seltext
did -h $dname 12
did -h $dname 13
}
}
if ($did == 9) { set %tc.mode aktiv }
if ($did == 10) { set %tc.mode window }
if ($did == 11) { set %tc.mode run }
if ($did == 3) { create }
}
if ($devent == edit) {
if ($did == 5) {
if (($did($dname,13).text != $null) && ($did($dname,5).text != $null)) { did -e $dname 3 | set %tc.name $did($dname,5).text }
else { unset %tc.name | did -b $dname 3 }
}
if ($did == 13) {
if (($did($dname,13).text != $null) && ($did($dname,5).text != $null)) { did -e $dname 3 | set %tc.domain $did($dname,13).text }
else { did -b $dname 3 | unset %tc.domain }
}
if ($did == {
did -ra $dname 6 Lines: $did($dname,8).lines - @ $+ $time
}
}
}
alias create {
set %tc.file %tc.name $+ %tc.domain
window -c @ $+ %tc.file
set %i 1
write -c %tc.file
while (%i <= $did(filecreator,8).lines) {
write %tc.file $did(filecreator,8,%i)
inc %i
}
tc.befehl
}
alias tc.befehl {
if (%tc.mode == $null) { halt }
if (%tc.mode == aktiv) {
set %i 1
while (%i <= $lines(%tc.file)) {
echo -a $read(%tc.file,%i)
inc %i
}
}
if (%tc.mode == window) {
set %i 1
set %tc.file.w @ $+ tc.file
window -a %tc.file.w
while (%i <= $lines(%tc.file)) {
echo %tc.file.w $read(%tc.file,%i)
inc %i
}
}
if (%tc.mode == run) { run %tc.file }
}
alias /tc { dialog -m filecreator filecreator }