Filename of currently open .moho file?

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, 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 » Tue Jul 05, 2005 8:04 am

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 » Tue Jul 05, 2005 8:30 am

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 » Tue Jul 12, 2005 1:36 am

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: 2193
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble » Fri Jul 15, 2005 4:59 pm

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 » Sun Nov 12, 2006 6:48 pm

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 » Sun Nov 12, 2006 10:40 pm

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 » Mon Nov 13, 2006 1:51 am

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 » Mon Nov 13, 2006 11:06 am

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 » Mon Nov 13, 2006 10:54 pm

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 » Mon Nov 13, 2006 11:58 pm

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 » Tue Nov 14, 2006 2:30 am

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 » Tue Nov 14, 2006 9:49 am

Thank you, much appriciated!
Post Reply