Classic Computer Magazine Archive COMPUTE! ISSUE 140 / MAY 1992 / PAGE 38

Turbocharge File Manager. (macros with Windows 3.1) (Column)
by Clifton Karnes

When you upgrade to Windows 3.1, many of you will want to start using the program's powerful new File Manager. It's a dramatic improvement over 3.0's File Manager, and here are two Recorder macro tips that will make it even more powerful. (These macros work with 3.0's File Manager, too, so don't stop reading if you don't have 3.1 yet.)

First, some background. With File Manager, there are two ways you can easily view files: You can associate the file's extension with Notepad (or another text-editing or -viewing program) and double-click on the filename. Or you can drag the file to Notepad's icon minimized on the desktop (in Windows 3.1 only).

The first method works only if the file is associated. The second method requires that Notepad be minimized on your desktop, ready to receive the file.

But what do you do when you want to load a batch file into Notepad but BAT is the extension of an executable program and can't be associated? Or when you have small text files with DOC extensions that you want to read in Notepad but DOC is associated with WinWord? The answer is to create a Recorder macro to load the file at the cursor in File Manager into Notepad.

Before we dive into the File Manager macros, there's a possible problem with Recorder we need to remedy. If it records you mouse clicks, any mouse movements you make will only be played back correctly when the position and configuration of your windows are exactly the same as when the macro was recorded.

The solution is simple. Tell Recorder to record only your keystrokes.

Here's what to do.

1. Select Options, Preferences.

2. In the Record Mouse drop-down list box, select Ignore Mouse.

3. Click on OK.

Now that the mouse business is fixed, let's get back to the macro that will load the file at the cursor into Notepad. Here are the steps.

1. In File Manager, select a file to load into Notepad.

2. Open Recorder, choose a name for your macro (such as Load File at Cursor into Notepad), and start recording.

3. In File Manager, press Alt-F, P, and Ctrl-Insert to copy the selected filename to the Clipboard. Press Tab, Tab, Enter to exit the dialog box.

4. Press Alt-F, R. Then type NOTEPAD.EXE followed by a space in the text box.

5. Press Shift-Insert to paste the name of the file into the text box.

6. Press Enter.

Stop recording, and assign the macro a keypress. I suggest Ctrl-Alt-N.

Now simply press Ctrl-Alt-N to load any file selected in File Manager into Notepad. (The Notepad in 3.1 can load binary as well as text files.)

Here's another common problem. If you want to view files by their extension type in File Manager, it's a cumbersome process. You have to go through slow menus and dialog boxes.

The solution, again, is to create a Recorder macro to automatically display all files with the same extension as the file at the cursor.

Here's the macro, step by step:

1. Place the cursor on any filename in File Manager that has an extension.

2. Run Recorder (make sure you're ignoring mouse movements), and prepare to record a macro. I suggest a name such as View by Type and a key combination of Ctrl-alt-T for this macro.

3. Press Alt-F, P. Then press the left-arrow key five times.

4. Press Shift-End to define the part of the filename before the extension.

5. Press Delete.

6. Type "*".

7. Press Home, followed by Shift-End to define the wildcard filename.

8. Press Ctrl-Insert followed by Esc.

9. Press Alt-V, T (press C instead of T for Windows 3.0), and Shift-Insert to paste the wildcard into the text box.

10. Press Enter to display file swith the wildcard.

The macro to display all filenames is quite simple:

1. Press Alt-V, T.

2. Type "*.*".

3. Press Enter.

A good name for this macro is View All, and the key combination I suggest is Ctrl-Alt-A.

>From now on, Ctrl-Alt-N will load the selected file into Notepad, Ctrl-Alt-T will display files with the selected file's extension, and Ctrl-Alt-A will display all files.

You can find these 2 tips, plus 99 more, in my forthcoming book 101 Essential Windows Tips, published by COMPUTE Books.