Hi guys, I'm new here and I just need a consol app, can anyone help please?
Announcement
Collapse
No announcement yet.
Command line (CMD)
Collapse
X
-
Hi and welcome to the forum
Please find attached zip with console,commandline & luacom plugs
I don't have an example at the moment but if U search forums you might find a couple
Cheers
Actions.zip
-
👍 1
-
-
Originally posted by hamedn53 View Posthi, i searched but found nothing.
I need a project of a cmd_consol in the project, STDOUT. I'm new and I don't know how to do that.
I want cmd logs to show in rich text box..
can you help me?
thank you
So, here's an example demonstrating how to pipe command-line output (ie. StdOut) into a RichText object, using reteset's CommandLine plugin. Colc's already provided a link (thanks, babe!) to this plugin (above), so first download the attached "Actions.zip" file you see up there. Given that you're new, you may be unfamiliar with the use of action plugins, yeah?
So, extract the folder titled, "CommandLine' from the aforementioned zipfile to your AMS Plugins\Actions folder:
Code:ie. C:\Program Files (x86)\AutoPlay Media Studio 8 Personal Edition\Plugins\Actions
Now the example attached for you below, will work.
To use this plugin in future, whenever you start your project, ensure the CommandLine plugin has been 'ticked' in the Action Plugins dialog. Which you'll now see listed under: Project >> Plugins from the main AMS Menu bar:
.................................................. .................................................. .............
If you don't want to use plugins, there is one other way to pipe command-line output (ie. StdOut) into a Lua variable. And that's by referencing the Lua IO library. For example, the function io.popen() executes a command-line program and returns a file handle from which data can be read back into Lua. This is the function's structure:
io.popen (prog [, mode])
And these are the available options for mode:- "r" - The calling process can read the spawned command’s standard output via the returned stream. This is the default.
- "w" - The calling process can write to the spawned command’s standard input via the returned stream.
- "b" - Open in binary mode.
- "t" - Open in text mode.
Personally, I've found this latter method problematic because it's a function that's system dependent and not available on all platforms. It's better suited for use with native Lua under Linux. Reteset's CommandLine plugin however, simplifies things, making the process a lot easier. So my advice would be to stick with that. The trade-off is having an application that's dependent on an external plugin. But the overhead is tiny, so IMO is a non-issue.
-
👍 1
Comment
-
Originally posted by colc View PostHi and welcome to the forum
Please find attached zip with console,commandline & luacom plugs
I don't have an example at the moment but if U search forums you might find a couple
Cheers
[ATTACH]n301867[/ATTACH]after a lot of wasting time! So very thanks to you.
Comment
-
-
Originally posted by BioHazard View Post
Okay, you seem to have double-posted on this topic. So the above reference is from your request made at: https://forums.indigorose.com/forum/...864#post301864
So, here's an example demonstrating how to pipe command-line output (ie. StdOut) into a RichText object, using reteset's CommandLine plugin. Colc's already provided a link (thanks, babe!) to this plugin (above), so first download the attached "Actions.zip" file you see up there. Given that you're new, you may be unfamiliar with the use of action plugins, yeah?
So, extract the folder titled, "CommandLine' from the aforementioned zipfile to your AMS Plugins\Actions folder:
Code:ie. C:\Program Files (x86)\AutoPlay Media Studio 8 Personal Edition\Plugins\Actions
Now the example attached for you below, will work.
To use this plugin in future, whenever you start your project, ensure the CommandLine plugin has been 'ticked' in the Action Plugins dialog. Which you'll now see listed under: Project >> Plugins from the main AMS Menu bar:
.................................................. .................................................. .............
If you don't want to use plugins, there is one other way to pipe command-line output (ie. StdOut) into a Lua variable. And that's by referencing the Lua IO library. For example, the function io.popen() executes a command-line program and returns a file handle from which data can be read back into Lua. This is the function's structure:
io.popen (prog [, mode])
And these are the available options for mode:- "r" - The calling process can read the spawned commands standard output via the returned stream. This is the default.
- "w" - The calling process can write to the spawned commands standard input via the returned stream.
- "b" - Open in binary mode.
- "t" - Open in text mode.
Personally, I've found this latter method problematic because it's a function that's system dependent and not available on all platforms. It's better suited for use with native Lua under Linux. Reteset's CommandLine plugin however, simplifies things, making the process a lot easier. So my advice would be to stick with that. The trade-off is having an application that's dependent on an external plugin. But the overhead is tiny, so IMO is a non-issue.and because of your last attached file, command-line works like a charm very interesting, I appreaciate to you, thanks so much man.
a little changes on the size, looks like awsome!
Comment
-
Originally posted by BioHazard View Post
If you don't want to use plugins, there is one other way to pipe command-line output (ie. StdOut) into a Lua variable. And that's by referencing the Lua IO library. For example, the function io.popen() executes a command-line program and returns a file handle from which data can be read back into Lua. This is the function's structure:
io.popen (prog [, mode])
Personally, I've found this latter method problematic because it's a function that's system dependent and not available on all platforms.
Comment
-
-
I never had much luck with it under WinXP. Spent quite some time looking for a way to pipe Wget output back into AMS some months back. As I recall, what bothered me the most was that there seemed to be no way to suppress that annoying command window with this method. And in the end is what led me back to settling on reteset's plugin instead.
Admittedly, I've never tried since moving my stuff over to Win 7 but am working under the assumption that one is likely to experience the same difficulties. I'd be stoked to see someone demonstrate io.popen() returning command-line output with a suppressed command window. Any ideas, sensei?
Comment
-
-
Originally posted by BioHazard View PostI never had much luck with it under WinXP. Spent quite some time looking for a way to pipe Wget output back into AMS some months back. As I recall, what bothered me the most was that there seemed to be no way to suppress that annoying command window with this method. And in the end is what led me back to settling on reteset's plugin instead.
Admittedly, I've never tried since moving my stuff over to Win 7 but am working under the assumption that one is likely to experience the same difficulties. I'd be stoked to see someone demonstrate io.popen() returning command-line output with a suppressed command window. Any ideas, sensei?
Comment
-
-
you can do this
so easy
create temp file
use os.execute()
redirect your command to the temp file
display the output at any ams object
How ??
ok
make a new project with a button and a listbox
but this code in the button
Code:Temp = os.tmpname () os.execute ("dir c:\ > " .. Temp) for line in io.lines (Temp) do ListBox.AddItem("ListBox1", line, ""); end os.remove (Temp)[B][SIZE=14px][FONT=arial][/FONT][/SIZE][/B]
Comment
-
-
Originally posted by startupthe plugin may use temp files
who knows ?
Reteset quotes, "...i made this plugin to save you from use of text file redirection."
"who knows ?"
- Anyone who bothers to take the time to look first.
Originally posted by startup...is there a code posted here about io.popen() that i can not see ?
so strange
"so strange"
- No, it's really not. Clicking the lua.org link that was provided is about as basic and ordinary as it gets. As is googling, 'lua io.popen'.
...............................................
Originally posted by startupok
here is the io.popen() versionFrom Post-8:
Originally posted by BioHazardWhat bothered me the most was that there seemed to be no way to suppress that annoying command window with this method. And in the end is what led me back to settling on reteset's plugin instead.
I'd be stoked to see someone demonstrate io.popen() returning command-line output with a suppressed command window.From Post-9:
Originally posted by Imagine ProgrammingYes it seems that io.popen in AMS opens up a console window... I wonder why popen does that in AMS.
@startup
Before posting, it'd be really helpful to actually take the time to read the thread properly. So as to adequately comprehend the nuances of the topic. Leaping in like this - with stuff that misses the point (and which is thereby irrelevant) - just sullies the entire thread. (As does your continued proclivity to post in 14px bold type. We're not blind, we're not deaf, and we all know you're here). Sigh.
-
👍 1
Comment
-
-
Originally posted by hamedn53 View PostHi guys, I'm new here and I just need a consol app, can anyone help please?
No more No less
Originally posted by BioHazard View PostWhich parts of the thread in reference to io.popen() failing to suppress the command window, did you not understand?
And sorry
i am lost my focus When reading long speeches
Specially that have no codes inside
Comment
-
Comment