Save Settings Every X Minutes

Features wanted...
arirish
Posts: 92
Joined: 13 May 2008 13:52

Save Settings Every X Minutes

Post 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.
Last edited by bdeshi on 02 Oct 2015 11:02, edited 1 time in total.
Reason: better title

binocular222
Posts: 1419
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: Save Settings Every...

Post 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}
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Filehero
Posts: 2713
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Save Settings Every...

Post 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

tedy
Posts: 323
Joined: 17 Jun 2009 21:48

Re: Save Settings Every...

Post 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.

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Save Settings Every...

Post 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".

highend
Posts: 14566
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Save Settings Every...

Post 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 230 times
One of my scripts helped you out? Please donate via Paypal

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Save Settings Every...

Post 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.

Syclone0044
Posts: 11
Joined: 02 Oct 2015 08:09
Location: Wisconsin, USA
Contact:

Auto-save Settings every [x] Minutes

Post 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.
Long time Xyplorer user, since October 2000 when it was TrackerV3. That makes this the 15th year :D

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Save Settings Every...

Post 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 183 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)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

eil
Posts: 1815
Joined: 13 Jan 2011 19:44

Re: Save Settings Every X Minutes

Post 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.
Win 7 SP1 x64 100% 1366x768|1900x1080

eil
Posts: 1815
Joined: 13 Jan 2011 19:44

Re: Save Settings Every...

Post 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:
Win 7 SP1 x64 100% 1366x768|1900x1080

highend
Posts: 14566
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Save Settings Every X Minutes

Post 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?
One of my scripts helped you out? Please donate via Paypal

eil
Posts: 1815
Joined: 13 Jan 2011 19:44

Re: Save Settings Every X Minutes

Post 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.
Win 7 SP1 x64 100% 1366x768|1900x1080

admin
Site Admin
Posts: 64847
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Save Settings Every X Minutes

Post by admin »

I will add the feature to 16.00.

eil
Posts: 1815
Joined: 13 Jan 2011 19:44

Re: Save Settings Every X Minutes

Post by eil »

wow, thanks! =)
Win 7 SP1 x64 100% 1366x768|1900x1080

Post Reply