Favourites, aliases & Backup & Restore with environment vars

I use Dopus on my desktop & laptop. One of the major folders I work in is the dropbox folder. This folder is on F:\ on my desktop and D:\ on my laptop.

I usually modify the Dopus settings on my desktop and back it up using the Dopus backup & restore fairly frequently. However, if I want to enjoy the changes on my laptop, I have to go through the favourites & aliases modifying all the paths to from F:\dropbox to D:\dropbox, every time I make changes.

I thought that this issue might be solved by setting a win 7 environment variable for the location of the dropbox folder. This would work great as I would only have to change my existing bookmarks and aliases once. However, I had the following questions and possible feature requests:

  1. When adding a new favourite using "add favourite", there is no option to modify the folder location (in a similar fashion to the fave display name) so that the path can be modified from e.g. F:\dropbox --> %dropbox_dir%\dropbox.

I have to create the fave, then re-edit it to apply the correct path. Additionally, there is no option to add the alias simultaneously, so that has to be also edited. Thus adding a fave is going to involve a minimum of at least 3 cumbersome steps. Is there any way around this?

  1. Is there any possibility of introducing some kind of multiple "machine_list" section in the backup and restore? The reason being there are folders that are unique to my Desktop and laptop. Consequently I cannot solve this issue using environment variables. I will have to recreate the unique folders of one of the machines each time I restore the configuration.

So it would be good if during the restore process there was an options section to select which machine's faves you wish to import from the "machine_list"

  1. Is there any possibility of also having a feature in the the backup & restore that stores the environment variables in the "machine_list" section with their associated paths, so upon restoring to a fresh install, these variables are automatically added to the Windows registry? That way if I use (typically) the same directory structure, we don't have to worry about entering the env variable again. If the directory structure is different the exact name of the variable is already in the registry, only the path has to be ammended and you don't have to waste time (esp if you have more than one var) checking to find the exact name of the variable to enter. You could prob have a section in the backup & restore that prompts you to check if the var is set correctly perhaps.

e.g. "machine_list" section
#machine_name: Laptop
dropbox_dir="F:\dropbox "

#machine_name: Desktop
dropbox_dir="D:\dropbox"

Many thanks! :slight_smile:

You could configure the Prefs BACKUP command in a button and use a {dlgstring$} prompt to determine the target folder.

Regards, AB

I'm not sure I understand your solution completely. It seems that it is only setting which folder the backup configuration file is being stored? Could you elaborate if I have misunderstood please? :slight_smile:

Apologies. That would be because I failed to read your question carefully! :blush:

I also use Dropbox to share settings between desktop, laptop, and VMs. I have a button that saves my favourites using nomenclature which includes the source computer name, user name, and a current timestamp - e.g. MyPC-AB-20130821-121314-favorites.ofv. Another button is configured to restore a selected saved favourites (ofv) file. My Dropbox is always in the default location so in my buttons I simply reference the Dropbox folder as /profile\Dropbox.

Regards, AB

That sounds interesting. Could you hopefully share the buttons code if it's not too much of a bother? :slight_smile:

No bother. Note, however, that the process is quite complex. This is due to the need to deal with Opus eccentricities and timing issues. I have annotated the buttons and will attach the button and user command code as a zip file.

Here is the SAVE button and its associated User Command




This is the RESTORE button and its associated User Command




Regards, AB
FavSaveRest.zip (2.59 KB)

Nice one! :slight_smile: Thanks v much. :slight_smile:

My Backup button code testing was performed in a specific environment - starting from the Configfiles folder. It doesn't work generically. Updated code follows. Go "{$srcdir}" NEWTAB=findexisting was the key missing statement. Apologies. :blush:

[code]//Backup Opus favourites (\configfiles\favorites.ofv) to Dropbox
//Rename on the fly to include computername, username, and last modified timestamp
//Setting the timestamp in the name of the backup to the last modified timestamp of the source
//prevents the creation of multiple backup copies of the same unchanged favourites with different names

@nofilenamequoting
@set srcdir = {alias|dopusdata|noterm}\ConfigFiles
Go "{$srcdir}" NEWTAB=findexisting
@set tgtdir = {alias|profile|noterm}\Dropbox\OpusSettings
@set srcfile = favorites.ofv
@set temp=tmp.tmp
Delete "{$temp}" NORECYCLE QUIET
//Create, select, and rename a copy of favourites
Copy "{$srcdir}{$srcfile}" DUPLICATE AS "{$temp}"
Select "{$temp}"
Rename "{$srcdir}{$temp}" TO "%COMPUTERNAME%-%USERNAME%-{modified|D#yyyy-MM-dd}@{modified|T#HH-mm-ss}-{$srcfile}" FILEINFO

//The following copy command, if activated, breaks the button
//It appears that any reference to {file$) or {filepath$} triggers the problem
//Copy "{file$}" TO "{$tgtdir}" AS "{$tgtfile}"

//A way around the problem is to trigger a user command to execute the copy/move
//First we need to waste some time to allow the rename to complete
@confirm:Backup the highlighted Opus favourites?\n(N.B. Wait for temp file remame to complete)|Backup|Cancel
+MoveSelectedTo where="{$tgtdir}"

//Now we can switch to the target location and highlight the most recent favourites backup
Go "{$tgtdir}" NEWTAB=findexisting
Set SORTBY=modified GROUPBY=off
Set QUICKFILTER "%COMPUTERNAME%-%USERNAME%--{$srcfile}"
Select FIRST TYPE=files [/code]
Regards, AB

no worries man. no wasted time as I did not get the chance to test it yet. glad you caught it! :slight_smile: