will scripting work on different configs?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

serendipity wrote:The moment that script is started, the respective config loads itself (with auto restart of xy) and scripts runs and does its job and finally reloads the original config.
I don't know how Don would be able to accomplish that trick! Windows has to put stuff into a Registry entry to be done on next reboot, so maybe XY would have to put the script request in some sort of a holding file?
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

Post by eurytos »

The problem with my idea is that I was thinking in terms of scripting an outside action that was independent of XYplorerer. I wasn't thinking in terms of the script performing an action which would affect something inside a current instance of XYplorer.

I can think of ways this would still work, but most of them require either a restart of the current app or spawn a new instance of the app with the different config. But, I don't really like either of those approaches.

hmm...

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

After a coffee i realized too that restarting and stuff is not exactly elegant.

This has been mentioned before and I would like to add that, since scripting is so powerful, Don can give users some more handle to control config settings via scripts.
Don's script above would work by using ::#496 which checks/unchecks "Show folders in list". But that will work the opposite way if you have it already unchecked. So if there was something like ::#496a to check and ::#496b to uncheck "Show folders in list" then it would work for everyone.

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

Post by admin »

serendipity wrote:After a coffee i realized too that restarting and stuff is not exactly elegant.

This has been mentioned before and I would like to add that, since scripting is so powerful, Don can give users some more handle to control config settings via scripts.
Don's script above would work by using ::#496 which checks/unchecks "Show folders in list". But that will work the opposite way if you have it already unchecked. So if there was something like ::#496a to check and ::#496b to uncheck "Show folders in list" then it would work for everyone.
Yes, I have planned exactly this already for the first issue of that kind: I reported this some weeks ago where you could not browse to a certain location because it was hidden, and the script was in danger to result in a disaster. Now currently there's only a "show hidden" toggle, so it's not predictable without knowing the state.
So I will add a number of new non-toggle setting functions to be able to control some settings via scripting.

Another way would be "assert conditions": assert [state x] else stop script. That would be easy to program but I fear the sheer number of necessary assertions... might be hundreds, and the chase will never stop as the app evolves... I'm not sure if I want to go that far.

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

This may have been discussed before in a way, but how about this concept:
A "push" cmd that would allow these type of settings to be saved, and if the script terminates prematurely for any reason or finishes normally, they would be "pop"d back automatically...and you'd specify via keywords/parameters a list of settings that you wish to be saved...
A "settings" cmd that would, via keyword params, make those changes to config and thus they'd be still retained after script unless they were "push'd using same keywords.

Something like "::Push ShowHidden", then "::Settings ShowHidden=Y" etc.
And if you wanted to, you could do a "::Pop ShowHidden" to reload orig value within script instead of waiting for it to end.

This might possibly reduce the number of params needed on various indivdual cmds...

May not be possible, but just throwing it out for discussion...
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

Another try at "config way" of doing it.
Thinking loud:
I still feel that, since XY's default config is something we all can have in common, it can be used exclusively for scripting.
how about one ini having 2 configs? I am not a programmer, so I dont know if thats possible. But what i mean is, in normal situations user config is used and if a script is to be run then XY's default config is used.
Something like,

if (script) {
xy config
} else
user config

But I guess if this was possible, Don would have done it already. Anyway, its good not to be a programmer, i can fool around with my own programming skills. :P

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

Post by admin »

Folks, please don't waste your time with loading configs. I won't go this way. :)

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

admin wrote:So I will add a number of new non-toggle setting functions to be able to control some settings via scripting.
This statement is what I was reponding to with my push/pop/settings cmd idea...not any sort of general/total config load/save...but rather a common way to set a number of options using one command instead of multiple commands.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

admin wrote:Folks, please don't waste your time with loading configs. I won't go this way. :)
Yup, I was only thinking loud there, wondering if it made sense. Now that it doesnt, i am playing fudoku to relax a bit. :P :wink:
btw, the noise at the end of 15 balls is quite scary.

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

Post by admin »

serendipity wrote:
admin wrote:Folks, please don't waste your time with loading configs. I won't go this way. :)
Yup, I was only thinking loud there, wondering if it made sense. Now that it doesnt, i am playing fudoku to relax a bit. :P :wink:
btw, the noise at the end of 15 balls is quite scary.
The noise when you succeed or the noise when you fail?

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Post by serendipity »

admin wrote:
serendipity wrote:
admin wrote:Folks, please don't waste your time with loading configs. I won't go this way. :)
Yup, I was only thinking loud there, wondering if it made sense. Now that it doesnt, i am playing fudoku to relax a bit. :P :wink:
btw, the noise at the end of 15 balls is quite scary.
The noise when you succeed or the noise when you fail?
the noise when i fail (its booing right?, i would prefer a simple booo), the one for winning is nice. But then its a personal thing, not to worry.

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

Post by admin »

serendipity wrote:
admin wrote:
serendipity wrote:
admin wrote:Folks, please don't waste your time with loading configs. I won't go this way. :)
Yup, I was only thinking loud there, wondering if it made sense. Now that it doesnt, i am playing fudoku to relax a bit. :P :wink:
btw, the noise at the end of 15 balls is quite scary.
The noise when you succeed or the noise when you fail?
the noise when i fail (its booing right?, i would prefer a simple booo), the one for winning is nice. But then its a personal thing, not to worry.
I don't know it, I never fail. :wink:
(It's hard to get a good booing crowd sound)

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Post by jacky »

hmm.. yeah, so this issue is really a bummer because it makes some things/scripts unable to function.

For instance, I was looking for a script that would rename a bunch of files to pre-defined fixed names. Because on a project here there a group of files generated each month that should always have the same names in the end, but that may have little variants as they're "human-generated" by different people.

My first idea was that it couldn't be easier, since they're always at least in the right order :

Code: Select all

::rename , file1.ext
::selpos +1
::rename , file2.ext
::selpos +1
::rename , file3.ext
//and so on
But that obviously cannot work, not if I can't disable "Resort list immediately after rename" during the execution of the script :(

Of course I could hint that a new rename feature (that's been mentioned in the past I believe, and/or also as a "New" feature) could be a nice thing. You know, where all filenames would be specified : on script, in one line as multiple parameters (eg. rename lst, file1.ext, file2.ext, file3.ext, etc) and with GUI through a text box "à la" LM Editor Mode ; and I'm sure you're still meditating on this one, but I feel that all options that affect the List and its behavior should be updated by a script, as I said before it should only last during the script execution and previous values of updated settings would be restored once done, because otherwise many scripts simply cannot be done, either because you don't use the options that the script requires, or it would be too unsafe as the end result could be uncertain...

For the record, I think those are the options that matters - everyone feel free to correct me/add those I may have missed:
- View|List Style|Multiple Select
- Show floppy drives
- Show hidden drives
- Show hidden files and folders
- Show system files and folders
- Show My Network Places
- Show folders in list
- Sort folders apart
- Keep folders on top
- Natural numeric sort order (XP/Vista)
- Show folder sizes in file list
- Resort list immediately after rename
- Auto-refresh on file system changes


I left out sort order & VF as those can be changed already (using sortby & goto)
Proud XYplorer Fanatic

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

Post by admin »

jacky wrote:For the record, I think those are the options that matters - everyone feel free to correct me/add those I may have missed:
- View|List Style|Multiple Select
- Show floppy drives
- Show hidden drives
- Show hidden files and folders
- Show system files and folders
- Show My Network Places
- Show folders in list
- Sort folders apart
- Keep folders on top
- Natural numeric sort order (XP/Vista)
- Show folder sizes in file list
- Resort list immediately after rename
- Auto-refresh on file system changes
Thanks for collecting them! I'm still thinking about the best ways to handle this.

But I'm not thinking too hard because here in Cologne we have Carneval and that's about 1 week where cerebral activity is reduced to survival functions. If you have seen the soccer craze in Germany 2006 and multiply it by 10, you get a rough idea of the scene here right now. If I'd send you a photo of myself in my current dress and makeup you'd never touch XY ever again... :mrgreen: :wink:

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Post by j_c_hallgren »

admin wrote:If I'd send you a photo of myself in my current dress and makeup you'd never touch XY ever again... :mrgreen: :wink:
So...you're wearing a dress and makeup now? :shock: :o
Does that also imply a wig, bra and high heels for the full cross-dressing effect? :roll:
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

Post Reply