Page 1 of 1

Script control tool.

Posted: Fri Apr 23, 2021 4:13 pm
by dueyftw
I have an idea that someone could make a tool that would control all the extra tools that is added to Moho.

From:
https://forums.cockos.com/showthread.php?t=231020
------------------------------------------------------------------
One of the cool things I love about hacking stuff is: You have a totally ridiculous idea and...you try it out anyway.

So yesterday, I had such a ridiculous idea. "If zip-archives add the path of a file into their filename...what if the operating system does as well?
And what happens, if I use that assuption with os.rename?"

So that's what I did and I discovered, that you can not only rename files with

os.rename("oldfilename.txt", "newfilename.txt")

you can also move files with it, by replacing the old path with the new one:

os.rename("c:\\oldfilename.txt" "c:\\temp\\oldfilename.txt")

and the great thing about it, you can do this also for directories.

So if you need a way of moving a file, without having to copy it first and manually delete the old one: use os.rename.


Another thing: You can NOT overwrite already existing files/directories, so check, if os.rename returns false!

Works on Mac and Windows, haven't checked Linux yet.
-------------------------------------------------------------------

So what would happen if one were to have the custom content folder at c:\
and have a disable folder in tool? Where the a tool would open both tool and disable folders and allow one to move tools from one folder to the other?

Also there would be a white board of tools that don't move in the tool itself.

You would have to close Moho and restart, but all the tools you need would be there.

https://www.dropbox.com/s/okgnrnmpeb1r8 ... l.png?dl=0

Dale

Re: Script control tool.

Posted: Mon Nov 22, 2021 11:50 am
by Daxel
Interesting.
dueyftw wrote: Fri Apr 23, 2021 4:13 pm You would have to close Moho and restart, but all the tools you need would be there.
I think I've seen a script that updates the scripts without having to restart Moho.

Re: Script control tool.

Posted: Mon Nov 22, 2021 12:28 pm
by hayasidist
Daxel wrote: Mon Nov 22, 2021 11:50 am I think I've seen a script that updates the scripts without having to restart Moho.
I do have one in development - but at present it's not available outside the beta community .. just as a tempter: it will allow you to disable / enable any or all scripts either one by one or "all custom" without having to shift files around / restart moho ...

Re: Script control tool.

Posted: Mon Nov 22, 2021 11:57 pm
by Daxel
hayasidist wrote: Mon Nov 22, 2021 12:28 pm
just as a tempter: it will allow you to disable / enable any or all scripts either one by one or "all custom" without having to shift files around / restart moho ...
I'm definitely tempted!