I have 2 "standard" forms in which I need to save emails in my filesystem. Which one is to be used depends on the existing layout of the directory I'm dropping into.
At the moment, I manually go to Configuration/Templates/Dropped Messages and make the change, but it would be nice to be able to automate this (not least because it saves me having to remember the 2 format strings!) Ideally, I'd like to be able to create a toolbar button which would toggle the setting (and for bonus points, the icon would change to show the current setting) but I don't think that's possible - I certainly haven't seen anything in the toolbar customisation dialogs for this. But even just being able to set up a script/user command would be good (I could assign a hot key to toggle the settings).
The setting and settingp commands don't let me set the specific command I want. I suppose I could write something to edit xyplorer.ini manually, but that seems ugly and error-prone, so I'd rather not do that if there's a better way.
Has anyone got any suggestions of how I might do this?
Thanks,
Paul
Temporarily changing configuration
-
admin
- Site Admin
- Posts: 64883
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Temporarily changing configuration
Currently not possible indeed.
But once more, a user is asking to change a certain setting onthefly/programmatically. For some settings this is easy to do, for others not. This one (dropped messages format) is an easy one.
Let's collect some more demands for such settings (typically buried somewhere in the Configuration dialog) for which it would be useful to have a quick/scriptable way to change them. Then I'll see if/how I can implement that.
But once more, a user is asking to change a certain setting onthefly/programmatically. For some settings this is easy to do, for others not. This one (dropped messages format) is an easy one.
Let's collect some more demands for such settings (typically buried somewhere in the Configuration dialog) for which it would be useful to have a quick/scriptable way to change them. Then I'll see if/how I can implement that.
FAQ | XY News RSS | XY X
Re: Temporarily changing configuration
Thanks. In the meantime, given that I can write an external program to toggle the setting fairly robustly, am I OK to change xyplorer.ini from an external program? In other words, will XYplorer pick up any changes that I make, or do I need to "notify" the program somehow that the ini file has changed?
If not, I'll stick with the manual approach for now.
Paul
If not, I'll stick with the manual approach for now.
Paul
Re: Temporarily changing configuration
The ini is read at startup only, therefore in order to make your "toggle" stick, you have to exit XY, without saving your settings - otherwise this would overwrite the changes you made by an external process again, and then restart XY with the changed ini.
I'm pretty sure this could easier be done with a script, but I'm definitely not one of the cracks re scripting, let's see, if one of the XYSC's (XY Scripting Cracks) comes up with an easy solution for this...
Something along the line of:
1. Save current settings to ini (so you don't loose your other changes)
2. Toggle the needed settings in the ini between the two different states
3. Restart XY without saving
Et voilà
I'm pretty sure this could easier be done with a script, but I'm definitely not one of the cracks re scripting, let's see, if one of the XYSC's (XY Scripting Cracks) comes up with an easy solution for this...
Something along the line of:
1. Save current settings to ini (so you don't loose your other changes)
2. Toggle the needed settings in the ini between the two different states
3. Restart XY without saving
Et voilà
Ralph 
(OS: W11 24H2 Home x64 - XY: Current x32 beta - Office 2024 32-bit - Display: 1920x1080 @ 125%)
(OS: W11 24H2 Home x64 - XY: Current x32 beta - Office 2024 32-bit - Display: 1920x1080 @ 125%)
Re: Temporarily changing configuration
Have you considered using the template to give the file as much data as possible and then using separate move or rename commands (as UDC or scripts) to format it as you desire?
Re: Temporarily changing configuration
No, I hadn't thought of that. Thanks, it's not a bad option.TheQwerty wrote:Have you considered using the template to give the file as much data as possible and then using separate move or rename commands (as UDC or scripts) to format it as you desire?
Specifically, if I define a UDC to run the script
Code: Select all
rename b,"<datem yyyy-mm-dd hh-nn-ss> *"Yes, that looks like a perfectly reasonable approach. Thanks.
Paul.
Re: Temporarily changing configuration
Grrr. It looks like this doesn't work as I want. A batch rename UDC (category Rename) renames each file based on its own modification date, but a script seems to pick the date from the first selected file, rather than on a file-by-file basis. This seems like a bug - or do I need to somehow escape the <datem...> construct so it isn't expanded too early?pmoore wrote:Specifically, if I define a UDC to run the scriptand assign it to a key, I can just hit that key after the drop - the dropped files are still selected and the job's done. Ideally, I'd add a step to strip off any -01 -02 etc suffixes which may have been added because the message subject isn't unique, but that's details...Code: Select all
rename b,"<datem yyyy-mm-dd hh-nn-ss> *"
Yes, that looks like a perfectly reasonable approach. Thanks.
As an example to try - select 2 files with different modification dates. Then type the following in the address bar:
Code: Select all
::rename b,"<datem yyyy-mm-dd hh-nn-ss> *"Paul.
Re: Temporarily changing configuration
I would say it's intended, as those variables are supposed to be parsed by the batch rename process and not the script itself to work as you expect, but the use of double quotes makes the string be processed before hand. Of course, there's an easy way around it : use single-quotes!pmoore wrote:Grrr. It looks like this doesn't work as I want. A batch rename UDC (category Rename) renames each file based on its own modification date, but a script seems to pick the date from the first selected file, rather than on a file-by-file basis. This seems like a bug - or do I need to somehow escape the <datem...> construct so it isn't expanded too early?
Code: Select all
::rename b,'<datem yyyy-mm-dd hh-nn-ss> *'Proud XYplorer Fanatic
Re: Temporarily changing configuration
Ah, thanks! That's what I was getting at when I said "escaping" - I'm new to XYplorer scripting, so I didn't know the syntax and terminology. (It's a pity everything implements its own scripting language - far too much for my ageing brain to rememberjacky wrote:Of course, there's an easy way around it : use single-quotes!
Paul.
XYplorer Beta Club