Inital file in dual display

I use a Data drive (D:) and a Backup drive (E:). When working in the Data drive, I often have to retrieve a file from the same folder but on the Backup drive. So I open the Dual Display, which starts out with the same location I am at. I then have to click the E: drive icon, then navigate down to the matching folder and file.

How I can I get it to go to the same folder but use E: instead of D: in the destination path for the second display? That would save me lots of navigation time.

Dick

Use Navigation Lock feature.

Or if you find yourself working with the same folders repeatedly, you could set up a Style or a Layout which would load the D: data drive folder you want in the left pane and the E: Backup folder you want in the right pane (or vice versa). From there you could use navlock as Xyzzy suggested to go up or down in either drive and the other drive will follow.

My old Cycle Paths script could probably be modified to take the current path and change the drive letter, FWIW.

Or...wouldn't the easiest option be to save the tab - or multiple tabs (if needed) - as a separate Folder Tab Group? Even if you only save one tab in the group - say for the folder you need on drive (D:) - then you could just right-click the empty space after your existing tabs, select "Groups" and then click on the name of your new tab.

Viola! You're good to go.

So...

  1. Open a new tab and navigate to the folder you need on either drive (drive D: in this example).
  2. Save that tab as a new Folder Tab Group named whatever you want.
  3. Right-click in the empty space next to your open tabs and select the new group you just created.
  4. Your tab should open in the proper drive and directory!

Lastly, you could either save your configuration as a new layout - as mentioned above - or you could also just add these tabs to your listers as part of your "default" Folder Tab Group. That way, they'll always be there when/if needed. If you don't need them, you can leave them be, use them to browse other directories or simply close them if they bother you.

I'm doing something similar right now. My "default" Folder Tab Group contains 3 tabs - each to different directories (2 of which are on different partitions). It seems to work nicely.

I hope this helps...

I'm assuming the folders are not always the same each time.

i.e. You might want to switch from D:\Moo to E:\Moo on one day, but want to switch from D:\Cow to E:\Cow on another.

OTOH, if the folders are the same each time then there are lots of easy ways to cycle between them, including folder tabs (as you mention) or the SWITCHPATHS stuff mentioned in the post above the Cycle-Paths post I linked (same thread, but an earlier post), or a heap of other ways...

Yes, changing the drive letter is exactly what I need to do.

Example: When I'm in "D:\Cows\Cow1", I want to go to "E:\Cows\Cow1".

But I don't know how to change only the drive letter. I reviewed your script, and searched the Help file, especially under the Go commands, but still can't find the right command I need. Can you show me?

Creating tabs or layouts would require a fixed set of folders. So that would not work for me.

I'm using a context menu to handle this right now, until I figure out a more direct way. I tried using Go PATH="E:{sourcepath}" in the context menu command, but that doesn't work. I can't find a command to strip the drive letter from sourcepath, add my own letter, then use what's left of sourcepath.

I have been working on this and came up with the following:

@set var = "e:{leftpath|nopath}"
go {$var}

This works if the path is short ie. c:\donut
The "nopath" modifier will remove all of the path. For example if the path is c:\donut\test, all of this will be removed.
Maybe this gives you a starting point anyways.
BTW: you have to set focus on the list you are going to change the path of.

Yeah - you're sort of stuck with having to use some scripting glue.

I've posted a hacked version of Leo's original cycle_paths script in the post he linked to... see if that works for you. I tried to keep it functionally the same as Leo's original, in terms of both "method" and "examples" of use... Use the Cycle Paths (C F G H + Folders).dcf button as a starting point, and modify the first line to use [b]D:|E:[/b] instead of [b]C:|F:|G:|H:[/b] in the TO argument.

Also, I think you may have wanted to open the "backup" drive path in a second-file display of the current lister? If so, make one other modification to the button commands, at the very end change the line:

Shell.Run """" & strOpusHomePath & """ /CMD Go PATH=""" & nextPath & """"

to

Shell.Run """" & strOpusHomePath & """ /CMD Go OPENINDUAL PATH=""" & nextPath & """"

...however, with that change - it won't really "cycle" through paths anymore so much as just open in the other display whichever drive path follows your current drive path in the TO argument list.

I don't want to remove the path -- I just want to change the drive letter in that path.

I reviewed Cycle_Paths and tried to find how to strip the drive letter from a path, but didn't find anything there.

For instance, if there was a command called {sourceapathnodrive} that removes the drive spec from {sourcepath}, I could then reconstruct the path as "E:{sourceapathnodrive}". I could then specify that for the initial folder when opening a dual-file display.

What I do now with the target folder selected is:
o Open another file display in the same lister.
o Click the other file display.
o Click the "E" drive icon, which highlights the drive's root.
o Navigate to the target folder on E (lots of clicking to drill down).

[quote="daddyman"]I have been working on this and came up with the following:

@set var = "e:{leftpath|nopath}"
go {$var}

This works if the path is short ie. c:\donut
The "nopath" modifier will remove all of the path. For example if the path is c:\donut\test, all of this will be removed.
Maybe this gives you a starting point anyways.
BTW: you have to set focus on the list you are going to change the path of.[/quote]

Steje's done it for you. Did you miss his reply? :slight_smile:

Yes, I saw is repy, and I tried it out. But I get an error that says there is a problem renaming the selected folder. I'm not sure that means, since I'm not trying to rename anything. Maybe it renames something internally, but it's too complicated for me to try to understand or modify that code. I'm not familiar with the coding for DOpus enough to mess with it.

I tried using Go {clip} in a context menu command after putting a test path in the clipboard, but it doesn't do anything. If I put the path directly and in quotes, it goes to that path.

So I tried Go "{clip}", but nothing happens. I don't know how to concatenate the quote marks around {clip}, and not even sure it is passing the clipboard content.

I also can't find anything in the Help file for SWITCHPATH. It mentions it in the general description at the top of the Raw Commands list, but it is not described below.

Steje's done it for you. Did you miss his reply? :slight_smile:[/quote]

[quote="dick.girard"]Yes, I saw is repy, and I tried it out. But I get an error that says there is a problem renaming the selected folder. I'm not sure that means, since I'm not trying to rename anything. Maybe it renames something internally, but it's too complicated for me to try to understand or modify that code. I'm not familiar with the coding for DOpus enough to mess with it.

I tried using Go {clip} in a context menu command after putting a test path in the clipboard, but it doesn't do anything. If I put the path directly and in quotes, it goes to that path.

So I tried Go "{clip}", but nothing happens. I don't know how to concatenate the quote marks around {clip}, and not even sure it is passing the clipboard content.

I also can't find anything in the Help file for SWITCHPATH. It mentions it in the general description at the top of the Raw Commands list, but it is not described below.[/quote]
Well, there's not much "code" you need to think about modifying... I explained exactly what you should replace in the button based on what you "seem" to want to do. All the button examples use [b]C:|F:|G:|H:[/b] as the paths to cycle through... you seemed to want - [b]D:|E:[/b]. The button also doesn't open the 'other' path in a dual-display lister... so I said to just add an OPENINDUAL argument to the Go command that the button runs.

Here's a version with those basic changes made and the button label adjusted. If it tries to actually "rename" something or otherwise just doesn't work - then perhaps you can explain exactly what you're doing to add the button to the toolbar, and any other details about your situation... what folder you're in, does the same path in fact exist in the 'other' drive letter, do you in fact have anything 'selected', what is the exact "error message", screen shots, etc?
Cycle Paths (D E + Folders + OPENINDUAL).zip (2.28 KB)

Oh - and you're right. There seems to be no documentation on SWITCHPATH... but as Leo mentioned, it is referenced in the Cycle Paths script post he linked you to. Look there for an example of it's use... But it's not what you seem to want, as it requires that you have static full paths that you want to switch between every time...

I ended up creating a small app (using AutoIt) that I call "Go Backup.exe". It reads "{leftpath}" from DOpus. I then read the command line, parse and split the path, change the drive to "E:", then append the rest of the path to create a new path. The rest of the path is the same. I then execute the DOpus "Go " command from my exe using dopusrt.exe.

Now when I open a dual display, I click on the second display, R-click, and select the command. It works great.

I use this command in a context menu:
@runonce "\Go Backup.exe" {leftpath}

I called this context menu "Go Backup" under the > area from Settings > File Types.

If you want to try it out, tell me how to attach an exe. It's 300 KB. It should work if you have an E: drive. [I could make the drive letter selectable if needed.]

OK, I looked into posting AutoIt code in the FAQ, so here is the code:

AutoIt script: Go Backup.au3

#Region: Include
	#include <Constants.au3>
	#include <file.au3>
	#include <array.au3>
#EndRegion
#Region: Declare
	;Declare vars.
	Dim $pid, $Path, $Drive, $Dir, $Name, $Ext
	Dim $Programs, $FileList_array, $DOpus_dir, $dopusrt
	Dim $Selected, $Path_new
#EndRegion
#EndRegion
#Region: Run
	FindDOpus()
	ChangeDrive()
#EndRegion
#Region: FindDOpus
	Func FindDOpus()
		;This finds installed path of DOpus and uses that path for running dopusrt.exe.
		
		;Get path to program files folder.
		$Programs = @ProgramFilesDir
		;Get array of folders under Program Files.
		$FileList_array = _FileListToArray($Programs, "*", 2)
		;Loop through array to find DOpus.
		For $i = 1 To $FileList_array[0]
			If StringInStr($FileList_array[$i], "Directory Opus") Then
				;When found, save path and location of dopusrt.exe, then exit loop.
				$DOpus_dir = $Programs & "\" & $FileList_array[$i]
				$dopusrt = $DOpus_dir & "\dopusrt.exe"
				ExitLoop
			EndIf
		Next
	EndFunc
#EndRegion
#Region: ChangeDrive
	Func ChangeDrive()
		$Selected = $CMDLINERAW
		;Remove quote marks from string.
		$Selected = StringReplace($Selected, '"', "")
		;Split path into parts.
		$Path = _PathSplit($Selected, $Drive, $Dir, $Name, $Ext)
		;Reconstruct path to use E: drive and same $Dir.
		$Path_new = "E:" & $Dir
		;Run the Go <path> command in DOpus.
		ShellExecute($dopusrt, " /cmd" & Chr(32) & "Go" & Chr(32) & '"' & $Path_new & '"')
	EndFunc
#EndRegion

[quote="dick.girard"]I ended up creating a small app (using AutoIt) that I call "Go Backup.exe". It reads "{leftpath}" from DOpus. I then read the command line, parse and split the path, change the drive to "E:", then append the rest of the path to create a new path. The rest of the path is the same. I then execute the DOpus "Go " command from my exe using dopusrt.exe.

Now when I open a dual display, I click on the second display, R-click, and select the command. It works great.

I use this command in a context menu:
@runonce "\Go Backup.exe" {leftpath}

I called this context menu "Go Backup" under the > area from Settings > File Types.

If you want to try it out, tell me how to attach an exe. It's 300 KB. It should work if you have an E: drive. [I could make the drive letter selectable if needed.][/quote]

There are quicker ways to find the home folder of Opus. Perhaps the best is to use the registry settings

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{556DF27F-5B74-11D5-B876-004005E12EF1}\InstallLocation (Note this is the 32-bit path)

or

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\DOpus.exe