Dynamic SWITCHPATH button, with reverse cycling

Newer version:

A re-written, improved version of this can be found here:

Old version:


Beneficial if you would like a lot of path cycling going on without too many buttons/menu items.

Script Required (below)

If you are unfamiliar with Go SWITCHPATH or cycling through paths please read this beforehand:

Since we are dealing with multiple cycle path groups, running in one button. We run into a little problem. Which one gets run? It's based off the current viewing path in DOPUS. So for the script to cycle through folders it needs to be viewing a path of one you entered in the config file before hand. But if it's not, it will open the first path in the last group that is in the config file. and that will get cycled on the next button click.

You could use favorites to get you to the paths in a cycle group, and use the button from there

Config File Example:

C:\
D:\
E:\			<----------------------      Cycle Path Group 1
M:\
N:\
-
M:\scripts\batch	<------ Cycle Path Group 2, and so on
M:\snippets\batch
-
M:\projects\c
M:\snippets\c
-			<------------------------ Group Ends, New Begins
C:\Program Files	
C:\Windows
C:\Windows\system32

Button Example: (forward and backward cycling)

Be sure to set function type to: MS-DOS Batch Function

@keydown:common
@runmode:hide
@nofilenamequoting
cd "C:\path\to\script"
@keydown:none
@sync:call "C:\path\to\script\dopus_switchpath.bat" "{sourcepath|noterm}"
@keydown:shift
@sync:call "C:\path\to\script\dopus_switchpath.bat" "{sourcepath|noterm}" -r

Clicking normally cycles forward, holding shift and clicking cycles backwards.

This button can be used feel free to create it now, after you download the script setup the paths accordingly

You may be wondering why I have @nofilenamequoting and there is quotes around sourcepath. There was a issue with DOPUS not quoting the file name after sending the initial "Go SWITCHPATH" through dopusrt.exe, so this is the workaround...

Dynamic_SWITCHPATH.rar (1.8 KB)

READ THE README_FIRST.TXT!

Enjoy!

I can't see a reason why @nofilenamequoting + quotes would be any different to removing @nofilenamequoting + quotes in this case. The {sourcepath|noterm} argument would be passed to the batch file exactly the same, either way; after that, how things are quoted is up to the batch file rather than Opus itself.

Anyway, if it works then that's all that matters, and @nofilenamequoting often simplifies things when joining bits of paths together, but I think there may be a misunderstanding about why it didn't work without @nofilenamequoting, FWIW.

I was under the impression DOPUS always quoted the path, but it only does so when a space is involved.

My mistake, no issues with DOPUS or dopusrt.exe !