OS Execute from within 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
Lukas
Posts: 1336
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

OS Execute from within tool

Post by Lukas »

I want to execute a python file from within Moho, as a tool.
I don't have much experience with lua, but I found the os.execute() command.
I don't seem to get it working from within Anime Studio Pro, but if I run the python file from the terminal, it works just fine.
Are there any steps I need to take account when I want to execute an python script from within Anime?
User avatar
synthsin75
Posts: 10270
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: OS Execute from within tool

Post by synthsin75 »

See this script for an example: http://lostmarble.com/forum/viewtopic.php?t=12483

If the python file is not an executable, I think you'll need to pass that file as an argument to the executable to handle it.
User avatar
Lukas
Posts: 1336
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: OS Execute from within tool

Post by Lukas »

Thanks, I'll check it out.
User avatar
Lukas
Posts: 1336
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: OS Execute from within tool

Post by Lukas »

Again, thanks for the reply.
Eventually it had nothing to do with the os.execute command.
I used debug.getinfo(1).short_src to get the path of the folder in which te lua script is located.
But because the path was longer than 60 characters, the path was abbreviated.
Now I use debug.getinfo(1).source and the problem has been solved,....for now
Post Reply