"save" directory or file ?
Posted: 03 Jul 2014 13:23
I've never done anything with XYplorer's built-in scripting language.
So maybe someone could help me automate this:
Operate on the selection in the list pane. If the name ends in "-SAVE" then copy it to the un-saved name. For example, "foo-SAVE" will be copied to "foo", so now I have "foo" and "foo-SAVE" with identical contents. foo is a directory in my case now, but it would be great if it worked for files and directories equally well.
If the name does not end in "-SAVE", then rename it so that it does. "foo" becomes "foo-SAVE".
It should work with multiple selections. E.g. I ctrl-click two directories in the list pane.
Also, given such a script, what's the easiest way to invoke it? I'm not committed to that naming convention--that's just what I'm using at the moment. So if it were "foo.SAVE" instead, a file-extension association with *.SAVE could do the restore operation. But it would need to use a different method to SAVE it, and that might be confusing. Just thinking...
So maybe someone could help me automate this:
Operate on the selection in the list pane. If the name ends in "-SAVE" then copy it to the un-saved name. For example, "foo-SAVE" will be copied to "foo", so now I have "foo" and "foo-SAVE" with identical contents. foo is a directory in my case now, but it would be great if it worked for files and directories equally well.
If the name does not end in "-SAVE", then rename it so that it does. "foo" becomes "foo-SAVE".
It should work with multiple selections. E.g. I ctrl-click two directories in the list pane.
Also, given such a script, what's the easiest way to invoke it? I'm not committed to that naming convention--that's just what I'm using at the moment. So if it were "foo.SAVE" instead, a file-extension association with *.SAVE could do the restore operation. But it would need to use a different method to SAVE it, and that might be confusing. Just thinking...