# A key-system to control the place where a new folder is opened

**URL:** https://resource.dopus.com/t/a-key-system-to-control-the-place-where-a-new-folder-is-opened/22089
**Category:** Buttons/Scripts
**Tags:** commands, button
**Created:** [March 28, 2016, 9:35am UTC](https://resource.dopus.com/t/a-key-system-to-control-the-place-where-a-new-folder-is-opened/22089 "2016-03-28T09:35:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Julianon](https://resource.dopus.com/user_avatar/resource.dopus.com/julianon/32/25802_2.png) [@Julianon](https://resource.dopus.com/u/Julianon)
#### Post date: [March 28, 2016, 9:35am UTC](https://resource.dopus.com/t/a-key-system-to-control-the-place-where-a-new-folder-is-opened/22089/1 "2016-03-28T09:35:23Z")

</div>

About a third of the menu buttons on my main non-floating toolbar are either commands to go to a particular folder, or commands to go to a folder picked out using [{DlgFolder}](https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Codes_to_display_dialogs.htm).

I was unhappy with these buttons because they opened my new folder in my current tab, which was not always what I wanted.

'Key-Down' procedures require the mouse, which I try not to use because of my wrist, so I developed a system that uses keys to control the place where my new folder is opened.

All I do is press one of the keys F12–F9 first, before pressing any of my 'Go to a new folder' buttons:

- Press F12 first, and the next new folder will open in a new Source tab.
- Press F11 first, and the next new folder will open in the current tab of the Destination.
- Press F12 and F11 first, and the next new folder will open in a new Destination tab.
- Press F10 first, and the next new folder will open in a new single-pane lister.
- Press F9 first, and the next new folder will open in a new dual-pane lister.
- Press nothing first, and the next new folder will open in the current Source tab, just as normal.

This required no script, but did need a little fancy footwork turning global and lister variables on and off.

First, I made F12–F9 into toggle-hotkeys for the following four buttons that sit together on my main toolbar. Each shows its icon but not its label, and each highlights when active.

(Settings \> Customise, then drag each button to the toolbar — the four hotkeys can easily be changed, or removed by mouse-addicts):

- [Open a New Folder in a New Tab.dcf](https://resource.dopus.com/uploads/default/original/3X/0/d/0dbcda1738eb9027c13161307a521ec726ce4935.dcf) (704 Bytes)
- [Open a New Folder in the Destination .dcf](https://resource.dopus.com/uploads/default/original/3X/3/4/3499eb25a68cfe4279eb11a9acf94de7db058f21.dcf) (748 Bytes)
- [Open a New Folder in a New Single Lister.dcf](https://resource.dopus.com/uploads/default/original/3X/2/f/2f7e84f97209ef816444c9b3ab6e2e75fefcc889.dcf) (777 Bytes)
- [Open a New Folder in a New Dual Lister.dcf](https://resource.dopus.com/uploads/default/original/3X/7/2/72865c9e95b5c9153d102125eb73301d927875ca.dcf) (712 Bytes)

Secondly, I replaced Go in each menu button on my toolbar by A@Go, where A@Go is the name of the following user-defined command.

(Settings \> Customise \> Commands \> User-defined Commands):

- [A@Go.dcf](https://resource.dopus.com/uploads/default/original/3X/1/7/170b28989524b7070c0e49b62cbabf3ec82b0d13.dcf) (218 Bytes)

Thirdly, I placed A@Go in front of each command where a folder was picked out using {DlgFolder}.

For example:  
`{DlgFolder|Select a subdirectory of C:\ProgramData\|/CommonAppData|Expand}`  
became  
`A@Go {DlgFolder|Select a subdirectory of C:\ProgramData\|/CommonAppData|Expand}`  
thus bringing it under the control of the F12–F9 buttons.

Fourthly, when I want to open a single selected folder in a display, the following button does this in a way that respects the F12–F9 buttons (its present compound hotkey _O, O_ can easily be changed, or removed):

- [Open One Folder, Possibly with F9–F12.dcf](https://resource.dopus.com/uploads/default/original/3X/a/d/ad57e5174c3216a1c8bc94387b5227b364499b12.dcf) (1.08 KB)

This system works with almost all the DOpus aliases, as in A@Go /trash and A@Go /network, and with non-directory folders, as in A@Go Lib://.

Once the system is set up, the only thing I have to remember is to press the hotkey before I open the new folder. I've now been using it for a year or so, and I've found it very useful indeed — DOpus is extraordinarily flexible.

---

<div class="post-metadata">

### Author: ![Julianon](https://resource.dopus.com/user_avatar/resource.dopus.com/julianon/32/25802_2.png) [@Julianon](https://resource.dopus.com/u/Julianon)
#### Post date: [September 20, 2016, 2:58am UTC](https://resource.dopus.com/t/a-key-system-to-control-the-place-where-a-new-folder-is-opened/22089/2 "2016-09-20T02:58:01Z")

</div>

UPDATE: In many directories have LNK shortcuts to other directories. The problem has always been that when I click on the shortcut, I go to the files in the linked directory, but I can no longer see the other files in the old directory.

SOLUTION: Using the same A@Go command as described above, and the @ResolveLinks: modifier that DOpus provides, create the button:

`@ResolveLinks: 
A@Go {f!}
` Then as before, pressing F12 first and then this button opens the link in new tab, pressing F11 first opens it in the dual pane, pressing F12 and F11 opens it in a new tab in the dual pane, and so forth.
