Hello all, I'm trying to use a matlab function to get an XYZ file and I'd like to call this function from a celx script. I've read lots of topics related with this issue, but I haven't got any answer to my question. So, if anybody can tell me any information about that, i'll be very grateful.
Sorry for my English.
Thank you all.
Is there any way to call an exe file from a celx script??
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
Re: Is there any way to call an exe file from a celx script?
MARKS,
You can use os.execute(filename) to run any filename from a celx script.
However, since this requires access to the Lua os library, you must first set ScriptSystemAccessPolicy to "allow" in celestia.cfg, and add the following lines at the beginning of your celx script:
Then, if your .exe file is placed in a subfolder of the "Program Files" folder, I'd suggest to use a short batch file, such as:
Just replace XYZFolder and XYZ.exe with the names corresponding to your XYZ program.
You can save this batch file as "runXYZ.bat" in your celestia base folder.
Then, you'll be able to launch your XYZ program from your celx script using:
You can use os.execute(filename) to run any filename from a celx script.
However, since this requires access to the Lua os library, you must first set ScriptSystemAccessPolicy to "allow" in celestia.cfg, and add the following lines at the beginning of your celx script:
Code: Select all
celestia:requestsystemaccess()
wait(0)
Then, if your .exe file is placed in a subfolder of the "Program Files" folder, I'd suggest to use a short batch file, such as:
Code: Select all
cd %ProgramFiles%\XYZFolder
XYZ.exe
You can save this batch file as "runXYZ.bat" in your celestia base folder.
Then, you'll be able to launch your XYZ program from your celx script using:
Code: Select all
os.execute("runXYZ")
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
-
- Developer
- Posts: 1356
- Joined: 07.01.2005
- With us: 19 years 10 months
- Location: Nancy, France
MARKS wrote:Thank you Vincent for your answer, it works perfectly.
You're welcome Marks.
@+
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3
Vincent
Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3