OnEvent Scripting, elegant idea! OnSelectFile, OnStartUp, OnExit, OnDblClickEmpty, etc. ... Yes, it should happen. But it needs an interface to define/associate the scripts; and also probably a separate storage file, because it does not fit into udc.dat or any of the other *.dat. Well, there might be a way to fit it into the UDC interface... anyway it's not for now. But later, yes...jacky wrote:So here's is a thought I had early on, but that seemed odd at the time : how about using a script there ?? ...
Date info in status bar
-
admin
- Site Admin
- Posts: 66075
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
FAQ | XY News RSS | XY X
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
- an interface : yes, but the question would be, do we want a dedicated interface for this ? Because for "new" events it might make sense, but for others it might be better to stay as-is. I mean there's already an action for dbl-click on Tab, maybe just an extra item that would reveal a textbox where the user can specify the script name (, script label) to run would work.admin wrote:OnEvent Scripting, elegant idea! OnSelectFile, OnStartUp, OnExit, OnDblClickEmpty, etc. ... Yes, it should happen. But it needs an interface to define/associate the scripts; and also probably a separate storage file, because it does not fit into udc.dat or any of the other *.dat. Well, there might be a way to fit it into the UDC interface... anyway it's not for now. But later, yes...jacky wrote:So here's is a thought I had early on, but that seemed odd at the time : how about using a script there ?? ...
Then, the same thing could be added on Startup & Exit for those events, etc
- a storage file : well, seems to me it could fit inside the INI, no?
BTW slightly off topic, but with the new syntax for getkey/setkey one might need a delkey or something, to do some cleaning from time to time ?
Proud XYplorer Fanatic
-
admin
- Site Admin
- Posts: 66075
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
fit inside the INI: yes, within limits (line feeds must be handled somehow and there's a maximum size for values in an INI).jacky wrote:- an interface : yes, but the question would be, do we want a dedicated interface for this ? Because for "new" events it might make sense, but for others it might be better to stay as-is. I mean there's already an action for dbl-click on Tab, maybe just an extra item that would reveal a textbox where the user can specify the script name (, script label) to run would work.admin wrote:OnEvent Scripting, elegant idea! OnSelectFile, OnStartUp, OnExit, OnDblClickEmpty, etc. ... Yes, it should happen. But it needs an interface to define/associate the scripts; and also probably a separate storage file, because it does not fit into udc.dat or any of the other *.dat. Well, there might be a way to fit it into the UDC interface... anyway it's not for now. But later, yes...jacky wrote:So here's is a thought I had early on, but that seemed odd at the time : how about using a script there ?? ...
Then, the same thing could be added on Startup & Exit for those events, etc
- a storage file : well, seems to me it could fit inside the INI, no?
BTW slightly off topic, but with the new syntax for getkey/setkey one might need a delkey or something, to do some cleaning from time to time ?
delkey: delsection, enumsections, enumkeys... there's always room for expansion...
FAQ | XY News RSS | XY X
-
PeterH
- Posts: 2826
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Maybe a split between definition and script? In a section of the INI define actions and associated scriptnames:admin wrote:fit inside the INI: yes, within limits (line feeds must be handled somehow and there's a maximum size for values in an INI).
OnSelectFile scriptname
OnAbc... scriptname...
On...
and the scripts are in the normal script-directory (or fully qualified)?
Sounds pretty good! But to be really useful enum... need next scripting-level?admin wrote:delkey: delsection, enumsections, enumkeys... there's always room for expansion...
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
And how about if it were handled similar to Config for Startup Path or Thumbnail Cache? You have the various events listed and then user defines what script name, if any, to execute -or- maybe just a one-line set of commands in-line there? And this would then be stored in INI.PeterH wrote:Maybe a split between definition and script? In a section of the INI define actions and associated scriptnames:admin wrote:fit inside the INI: yes, within limits
OnSelectFile scriptname
OnAbc... scriptname...
On...
and the scripts are in the normal script-directory (or fully qualified)?
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.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
Oh right, you had actual script in mind! I have to admit, I only had in mind the need for the name of the script file to load, and maybe the script label to execute, like the "Load Script File" UDC for example, not the "Run Script" one.admin wrote:fit inside the INI: yes, within limits (line feeds must be handled somehow and there's a maximum size for values in an INI).
If we're going actual embedded scripts, then yeah an events.dat or something might be needed, yes.
Well, of course the full package is always around the corner, yes, it's just that when using this for something else than XY settings, right row if we want to set/remember tmp values or something, once done we can only "empty" them, meaning leave a "Keyname=" line in the INI file, but we have no way to actually remove it, that's all.admin wrote:delkey: delsection, enumsections, enumkeys... there's always room for expansion...
Seems to be it could be useful, without diving into enumkeys & co which would probably not really work until Scripting 2.0 anyways...
Proud XYplorer Fanatic
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
And when it comes to deleting keys from INI, I'm wondering if there is some mechanism to prevent us from clobbering required XY keys? So are any user defined keys kept in a "user/private" key section or similar?
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.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
hmm.. you mean user adding keys/sections inside XY's config INI file ?? Cause if so, and I haven't actually checked that one yet, but I don't thin one should do that, because I'm thinking XY wouldn't keep them, as its writing (saving settings) procedure probably doesn't involve reading the actual content of the INI, but only writing down the current (=from memory) values.j_c_hallgren wrote:And when it comes to deleting keys from INI, I'm wondering if there is some mechanism to prevent us from clobbering required XY keys? So are any user defined keys kept in a "user/private" key section or similar?
I might be completely wrong on that one, but I'm thinking saving "new" sections/keys inside an XY INI file will see all of those things gone the next time XY saves its settings.
I was myself only talking about other INI files, in the present case completely new INI files created and used only by & for a given script.
Proud XYplorer Fanatic
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
jacky, you're much closer to this than I'll likely be, but just wanted to bring up that aspect (deleting and/or user keys) for thought/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.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
Muroph
- Posts: 561
- Joined: 21 Aug 2007 16:13
I like the 'delkey' and 'delsection' idea, but some protection like this is really important.j_c_hallgren wrote:And when it comes to deleting keys from INI, I'm wondering if there is some mechanism to prevent us from clobbering required XY keys?
Imagine if for some reason (like a bad script) you deleted a whole section of your config ini and xy crashed after that.
That section would be lost.
It's true. I've seen it happen.jacky wrote: I might be completely wrong on that one, but I'm thinking saving "new" sections/keys inside an XY INI file will see all of those things gone the next time XY saves its settings.
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
With all this Getkey/Setkey custom INI file talk I think we really need a new variable <scriptPath> which if called from a script file would contain the path to that file, otherwise it would be blank.
This way we could use custom INI files that stay with the scripts that use them.
Perhaps there should be a "security" setting/level associated with certain commands, so that a new user could have it set high and XY would prompt before running a script with certain commands (SetKey followed by Save Settings, Deletes, etc.)?
That would allow the users who aren't very confident with scripting to run something written by someone else without having to be terrified of it destroying things. Plus it might protect the careless and fancy free script writers among us from being reminded that Undo is still on the road map.
Or perhaps Step Through Script is comforting enough?
This way we could use custom INI files that stay with the scripts that use them.
Perhaps there should be a "security" setting/level associated with certain commands, so that a new user could have it set high and XY would prompt before running a script with certain commands (SetKey followed by Save Settings, Deletes, etc.)?
That would allow the users who aren't very confident with scripting to run something written by someone else without having to be terrified of it destroying things. Plus it might protect the careless and fancy free script writers among us from being reminded that Undo is still on the road map.
Or perhaps Step Through Script is comforting enough?
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
Well, I guess such a <scriptpath> variable could be something, since script files can be executed from about anywhere, indeed. But as far as XY goes, and it is a portable app, one might also assume that all scripts should be located ideally under <xydata>\ScriptsTheQwerty wrote:With all this Getkey/Setkey custom INI file talk I think we really need a new variable <scriptPath> which if called from a script file would contain the path to that file, otherwise it would be blank.
This way we could use custom INI files that stay with the scripts that use them.
If that's the case, simply stating "filename.ini" will put the file in <xypath> I think, "Scripts\filename.ini" would put it with scripts (if <xydata> and <xypath> are the same), and of course you could use "<xydata>\filename.ini"
Of course, if you intend to use a script located somewhere outside of XY's paths, and want to have its "settings" (to the script) saved in that same place, a <scriptpath> might be required -- but that wouldn't be some standard behavior I'd say. I mean, I feel that for "standard" script use, using a simple filename (or prefixing it with <xydata>) should be enough, no?
I'd say it is, because otherwise Don would have to go through each of the XY's command (including the whole list on CKS) to assign such a "security level", because there's some dangerous command there (eg. some delete operations, etc), then moveto could be seen as a potential risk as well, all the open(with) too, settingp, etcTheQwerty wrote:Or perhaps Step Through Script is comforting enough?
I think the stepping mode is enough to allow one to keep an eye on what's going on.
Proud XYplorer Fanatic
-
admin
- Site Admin
- Posts: 66075
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
I'd say so too. You can already disable "Quick scripting", and I might add another option to disable any form of scripting. I'm also thinking about publishing a "Home Version" (as opposed to "Professional") of XY which will have no scripting at all.jacky wrote:Well, I guess such a <scriptpath> variable could be something, since script files can be executed from about anywhere, indeed. But as far as XY goes, and it is a portable app, one might also assume that all scripts should be located ideally under <xydata>\ScriptsTheQwerty wrote:With all this Getkey/Setkey custom INI file talk I think we really need a new variable <scriptPath> which if called from a script file would contain the path to that file, otherwise it would be blank.
This way we could use custom INI files that stay with the scripts that use them.
If that's the case, simply stating "filename.ini" will put the file in <xypath> I think, "Scripts\filename.ini" would put it with scripts (if <xydata> and <xypath> are the same), and of course you could use "<xydata>\filename.ini"
Of course, if you intend to use a script located somewhere outside of XY's paths, and want to have its "settings" (to the script) saved in that same place, a <scriptpath> might be required -- but that wouldn't be some standard behavior I'd say. I mean, I feel that for "standard" script use, using a simple filename (or prefixing it with <xydata>) should be enough, no?
I'd say it is, because otherwise Don would have to go through each of the XY's command (including the whole list on CKS) to assign such a "security level", because there's some dangerous command there (eg. some delete operations, etc), then moveto could be seen as a potential risk as well, all the open(with) too, settingp, etcTheQwerty wrote:Or perhaps Step Through Script is comforting enough?
I think the stepping mode is enough to allow one to keep an eye on what's going on.
FAQ | XY News RSS | XY X
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Or maybe a "Basic" vs "Premium"? Since a business user may wish to have limited vers for some employees and having that as "Home Vers" sounds odd...admin wrote: I'm also thinking about publishing a "Home Version" (as opposed to "Professional") of XY which will have no scripting at all.
I'd thus also suggest a price differential where user could upgrade to higher vers for that diff (plus a small add-on to encourage combined purchase plus offset any cost to do so)...but I presume you'd already planned that?
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.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
I'd say keeping a custom settings file with the script that uses it is very likely to be "standard" script use, whatever that is.jacky wrote:Well, I guess such a <scriptpath> variable could be something, since script files can be executed from about anywhere, indeed. But as far as XY goes, and it is a portable app, one might also assume that all scripts should be located ideally under <xydata>\Scripts
If that's the case, simply stating "filename.ini" will put the file in <xypath> I think, "Scripts\filename.ini" would put it with scripts (if <xydata> and <xypath> are the same), and of course you could use "<xydata>\filename.ini"
Of course, if you intend to use a script located somewhere outside of XY's paths, and want to have its "settings" (to the script) saved in that same place, a <scriptpath> might be required -- but that wouldn't be some standard behavior I'd say. I mean, I feel that for "standard" script use, using a simple filename (or prefixing it with <xydata>) should be enough, no?
You are free to assume all you want, but if I've learned anything in my time as a programmer it's to never assume anything. A certain saying comes to mind...
XYplorer Beta Club