Page 1 of 3

Save Settings Every X Minutes

Posted: 29 Jan 2014 01:41
by arirish
Have I just overlooked a setting somewhere, or is there no way to have XY save your settings automatically every [user specified] minutes? I have set it to save on close, but sometimes my PC is running for days on end without being shutdown at any point, and XY is running the whole time. This would be fine, except last week we had a power outage for 2 days and it made me realise I hadn't saved the settings manually for some time.

I recognise this could be solved by adopting a different working method, but I was curious to see if this exists already.

Re: Save Settings Every...

Posted: 29 Jan 2014 03:50
by binocular222
Run a script:

Code: Select all

while(1==1) {wait 5000; #182}
This save settings every 5000ms (5 seconds)

P.S: The easiest way to run a script is via addressbar. Paste this in addressbar:

Code: Select all

::while(1==1) {wait 5000; #182}

Re: Save Settings Every...

Posted: 29 Jan 2014 06:22
by Filehero
You may could ask Don to introduce an option that makes XY autosave the settings on every (explicit or implicit) change.


Cheers,
Filehero

Re: Save Settings Every...

Posted: 29 Jan 2014 09:35
by tedy
+2!
I have always wondered why Xy is not saving settings automatically/on OK etc.
Yes, I have a UPS but I have acquired a habit of selecting File - Save settings, File - Settings Special - Save configuration etc. after almost every change of something in XY :( . And I don't think this should be subject/available to scripting only. The config file should be saved when a setting has been changed.
No such habit in any other program.

I know XY is portable program and this could be the reason why it doesn't automatically save (running from write-protected flash drive etc.) but there should be option to make it act like regular programs do.

Re: Save Settings Every...

Posted: 29 Jan 2014 10:03
by LittleBiG
My colleague has tried the free version of XY. He configured the visual appearance to his need (columns, colors, etc.) After a while, something went wrong with his computer. Softwares suddenly stopped. He restarted the XY and he was struck that XY didn't keep his settings. I asked: did you click on the save button after configuring? The answer was: :shock:

I am already used to clicking the Save button, but he is a real beginner to XY. In my understanding, a "Save immediately" option would be the best for beginners, because that is what they expect. At least in case of the Configuration dialog.

Edit: or I would create a warning on the first click on the OK button of the Configuration dialog: "If you want to make your setting permanent, please don't forget to save the configuration".

Re: Save Settings Every...

Posted: 29 Jan 2014 10:11
by highend
An interim solution...

Remove the ";" in front of the ";#NoTrayIcon" if you don't want to have one (and recompile it afterwards).

Default value is 600 seconds = 10 minutes. This value can be adjusted (value = seconds!)
in the .ini file in the same directory (it get's autocreated on the first start).

It will look for a XYplorer window handle at each timeout and if one is found it will send
a script command ("#182 -> Save settings") to it...
XYplorer - Save Settings.zip
(440.63 KiB) Downloaded 229 times

Re: Save Settings Every...

Posted: 29 Jan 2014 15:36
by TheQwerty
My solution as of recently, uses Windows' Task Scheduler, a batch file, and Sysinternals' PsList

The batch file and pslist are used so that it only executes the script if XY is already running, and won't start XY when it isn't:

Code: Select all

@echo off
pslist.exe xyplorer && xyplorer.exe /script="::SaveSettings;" /flg=2
Then I have Task Scheduler set to run the batch file on workstation lock and on idle.

Works well and doesn't require having another process running in the background.

Auto-save Settings every [x] Minutes

Posted: 02 Oct 2015 08:15
by Syclone0044
This has been a long standing request of mine for several years.

I run Xyplorer all the time, for weeks, and it's a devastating loss of data when it crashes and I haven't Saved Settings lately. I lose all my recently Tagged data, my Favorites changes, my Tabs, etc.

I would like an option to Automatically save settings every [x] minutes. Perhaps every 5-10 minutes would be fine. And maybe save the Tagged/Fave/Tab data immediately upon changing? What purpose does delaying it serve?

Thanks, love this software otherwise. Right now I have to constantly remember to click the Save Settings button like Pavlov's dog.

Re: Save Settings Every...

Posted: 02 Oct 2015 10:42
by bdeshi
I made an autoIt3 utility. I'd be sad to see it die alone.

So here's xyautosave.
xyautosave.zip
(362.96 KiB) Downloaded 182 times
You have to call it from each XYplorer instance that should autosave settings, in this way: path\to\xyautosave.exe <hwnd> [savefrequency] [saveflags]
<hwnd> resolves to the XYplorer window's unique identifier.
savefrequency defaults to 10 minutes. flags defaults to 1023 (save all).
(To learn more about flag, enter this in XY's addressbar: ::rtfm 'idh_scripting_comref.htm#idh_sc_savesettings';)
This has a somewhat informative tray tooltip too!

And here's a user button snippet:

Code: Select all

Snip: CTB 1
  XYplorer 15.80.0100, 10/2/2015 2:38:03 PM
Action
  NewUserButton
Name
  XYAutoSave
Icon
  <xyscripts>\util\xyautosave.exe
ScriptL
  $xyas = "<xyscripts>\util\xyautosave.exe"; $freq=1; $flag=''; run quote($xyas)." ""<hwnd>"" ""$freq"" ""$flag""", gpc($xyas, 'path');
ScriptR
  
FireClick
  0
type ::snippet; in XY addressbar, press ENTER, then paste this snippet code to have a new button added. (remember to adjust xyautosave.exe path)

Re: Save Settings Every X Minutes

Posted: 04 Oct 2015 01:01
by eil
+1 for original idea from me, autosave on # minutes would be helpful.

though the AutoIt solution from SammaySarkar is very interesting too. still i miss "autorun ability" in it, 'cause user may forget to run it each time = add it to XY's "run script on start" would be more appropriate.

Re: Save Settings Every...

Posted: 27 Oct 2015 21:19
by eil
SammaySarkar wrote:type ::snippet; in XY addressbar, press ENTER, then paste this snippet code to have a new button added. (remember to adjust xyautosave.exe path)
can you please provide anther way to use your tool? i want to run it with XY start, but not sure what will be the proper syntax.
still i hope one day such option to appear in XY. :roll:

Re: Save Settings Every X Minutes

Posted: 27 Oct 2015 21:31
by highend
call xy with /script=""

and either put the commands into it (but adapt to the necessary quoting!) or save the commands to a script and call that instead?

Re: Save Settings Every X Minutes

Posted: 31 Oct 2015 20:57
by eil
no luck. i put this line in script

Code: Select all

$xyas = "<xyscripts>\autoSave\xyautosave.exe"; $freq=1; $flag=''; run quote($xyas)." ""<hwnd>"" ""$freq"" ""$flag""", gpc($xyas, 'path');
and made shortcut-

Code: Select all

D:\Progs\XYplorer\XYplorer.exe /script="<xyscripts>\autoSave\xyautosave.xys"
XY starts but i see no presence/work of utility.

Re: Save Settings Every X Minutes

Posted: 31 Oct 2015 21:07
by admin
I will add the feature to 16.00.

Re: Save Settings Every X Minutes

Posted: 31 Oct 2015 22:54
by eil
wow, thanks! =)