Page 1 of 1

Filename of currently open .moho file?

Posted: Tue Jul 05, 2005 8:04 am
by myles
Is the current .moho filename available to a Lua script anywhere ?

I've been looking through the scripting documentation, but I can't see it. That could mean it's not available, or I'm just not looking hard enough.

Regards, Myles.

Posted: Tue Jul 05, 2005 8:30 am
by 7feet
As far as I know, that's not the case. Although I will throw that in there as a Big Fat Feature Request. There are a number of little scripting bit's that would be made a lot easier if I could grab the path of the current .moho file.

Posted: Tue Jul 12, 2005 1:36 am
by myles
If (that should probably be when) Lost Marble reads this, I'd also like to add my vote for this (the full filename path returned to a Lua script, and perhaps nil or an empty string if unsaved) as a feature request, please.

I was looking at it as a simple way to call a revision control system (via the command line) for keeping multiple revisions of a .moho file, but it would also probably make it possible to set up a copy and rename (adding an incrementing number, perhaps) script for a cross-platform equivalent.

Regards, Myles.

Posted: Fri Jul 15, 2005 4:59 pm
by Lost Marble
I think this came up recently somewhere else too - I'll see that it gets in the next update.

Posted: Sun Nov 12, 2006 6:48 pm
by tinytoad
Has anybody else found a way of getting the filename? I can't seem to figure out if it was added in a later release...

Posted: Sun Nov 12, 2006 10:40 pm
by myles
Yes, it was added in release 5.3.

string MohoDoc::Path()

Regards, Myles.

Posted: Mon Nov 13, 2006 1:51 am
by 7feet
Geez, I totally missed that that was put in! I was still wishing for it. My life just got a lot easier... Thanks for pointing that out, Myles.

Posted: Mon Nov 13, 2006 11:06 am
by rylleman
Thank you.
I think I've asked this question before but never got any answer,
Are there any other way than by the somewhat inadequate scripting guide to find out what lua commands and strings that are available to Moho?

Posted: Mon Nov 13, 2006 10:54 pm
by myles
rylleman wrote:Are there any other way than by the somewhat inadequate scripting guide to find out what lua commands and strings that are available to Moho?
There's the API script by Lost Marble, and my modified version (I just tested it and it still works with Anime Studio Pro).

Regards, Myles.

Posted: Mon Nov 13, 2006 11:58 pm
by rylleman
myles wrote:There's the API script by Lost Marble, and my modified version
Thank's, your mod was great with the html-output!
(I tried LMs APIscript before but the lua-console got me very annoyed so I quickly forgot about that...)
Do I dare ask you to do the same mod. to the print globals script?
The list gets to long to display in the lua-consol so the first part isn't displayed (I guess that's one of the reasons you did your API-mod?).

-david

Posted: Tue Nov 14, 2006 2:30 am
by myles
Hi David,

there's a couple of commented ( beginning with --) lines in the API script that produce an in-depth global variables list in the API output file - just take off the double dashes (oh, and maybe move the 2 lines above the HTML closing tags line above it). Because my version drills down into tables, there is a lot of overlap with the API values which also show up in the global variable tables.

Here's a global variables version that just does the global variables without drilling down into tables.

Regards, Myles.

Posted: Tue Nov 14, 2006 9:49 am
by rylleman
Thank you, much appriciated!