Filename of currently open .moho file?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
myles
Posts: 821
Joined: Sat Aug 21, 2004 3:32 am
Location: Australia, Victoria, Morwell
Contact:

Filename of currently open .moho file?

Post 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.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post 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.
myles
Posts: 821
Joined: Sat Aug 21, 2004 3:32 am
Location: Australia, Victoria, Morwell
Contact:

Post 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.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

I think this came up recently somewhere else too - I'll see that it gets in the next update.
tinytoad
Posts: 2
Joined: Thu Mar 10, 2005 11:16 pm

Post 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...
myles
Posts: 821
Joined: Sat Aug 21, 2004 3:32 am
Location: Australia, Victoria, Morwell
Contact:

Post by myles »

Yes, it was added in release 5.3.

string MohoDoc::Path()

Regards, Myles.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post 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.
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post 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?
myles
Posts: 821
Joined: Sat Aug 21, 2004 3:32 am
Location: Australia, Victoria, Morwell
Contact:

Post 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.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post 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
myles
Posts: 821
Joined: Sat Aug 21, 2004 3:32 am
Location: Australia, Victoria, Morwell
Contact:

Post 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.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

Thank you, much appriciated!
Post Reply