# Button to navigate through dirs

**URL:** https://resource.dopus.com/t/button-to-navigate-through-dirs/8669
**Category:** Help & Support
**Created:** [October 27, 2009, 6:08pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669 "2009-10-27T18:08:47Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![daroc](https://resource.dopus.com/user_avatar/resource.dopus.com/daroc/32/26038_2.png) [@daroc](https://resource.dopus.com/u/daroc)
#### Post date: [October 27, 2009, 6:08pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/1 "2009-10-27T18:08:47Z")

</div>

I'm trying to create a button that would go to parent dir and open next dir in parent dir. So it looks like I'm looking for button that would:

1. click "go up back" button
2. press right button on keyboard (select next dir)
3. open selected dir  
for me.  
This would make navigating through dirs with photos more efficient.  
Any ideas how to do this?

---

<div class="post-metadata">

### Author: ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)
#### Post date: [October 27, 2009, 7:04pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/2 "2009-10-27T19:04:25Z")

</div>

Something like

GO UP  
SELECT NEXT  
GO {f}

---

<div class="post-metadata">

### Author: ![daroc](https://resource.dopus.com/user_avatar/resource.dopus.com/daroc/32/26038_2.png) [@daroc](https://resource.dopus.com/u/daroc)
#### Post date: [October 27, 2009, 7:39pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/3 "2009-10-27T19:39:17Z")

</div>

Of course you meant GO UP BACK?  
Thank you, but it works a bit slowly.

---

<div class="post-metadata">

### Author: ![GoinPostal](https://resource.dopus.com/user_avatar/resource.dopus.com/goinpostal/32/26083_2.png) [@GoinPostal](https://resource.dopus.com/u/GoinPostal)
#### Post date: [November 23, 2009, 3:26pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/4 "2009-11-23T15:26:26Z")

</div>

In the same way the button works, I created a user command to be able to do the same, but browse also the previous folder. It can be useful to have buttons assigned to this in the lister contextual menu (and probably a hotkey)!

I do have some problems making even the button in the exemple correctly.  
When the Go Up is executed, Selecting the next folder selects the second folder (not the next one), so of course previous one doesn't make anything as it selects from the first folder.

I also tried to activate in Folders-\>Options the line to select the folder when going back to parent dir, but it doesn't change anything.

What you think is the problem?

Template: CMD/A/K[NEXT,PREV]

```nohighlight
Go UP
Select &CMD&
Go {f}

```

---

<div class="post-metadata">

### Author: ![GoinPostal](https://resource.dopus.com/user_avatar/resource.dopus.com/goinpostal/32/26083_2.png) [@GoinPostal](https://resource.dopus.com/u/GoinPostal)
#### Post date: [November 23, 2009, 3:47pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/5 "2009-11-23T15:47:28Z")

</div>

By the way, I think that there will be also an error occuring when in the last folder if some files are present after this last folder.  
DOpus will try to browse as a dir and shows an error message. Is there a workaround for that?

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [November 23, 2009, 3:58pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/6 "2009-11-23T15:58:46Z")

</div>

You could work around it by passing the selected file path {f} to something which checked whether or not it was a directory. e.g. A short VBScript.

---

<div class="post-metadata">

### Author: ![GoinPostal](https://resource.dopus.com/user_avatar/resource.dopus.com/goinpostal/32/26083_2.png) [@GoinPostal](https://resource.dopus.com/u/GoinPostal)
#### Post date: [November 24, 2009, 12:44pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/7 "2009-11-24T12:44:50Z")

</div>

I was sure I had to go once again through vbscript 😉

Still, I don't understand why the folders aren't remembered when going up.  
I tried with the option I told in the previous message, and I also found other options to select folder/file on their own when going to a folder, but nothing seems to change the problem. I always get to the second folder of the lister.

Any idea?

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [November 24, 2009, 3:10pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/8 "2009-11-24T15:10:44Z")

</div>

I don't know why it's happening but it doesn't seem worth investigating when it only affects the user-command version and it's such a simple command that it doesn't really need to be a user command, TBH.

Using dopusrt to run the 2nd and 3rd lines in the user-command might fix it. Perhaps the selection is being done at the wrong time.

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [November 24, 2009, 3:12pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/9 "2009-11-24T15:12:36Z")

</div>

Oh wait, the problem is you're using Go UP and not Go BACK UP

Go UP on its own won't select anything. It reads a brand-new copy of the parent folder. You need to use Go BACK UP to make Opus use the cached parent folder (with the remembered folder selection).

---

<div class="post-metadata">

### Author: ![GoinPostal](https://resource.dopus.com/user_avatar/resource.dopus.com/goinpostal/32/26083_2.png) [@GoinPostal](https://resource.dopus.com/u/GoinPostal)
#### Post date: [November 24, 2009, 4:12pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/10 "2009-11-24T16:12:09Z")

</div>

thanks, this works great!

Also, when using the command on the folder extremities, it doesn't display an error, it just goes UP and stay at this place, which is nice indeed, no need of a vbscript for that 😉

---

<div class="post-metadata">

### Author: ![daroc](https://resource.dopus.com/user_avatar/resource.dopus.com/daroc/32/26038_2.png) [@daroc](https://resource.dopus.com/u/daroc)
#### Post date: [October 1, 2012, 8:48pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/11 "2012-10-01T20:48:37Z")

</div>

For some reason this code very often doesn't switch to next folder. Sometimes it works ok but very frequently it just refreshes the current folder view. Any idea as to how make it work more reliably?

```nohighlight
GO UP BACK
SELECT NEXT 
GO {f} 

```

---

<div class="post-metadata">

### Author: ![LeonardB](https://resource.dopus.com/user_avatar/resource.dopus.com/leonardb/32/26176_2.png) [@LeonardB](https://resource.dopus.com/u/LeonardB)
#### Post date: [October 2, 2012, 12:56am UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/12 "2012-10-02T00:56:41Z")

</div>

@daroc,

I copied your script and replaced GO UP BACK to GO BACK UP (Leo's) comment above, and it works for me.

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [October 2, 2012, 7:05am UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/13 "2012-10-02T07:05:50Z")

</div>

The order of the arguments shouldn't matter.

---

<div class="post-metadata">

### Author: ![daroc](https://resource.dopus.com/user_avatar/resource.dopus.com/daroc/32/26038_2.png) [@daroc](https://resource.dopus.com/u/daroc)
#### Post date: [October 2, 2012, 7:26am UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/14 "2012-10-02T07:26:40Z")

</div>

I don't think the order of params makes any difference in this case but I tried to change to GO BACK UP anyway - no result. It works in about 60 - 70% cases. Eg. I went to "c:\program files\AVAST software" (witch is the first file in program files) and wanted to go through all folders in "c:\program files" (there are 59 of them), clicking the button. It took me 95 clicks on the button. Sometimes I needed to click 3 - 4 times for one switch. I didn't click very quickly, every time I waited for folder content to load. I'm using list view, but on details mode the same happens to me.

It looks like "select next" is [very often] triggered before the content of parent folder is loaded so the command actually does nothing.

---

<div class="post-metadata">

### Author: ![LeonardB](https://resource.dopus.com/user_avatar/resource.dopus.com/leonardb/32/26176_2.png) [@LeonardB](https://resource.dopus.com/u/LeonardB)
#### Post date: [November 21, 2012, 7:55pm UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/15 "2012-11-21T19:55:01Z")

</div>

[quote]I don't think the order of params makes any difference in this case but I tried to change to GO BACK UP anyway - no result. It works in about 60 - 70% cases. Eg. I went to "c:\program files\AVAST software" (witch is the first file in program files) and wanted to go through all folders in "c:\program files" (there are 59 of them), clicking the button. It took me 95 clicks on the button. Sometimes I needed to click 3 - 4 times for one switch. I didn't click very quickly, every time I waited for folder content to load. I'm using list view, but on details mode the same happens to me.

It looks like "select next" is [very often] triggered before the content of parent folder is loaded so the command actually does nothing.[/quote]This technique of navigating through directories was useful for me, but now I'm experiencing the exact same problem

This technique of navigating through directories was very useful for me but now I'm experiencing the exact problem as described above. Has anyone figured out how to make this work correctly and more reliably?

---

<div class="post-metadata">

### Author: ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)
#### Post date: [January 4, 2013, 12:33am UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/16 "2013-01-04T00:33:24Z")

</div>

I´d expect this simple code to work. It´s supposed to abbreviate the action of looking through various subsequent folders.  
It shortly jumps to the next folder (so "Go Up" / "Select Next" works), but then immediately falls back to the starting folder.  
What is wrong with that code? 😕

```nohighlight
Go UP
Select Next
Go {f}

```

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [January 4, 2013, 2:49am UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/17 "2013-01-04T02:49:52Z")

</div>

Existing thread about that: [the threads have now been merged].

Nobody has posted a reliable method, though.

EDIT 2018: Here's one - [Command: Go-Relative (go to next/prev sibling folder)](https://resource.dopus.com/t/command-go-relative-go-to-next-prev-sibling-folder/20597)

---

<div class="post-metadata">

### Author: ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)
#### Post date: [January 4, 2013, 2:53am UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/18 "2013-01-04T02:53:27Z")

</div>

When you Go UP the folder is re-read and the selection will be on the top item in the list. If you use Go BACK then the selection will remain where it was and so Select NEXT will have the desired effect. I'm not sure if it will actually work though but it's worth a try 🙂

---

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [January 4, 2013, 2:57am UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/19 "2013-01-04T02:57:12Z")

</div>

You'd want Preferences / Folders / Folder Behaviour / Select previous folder when going Up turned on, I expect. Then you can use Go UP or Go UP BACK, but there are probably still potential timing issues as the commands aren't designed to do this kind of thing.

---

<div class="post-metadata">

### Author: ![abr](https://resource.dopus.com/user_avatar/resource.dopus.com/abr/32/62448_2.png) [@abr](https://resource.dopus.com/u/abr)
#### Post date: [January 4, 2013, 3:03am UTC](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669/20 "2013-01-04T03:03:53Z")

</div>

> [@jon](#):
>
> When you Go UP the folder is re-read and the selection will be on the top item in the list. If you use Go BACK then the selection will remain where it was and so Select NEXT will have the desired effect. I'm not sure if it will actually work though but it's worth a try 🙂

I tried it, but to no avail. Seems to be a timing issue (maybe we need some delaying command like "pause 100" or something 😃). I also tried Leo´s suggestion, but that folder  
behavior option is already set to go "back". By the way, I have already some makro for that (an application) folder hopping, but it would be cool to have it directly in Opus.

[Next page](https://resource.dopus.com/t/button-to-navigate-through-dirs/8669.md?page=2)
