diff options
Diffstat (limited to 'pd/tcl/wheredoesthisgo.tcl')
-rw-r--r-- | pd/tcl/wheredoesthisgo.tcl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pd/tcl/wheredoesthisgo.tcl b/pd/tcl/wheredoesthisgo.tcl index 1e9e0344..acee40c0 100644 --- a/pd/tcl/wheredoesthisgo.tcl +++ b/pd/tcl/wheredoesthisgo.tcl @@ -6,15 +6,14 @@ package provide wheredoesthisgo 0.1 proc open_file {filename} { set directory [file normalize [file dirname $filename]] set basename [file tail $filename] - if {[regexp -nocase -- "\.(pd|pat|mxt)$" $filename]} { + if { + [file exists $filename] + && [regexp -nocase -- "\.(pd|pat|mxt)$" $filename] + } then { ::pdtk_canvas::started_loading_file [format "%s/%s" $basename $filename] pdsend "pd open [enquote_path $basename] [enquote_path $directory]" - # remove duplicates first, then the duplicate added after to the top - set index [lsearch -exact $::recentfiles_list $filename] - set ::recentfiles_list [lreplace $::recentfiles_list $index $index] - lappend ::recentfiles_list $filename - set ::recentfiles_list [lrange $::recentfiles_list 0 $::total_recentfiles] - ::pd_menus::update_recentfiles_menu + # now this is done in pd_guiprefs + ::pd_guiprefs::update_recentfiles $filename } { ::pdwindow::post [format [_ "Ignoring '%s': doesn't look like a Pd-file"] $filename] } |