Script control tool.

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
dueyftw
Posts: 2174
Joined: Thu Sep 14, 2006 10:32 am
Location: kingston NY
Contact:

Script control tool.

Post 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
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: Script control tool.

Post 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.
User avatar
hayasidist
Posts: 3526
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Script control tool.

Post 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 ...
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: Script control tool.

Post 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!
Post Reply