# Description: adds the /at command, which runs a command once at the specified time procs command_at proc command_at {window line} { global prefs info set line [split [string trimleft $line]] if {$line == ""} { set found 0 foreach x [after info] { if {[string match *::doat [lindex [after info $x] 0 0]]} { set line [lindex [after info $x] 0] Echo $window "at [clock format [lindex $line 1] -format "(%m/%d/%y %H:%M:%S)"] [lindex $line 2]" set found 1 } } if {!$found} {Echo $window {[ info ] There are no at commands pending}} return } if {[lindex $line 0] == "stop" || [lindex $line 0] == "cancel"} { set line [lrange $line 1 end] set cancel 1 } set time [gettime line] if {$line == "" || [llength $line] == 1} { Echo $window {[ info ] Usage: /at [[cancel|stop]