#! /perl/bin/perl -w # Fast Open # # A Perl/Tk utility written to allow fast Explorer and # command prompt access to commonly used directories. # Needs Perl and Tk installed. # # Windows 98 version (may run on '95/ME). # # When run up press the 'Add Dir..' button to add a directory # to the list. You must select a file _in_ the required # target directory. If the directory is empty, paste in a dummy # text file first. When a directory is added the current list # is saved to 'directories.txt' in the directory this app is # saved in. # To remove or re-order directories edit this text file by # hand (you can manually add directories too, these will be # picked up the next time Fast Open is run). # # You can minimise the app window so it's just big enough to # show those directories being used. # # To open Explorer at a directory double click the dir name. # To open a cmd prompt in this directory select the name then # right click it. # # This is provided for general use without any guarantees or # warranties. # # © Nial Stewart Developments 2003 # www.nialstewartdevelopments.co.uk use Tk; my $mw = MainWindow->new; $mw->title("'98 FastOpen"); #$FSel = $mw->FileSelect; my $file; my $filename; my $path; my $target; my $dummy; $lb = $mw->Listbox->pack; open IN,"directories.txt"; while (){ chomp; $lb->insert('end',$_); } close IN; $lb->bind('', sub{ $target = $lb->get($lb->curselection); $dummy = system("explorer.exe /n,/e,$target") }); $lb->bind('', sub{ $target = $lb->get($lb->curselection); $dummy = system("start command.com /K cd $target"); }); $mw->Button(-text=> "Add Dir..", -command => sub {$file = $mw->getOpenFile; if($file ne ""){ $filename = $file; $path = $file; $filename =~ /(\w+?\.\w+)$/; $filename = $1; $_ = $path; /^(.+[\/\\])/; $path = $1; $path =~ s/\//\\/g; $lb->insert('end',$path); open OUT,">>directories.txt"; print OUT $path,"\n"; close OUT; } })->pack; MainLoop;