Seprate Scripts folder.

Features wanted...
Post Reply
gogogadgetscottOvr21
Posts: 8
Joined: 01 Dec 2009 15:31

Seprate Scripts folder.

Post by gogogadgetscottOvr21 »

I am working on creating a script that allows the user to quickly switch XYplorer profiles (my version of switching config files and Application Data Path). I have a folder called Profiles that contains a separate folder for each profile. This works great to allow quick access to custom Catalog, POM, etc.. However, I would like to use the same script folder for each profile. Ideally I would use the default Script folder as located in xypath. Is it possible to add a option in the config file that overrides the default script folder location?

Example tree structure:

Code: Select all

.\XYplorer
··· Scripts
··· Profiles
    ··· Main
        XYplorer.ini < contains line ScriptPath=.\Scripts >
        ··· FindTemplates
        ··· NewItems
        ··· Panes
    ··· Laptop
        XYplorer.ini < contains line ScriptPath=.\Scripts >
        ··· FindTemplates
        ··· NewItems
        ··· Panes
    ··· Sandbox
        XYplorer.ini < contains line ScriptPath=.\Profiles\Sandbox\Scripts >
        ··· FindTemplates
        ··· NewItems
        ··· Panes
        ··· Scripts

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Seprate Scripts folder.

Post by PeterH »

This is a wide area.
For example I would like to use the same keyboard shortcuts in such situations. And I'm afraid there is - from user to user - very different need for such definitions. This can get rather complicated.

But it's right: scripting library is one of the most neccessary configuration resources to share.
And maybe the easiest, as XY itself has no need to write into.

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

Re: Seprate Scripts folder.

Post by admin »

I like it. Added a tweak

Code: Select all

        [Settings]
        ScriptsPath=...

gogogadgetscottOvr21
Posts: 8
Joined: 01 Dec 2009 15:31

Re: Seprate Scripts folder.

Post by gogogadgetscottOvr21 »

admin wrote:I like it. Added a tweak
Great!!! Thank you.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Seprate Scripts folder.

Post by Stefan »

admin wrote:I like it. Added a tweak

Code: Select all

        [Settings]
        ScriptsPath=...
Yeah thanks.

Perhaps you also like:
NewItemsPath=...
DatsPath=...

Then i can use Startup.ini again
[AppData]
Path=%ComputerName%
;Path=%UserName%


with
[Settings]
ScriptsPath=..\Scripts
NewItemsPath=..\NewItems
DatsPath=<xypath>

in the %ComputerName%\XYplorer.ini


Because the user specific data like xy.ini and the panes folder and such
are then in sub-folders named as the host-/username
and the common files are in the main xy-folder then.

An step to keep temp data separately.

Example:
- PC001
- --FindTemplates
- --Panes
- --XYplorer.ini

- PC002
- --FindTemplates
- --Panes
- --XYplorer.ini

- NewItems common shared
- Scripts common shared
*.dat common shared
Startup.ini [AppData] Path=%ComputerName%
XYplorer.exe

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

Re: Seprate Scripts folder.

Post by admin »

Stefan wrote:A step to keep temp data separately.
Yes, I plan such a separation since long. There are several ways to go about this, but it's not on my immediate todo list, so I will postpone thinking about this...

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Seprate Scripts folder.

Post by PeterH »

admin wrote:I like it. Added a tweak

Code: Select all

        [Settings]
        ScriptsPath=...
I like it too. But it's bad :cry:

It's bad, as in the moments scripts don't know, where the scripts-folder is located. Till yesterday it was <xydata>\Scripts - now I'm afraid we need a new var <xyscripts>.

But as scripts should survive a new installation of win, I've moved \Scripts to a data partition already...
In other words: I really like it :D

PS If you do, for migration "scripters" could code for compatibility:

Code: Select all

   if ("<xyscript>" == '<xyscript>') { $xyscript = "<xydata>\Scripts" }
   else                              { $xyscript = "<xyscript>" } ;
(I never loved the difference between " and ' :roll: )

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Seprate Scripts folder.

Post by Stefan »

PeterH wrote:It's bad, as in the moments scripts don't know, where the scripts-folder is located.
If i understood you right, this could aid you:

self $CurrentScripts_Path, path;
or
$CommonScriptPath = getkey("ScriptsPath", "Settings");

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Seprate Scripts folder.

Post by PeterH »

Stefan wrote:
PeterH wrote:It's bad, as in the moments scripts don't know, where the scripts-folder is located.
If i understood you right, this could aid you:

self $CurrentScripts_Path, path;
or
$CommonScriptPath = getkey("ScriptsPath", "Settings");
Thanks Stefan - good info!
It's not the same as the wished variable, but just that makes it so good :)
(The script could have been called from other location...)

Code: Select all

v8.80.0010 - 2010-01-06 12:00
    + New variable: <xyscripts> = XYplorer scripts path (unslashed).
And thanks Don for the new variable.

Post Reply