AutoHotkey Community

It is currently May 27th, 2012, 8:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: January 16th, 2012, 11:38 pm 
Offline

Joined: October 3rd, 2011, 8:41 pm
Posts: 8
Location: USA
I have searched through the help and found fileAppend ,Text,* and i can not get that to work to out to the compiled scripts cmd. I tried teh | more and still no output of the compiled script
This is my script
OS is Windows 7 x64

; this is meant to be a command line tool not a GUI based script

;Test command line arguments
OutputDebug CommandLine arguments %0% , %1%, %2%
iCommandArgs := 0
if iCommandArgs < 1
{


return
}
FileAppend, Hello this is your Script,*

I tried all the example using AllocConsole, and Used some examples I found the use GetStdHandle, Nothing seems to work.
All i want to do is print to the screen in which a COMPILED script is running.
I thought maybe I was behind because i was getting errors when running the compiled scripts with the examples so I downloaded the AutoHotKey today and retried those examples. Now the compiled script above does not produce an error, but neither does any of the examples i tried produce

any out on the cmd window
OS is Windows 7 x64
Any kind of help would be appreciated because


Report this post
Top
 Profile  
Reply with quote  
 Post subject: ConsoleSend
PostPosted: January 16th, 2012, 11:51 pm 
Offline

Joined: January 21st, 2009, 5:49 pm
Posts: 176
It will work with AttachConsole. But you can get anomalous behavior such as getting the prompt back while the script is still running, hanging cursor etc..

DllCall("AttachConsole", "int", -1) will attach the console of the parent process, meaning cmd.exe if you ran from a command line

See this thread

http://www.autohotkey.com/forum/viewtop ... highlight=

edit: in the program I mentioned in the thread I later got the prompt back while it was still running. So what I did, since AHK recursive file routines were what I wanted to use, was just call the AHK program from a console app written in another language. I used Exit code to return the number of files copied to the launching console app, which it wrote on the command line.

_________________
"I don't want to belong to any club that would have me as a member."
- Groucho Marx


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 17th, 2012, 5:27 pm 
Offline

Joined: October 3rd, 2011, 8:41 pm
Posts: 8
Location: USA
I also had something wrong with my argument counting that I had to straighten out. Thank you


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2012, 10:56 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
I posted a script in the Compile_AHK II thread which effectively turns a Win32 application into a console application or vice versa by modifying the exe's header. It's a little outdated now, but should do what you need. "Console application" is just another way of saying "command line tool".


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Exabot [Bot], migz99, sjc1000, Yahoo [Bot] and 63 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group