Jump to content




run edit?!?


  • You cannot reply to this topic
4 replies to this topic

#1 LeDark Lua

  • Members
  • 369 posts
  • LocationLeLua

Posted 28 June 2015 - 07: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....

#2 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 28 June 2015 - 07:19 PM

Can you post the code you have so far, and the error you get?

#3 LeDark Lua

  • Members
  • 369 posts
  • LocationLeLua

Posted 28 June 2015 - 07: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 by LeDark Lua, 28 June 2015 - 07:27 PM.


#4 LeDark Lua

  • Members
  • 369 posts
  • LocationLeLua

Posted 28 June 2015 - 07:32 PM

Ahh i figure it out:
local newShell=multishell.launch({debug=true;_wiObjID=instance.getID();}, "/rom/programs/shell", "edit", PrName.."/main")


#5 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 28 June 2015 - 07: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" )






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users