This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
LeDark Lua's profile picture

run edit?!?

Started by LeDark Lua, 28 June 2015 - 06:18 PM
LeDark Lua #1
Posted 28 June 2015 - 08:18 PM
I wan't to make a program where you press on an object it runs "edit"
Like so:
edit myAwesomeFile
But I get errors….
HPWebcamAble #2
Posted 28 June 2015 - 08:19 PM
Can you post the code you have so far, and the error you get?
LeDark Lua #3
Posted 28 June 2015 - 08:21 PM
engines code:
local newShell=multishell.launch({file=PrName.."/main";}, "edit.GML")
files code:
shell.run("edit "..file)

Thanks for the fast reply :)/>

EDIT: Oh I forgot to add "edit" my bad :/
Edited on 28 June 2015 - 06:27 PM
LeDark Lua #4
Posted 28 June 2015 - 08:32 PM
Ahh i figure it out:
local newShell=multishell.launch({debug=true;_wiObjID=instance.getID();}, "/rom/programs/shell", "edit", PrName.."/main")
MKlegoman357 #5
Posted 28 June 2015 - 08:57 PM
Your solution currently runs another shell on top of the currently running one. The problem here was that when launching programs with multishell.launch or os.run you have to pass the shell and multishell APIs to the program yourself:


multishell.launch( { shell = shell, multishell = multishell }, "edit file.txt" )