Environment (Macro) Variables

Discuss new features and functions
Posts: 15
Joined: 19 Mar 2016

Waltz

I have been trying to find a way to reference the FFS source path and FFS target path in a DOS BAT (batch) file. These are the ones displayed in the FFS UI grid,
When I try to define them in the BAT file it does not carry over so that I can use them in another Macro or another BAT file.

Would it be possible to add Environment Variables in FFS for the FFS Source and FFS Target paths that are displayed in the FFS grid UI?

Suggestions:
%Left_Source_Path%
%Right_Target_Path%

Thanks…Waltz
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

Do you want to transfer the macro from a calling .bat file to FreeFileSync or from FreeFileSync to an external application started from its main dialog?
Posts: 15
Joined: 19 Mar 2016

Waltz

Do you want to transfer the macro from a calling .bat file to FreeFileSync or from FreeFileSync to an external application started from its main dialog?Zenju
From FreeFileSync to an external application. I want to set the two paths in the FFS Graphical interface pull-downs and have these base paths available in the macro interface as environment variables. I can then pass them into a DOS BAT file, or another application, on the parameter list. The object is to run the Macro by
1. Setting up the base paths in the FFS UI grid.
2. Just pressing a number key to execute the macro.

These should get updated when the pull-down path is changed… as the current %item_path% and %item_folder% is now doing.

Thanks... Waltz
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

So you basically want some %base_folder_path% macro and not the full %item_path%?
Posts: 15
Joined: 19 Mar 2016

Waltz

So you basically want some %base_folder_path% macro and not the full %item_path%?Zenju
If that is what appears in the pull-down area of the UI (User Interface) Grid in FFS, Then YES! But I would like to have one for the source pull-down and one for the Target pull-down. These would be very handy when writing DOS Batch files and make FFS even more valuable... if that is even possible.
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

A %base_folder_path% doesn't make sense to show in the folder drop down list. I think you simply want to start an external application and pass %base_folder_path%, %base_folder_path2% commands that are substituted by the current folder pair. If not, can you give a concrete example of what you want to achieve?
Posts: 15
Joined: 19 Mar 2016

Waltz

A %base_folder_path% doesn't make sense to show in the folder drop down list. I think you simply want to start an external application and pass %base_folder_path%, %base_folder_path2% commands that are substituted by the current folder pair. If not, can you give a concrete example of what you want to achieve?Zenju
YES! I sent this example earlier via email reply and apparently the message did not go through. My bad!

Whatever appears in the “folder drop down list” at the top of the UI (User Interface) Grid. I will try and attach the example from the FFS help file. Using your suggested macro names and the help file example, it would be
%base_folder_path%=C:\Source” and
%base_folder_path2%=D:\Target”.

I also show a use for the second (base Target) in my post viewtopic.php?t=2531#p10555
It would be much better to replace the “My destination folder” with the macro “%base_folder_path2%“… so that the macro did not need to be edited for various targets.

Thanks... Waltz
Attachments
FFS-Basic paths.jpg
FFS-Basic paths.jpg (35.31 KiB) Viewed 2125 times
Posts: 21
Joined: 2 Aug 2016

CaptainStarbuck

I was looking for something like this today. I didn't see the option in macros and didn't think to look in the external apps page.

My goal would be to support this pattern in the Left\Right UI:
From C:\users\me\foo\bar To: E:\backups\me\foo\bar
%source%=C:\users\me
%folders%=\foo\bar
%target%=E:\backups\me
From %source%%folders% To %Target%%folders%

With that pattern just change the %target% at a high level and everything goes to a new base path. Or copy the configs to another system that's structured the same, change the user name in source and target, and nothing else changes. For an extra bonus, allow an application-level %user% value to be saved, so:
%source%=C:\users\%user%
%target%=E:\backups\%user%
So now only the user name needs to change in the app options (or pulled from the current user logon) and no change to configs is required.

To summarize, I think I'm asking for a user-defined set of app-level environment values, coupled with a similar config-level set of values. These get Set whenever the app opens and whenever changed. And these need to be allowable in the Left/Right folder fields, with substitution at runtime.

A change like this isn't worth it for one person but with this kind of versatility all kinds of options are possible for a lot of people.

Thanks for your consideration.