https://sites.google.com/site/synthsin/ ... ects=0&d=1
This menu script will extract the current Moho file and beautify its formatting to make it easier to read. It will prompt you to save any changes to the file and where to save/what to name the beautified file.
This includes a python script, which requires you to have python installed on your computer.
It has been tested with Python 2.7, which you can find here: https://www.python.org/download/releases/2.7/
*NEW* Beautify Moho file
Moderators: Víctor Paredes, Belgarath, slowtiger
- synthsin75
- Posts: 9972
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
*NEW* Beautify Moho file
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: *NEW* Beautify Moho file
Thanks, Wes! Will check it out soon!
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2020 Edtion
- hayasidist
- Posts: 3522
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: *NEW* Beautify Moho file
This was not working at all for me. Win 10 / 1803. Other than the prints I've enabled, there were no error messages - it runs but does not produce a .mohoproj
I have the .lua where it should be - and it shows up in the dropdown and seems to work - e.g. it correctly goes through the save / beautify as last saved loop
I enabled a couple of the print lines in the .lua
print (path) correctly identifies the destination .mohoproj
print (message.."python "..util.." extract -b "..file.." "..path) produces what would be expected from the code
the .py is in the script resources directory
I have installed and can invoke python - I can type (e.g.) help / modules and I do get the list of available modules.
====
A bit of detective work and …
replacing python with (in my case) C:\Python27\python.exe works.
The actual code change I made was os.execute("C:\\Python27\\python.exe "..util.." extract -b "..file.." "..path)
I have the .lua where it should be - and it shows up in the dropdown and seems to work - e.g. it correctly goes through the save / beautify as last saved loop
I enabled a couple of the print lines in the .lua
print (path) correctly identifies the destination .mohoproj
print (message.."python "..util.." extract -b "..file.." "..path) produces what would be expected from the code
the .py is in the script resources directory
I have installed and can invoke python - I can type (e.g.) help / modules and I do get the list of available modules.
====
A bit of detective work and …
replacing python with (in my case) C:\Python27\python.exe works.
The actual code change I made was os.execute("C:\\Python27\\python.exe "..util.." extract -b "..file.." "..path)
- synthsin75
- Posts: 9972
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Beautify Moho file
Huh, I don't remember if the Python installer I used added python to the system path (environment variable) or I did that manually.
You can run this to see if Python is on your system path:
print(os.getenv("PATH"))
If it isn't, I'll see about asking the user to find Python.exe if it's not found on the PATH...when I get the time.
You can run this to see if Python is on your system path:
print(os.getenv("PATH"))
If it isn't, I'll see about asking the user to find Python.exe if it's not found on the PATH...when I get the time.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- synthsin75
- Posts: 9972
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Beautify Moho file
I've updated this (same link) to ask the user to find python.exe if it's not on the system PATH. If anyone uses this on Mac, it will probably need further updates, but it should be solid on Windows.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- hayasidist
- Posts: 3522
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: *NEW* Beautify Moho file
thanks Wes. thinking back about when I installed python, there may well have been something about putting the executable somewhere else or even about path - but I just used the default options in the python installer.
Re: *NEW* Beautify Moho file
On Python 2.7 (for Windows) adding the executable to the path was an option, but it was one of those old icons-in-a-tree-structure with a drop-down and "will be installed on local hard drive", and not the default.
In Python 3.x it's a more obvious checkbox, but unlike the rest of the Python install it requires admin approval (a little security speedbump which helps prevent random software adding a folder to the path with, for example, an alternative cmd.exe, notepad.exe, etc).
In Python 3.x it's a more obvious checkbox, but unlike the rest of the Python install it requires admin approval (a little security speedbump which helps prevent random software adding a folder to the path with, for example, an alternative cmd.exe, notepad.exe, etc).
- synthsin75
- Posts: 9972
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: *NEW* Beautify Moho file
Thanks for double checking, obtusity.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/