is there a way to backup toolbar?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
giuliastar
Posts: 365
Joined: 14 Sep 2013 07:22

is there a way to backup toolbar?

Post by giuliastar »

Hi
is there away to backup toolbar?

my point is to have different toobars ,with different button ,custom and built in icon

well I would like to backup the actual custom toolbar and restore after

thanks

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

Re: is there a way to backup toolbar?

Post by highend »

Code: Select all

    // Backup
    $name = input("Toolbar file name", "Without any extension!", "default");
    if ($name) {
        writefile("<xydata>\Toolbars\$name.txt", toolbar(), , 65001);
    }

Code: Select all

    // Restore
    end (exists("<xydata>\Toolbars") != 2), 'No "Toolbars" folder in <xydata>, aborted!';

    $names = listfolder("<xydata>\Toolbars", , 1+4, <crlf>);
    end (!$names), 'No file(s) in "<xydata>\Toolbars", aborted!';

    $names = regexreplace($names, "\.txt$");
    $sel   = popupmenu($names, 6:=<crlf>);
    if ($sel) {
        toolbar(readfile("<xydata>\Toolbars\$sel.txt"));
    }
One of my scripts helped you out? Please donate via Paypal

giuliastar
Posts: 365
Joined: 14 Sep 2013 07:22

Re: is there a way to backup toolbar?

Post by giuliastar »

highend wrote: 25 May 2021 12:29

Code: Select all

    // Backup
    $name = input("Toolbar file name", "Without any extension!", "default");
    if ($name) {
        writefile("<xydata>\Toolbars\$name.txt", toolbar(), , 65001);
    }

Code: Select all

    // Restore
    end (exists("<xydata>\Toolbars") != 2), 'No "Toolbars" folder in <xydata>, aborted!';

    $names = listfolder("<xydata>\Toolbars", , 1+4, <crlf>);
    end (!$names), 'No file(s) in "<xydata>\Toolbars", aborted!';

    $names = regexreplace($names, "\.txt$");
    $sel   = popupmenu($names, 6:=<crlf>);
    if ($sel) {
        toolbar(readfile("<xydata>\Toolbars\$sel.txt"));
    }
hi
very nice script , can i save them in the folder Data\Scripts\ with the extension .xys?
i would like to store all the script in the folder Data\Scripts\
to have all the script in a drop list should i use the catalog or is there a way to have all of them just like a list (abd not load always via scripting -> load script file) ?

thanks Highend

Horst
Posts: 1092
Joined: 24 Jan 2021 12:27
Location: Germany

Re: is there a way to backup toolbar?

Post by Horst »

giuliastar wrote: 25 May 2021 18:39
highend wrote: 25 May 2021 12:29

Code: Select all

    // Backup
    $name = input("Toolbar file name", "Without any extension!", "default");
    if ($name) {
        writefile("<xydata>\Toolbars\$name.txt", toolbar(), , 65001);
    }

Code: Select all

    // Restore
    end (exists("<xydata>\Toolbars") != 2), 'No "Toolbars" folder in <xydata>, aborted!';

    $names = listfolder("<xydata>\Toolbars", , 1+4, <crlf>);
    end (!$names), 'No file(s) in "<xydata>\Toolbars", aborted!';

    $names = regexreplace($names, "\.txt$");
    $sel   = popupmenu($names, 6:=<crlf>);
    if ($sel) {
        toolbar(readfile("<xydata>\Toolbars\$sel.txt"));
    }
hi
very nice script , can i save them in the folder Data\Scripts\ with the extension .xys?
i would like to store all the script in the folder Data\Scripts\
to have all the script in a drop list should i use the catalog or is there a way to have all of them just like a list (abd not load always via scripting -> load script file) ?

thanks Highend
Of course you can.
You can also add the scripts to the left and right click of a CTB.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73

giuliastar
Posts: 365
Joined: 14 Sep 2013 07:22

Re: is there a way to backup toolbar?

Post by giuliastar »

Horst wrote: 25 May 2021 18:46
giuliastar wrote: 25 May 2021 18:39
highend wrote: 25 May 2021 12:29

Code: Select all

    // Backup
    $name = input("Toolbar file name", "Without any extension!", "default");
    if ($name) {
        writefile("<xydata>\Toolbars\$name.txt", toolbar(), , 65001);
    }

Code: Select all

    // Restore
    end (exists("<xydata>\Toolbars") != 2), 'No "Toolbars" folder in <xydata>, aborted!';

    $names = listfolder("<xydata>\Toolbars", , 1+4, <crlf>);
    end (!$names), 'No file(s) in "<xydata>\Toolbars", aborted!';

    $names = regexreplace($names, "\.txt$");
    $sel   = popupmenu($names, 6:=<crlf>);
    if ($sel) {
        toolbar(readfile("<xydata>\Toolbars\$sel.txt"));
    }
hi
very nice script , can i save them in the folder Data\Scripts\ with the extension .xys?
i would like to store all the script in the folder Data\Scripts\
to have all the script in a drop list should i use the catalog or is there a way to have all of them just like a list (abd not load always via scripting -> load script file) ?

thanks Highend
Of course you can.
You can also add the scripts to the left and right click of a CTB.
hi
but not a drop down list ,right?
thanks Horst

Horst
Posts: 1092
Joined: 24 Jan 2021 12:27
Location: Germany

Re: is there a way to backup toolbar?

Post by Horst »

giuliastar wrote: 25 May 2021 18:50
Horst wrote: 25 May 2021 18:46
giuliastar wrote: 25 May 2021 18:39
highend wrote: 25 May 2021 12:29

Code: Select all

    // Backup
    $name = input("Toolbar file name", "Without any extension!", "default");
    if ($name) {
        writefile("<xydata>\Toolbars\$name.txt", toolbar(), , 65001);
    }

Code: Select all

    // Restore
    end (exists("<xydata>\Toolbars") != 2), 'No "Toolbars" folder in <xydata>, aborted!';

    $names = listfolder("<xydata>\Toolbars", , 1+4, <crlf>);
    end (!$names), 'No file(s) in "<xydata>\Toolbars", aborted!';

    $names = regexreplace($names, "\.txt$");
    $sel   = popupmenu($names, 6:=<crlf>);
    if ($sel) {
        toolbar(readfile("<xydata>\Toolbars\$sel.txt"));
    }
hi
very nice script , can i save them in the folder Data\Scripts\ with the extension .xys?
i would like to store all the script in the folder Data\Scripts\
to have all the script in a drop list should i use the catalog or is there a way to have all of them just like a list (abd not load always via scripting -> load script file) ?

thanks Highend
Of course you can.
You can also add the scripts to the left and right click of a CTB.
hi
but not a drop down list ,right?
thanks Horst
The Restore script creates a drop down list to select the Toolbar to restore.
This works also in a left or right click of a button.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73

Linkaday
Posts: 367
Joined: 06 Aug 2007 14:40
Location: Hamburg, Germany - Win 10 Home v22H2 x64 1920x1080 (100%)

Re: is there a way to backup toolbar?

Post by Linkaday »

And then there is this auld script
http://www.xyplorer.com/xyfc/viewtopic. ... 240#p61697
I once saved it to the footer of my xys-template + menu 'User' >'Load script' (so to have it all over the place) and it's still running fine.
Replace 'open' by 'load' and you have two helpers.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Toolbar - going home

Post by aurumdigitus »

Have implemented these two scripts. Another very handy item found by reading over the Forum. Rather like Forrest Gump's box of chocolates, you never know what you're going to find.

Can someone sent me the "txt. file" for the OEM toolbar. Want it for comparison purposes. Tried to get it by using the Throwaway Clone but it opens with the customized TB. Thank you ...

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

Re: is there a way to backup toolbar?

Post by highend »

Just use fresh; from the address bar and you have it...
One of my scripts helped you out? Please donate via Paypal

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: is there a way to backup toolbar?

Post by aurumdigitus »

Embarrassingly simple.

If Fresh; is a command once known to me it has long been forgotten. But then scripting was never my strong suit.

Thank you for your time and skill. :appl:

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: is there a way to backup toolbar?

Post by RalphM »

Just remember that "fresh;" is kind of a testing environment to see whether your settings somehow interfere with your sysem/cause your problems, it is not meant to work in permanently.
Once you identified that your problem does not exist in a fresh instance, you still need to find the culprit setting and fix it in your working setup.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: is there a way to backup toolbar?

Post by aurumdigitus »

Over the weekend had occasion to fix a problem that was unrelated to the original question. But fresh; was just the ticket that led to the solution.

Glad I knew about it this time.

Post Reply