AutoHotkey Community

It is currently May 26th, 2012, 7:09 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: May 20th, 2008, 10:53 pm 
Offline

Joined: May 20th, 2008, 10:45 pm
Posts: 2
Here is my script. The file will not send the data to the screen from the input files that I am reading from. Everthing else works just no data displayed on the screen as I need (such as the %ssn% line. The files are notepad .dat files with data in them. The data is seperated with an enter. Can anyone please help. I am sure it is something simple.

Code:
;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function:
;   Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 3

winactivate, Oracle
place := place + 1
{
filereadline, ssn, %A_WorkingDir%/ssn.dat,place

   send, %ssn%
   sleep 800
   Send {Enter}
   send, {ALTDOWN}BN{ALTUP}
   sleep 1000
   Send, {ALTDOWN}BN{ALTUP}
   sleep 500
}
      {filereadline, bdate, %A_WorkingDir%/bdate.dat,place
      send, %bdate%
      sleep 500
      send {tab}
      sleep 500
}
         {filereadline, edate, %A_WorkingDir%/edate.dat,place
         send, %edate%
         Send, {ALTDOWN}fs{ALTUP}
         sleep 1000
         Send, {ALTDOWN}fr{ALTUP}
         sleep 1000      

}
ExitApp

Esc::ExitApp


[Moderator's note: Added code tags]


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 21st, 2008, 12:41 am 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
Code:
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 3

winactivate, Oracle
place:=0
place := place + 1
{
filereadline, ssn, %A_WorkingDir%/ssn.dat,place

send, %ssn%
sleep 800
Send {Enter}
send, {ALTDOWN}BN{ALTUP}
sleep 1000
Send, {ALTDOWN}BN{ALTUP}
sleep 500
}
{filereadline, bdate, %A_WorkingDir%/bdate.dat,place
send, %bdate%
sleep 500
send {tab}
sleep 500
}
{filereadline, edate, %A_WorkingDir%/edate.dat,place
send, %edate%
Send, {ALTDOWN}fs{ALTUP}
sleep 1000
Send, {ALTDOWN}fr{ALTUP}
sleep 1000

}
ExitApp

Esc::ExitApp


You need to give the variable a value first (Eg, place:=0), hope it works now


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 21st, 2008, 12:43 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
you do not have matched {braces}.

Are you expecting this code to loop?

Instead of FileReadLine inside a loop, you can instead use Loop, Read, %filename%

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 21st, 2008, 3:06 pm 
Offline

Joined: May 20th, 2008, 10:45 pm
Posts: 2
Thanks for you help! Here is how I got it to work.

loop, read, %A_WorkingDir%/ssn.dat

{

place := place + 1
filereadline, ssn, %A_WorkingDir%/ssn.dat,place
send, %ssn%
sleep 800
Send {Enter}
send, {ALTDOWN}BN{ALTUP}
sleep 1000
Send, {ALTDOWN}BN{ALTUP}
sleep 500

{filereadline, bdate, %A_WorkingDir%/bdate.dat,place
send, %bdate%
sleep 500
send {tab}
sleep 500

{filereadline, edate, %A_WorkingDir%/edate.dat,place
send, %edate%
Send, {ALTDOWN}fs{ALTUP}
sleep 1000
Send, {ALTDOWN}fr{ALTUP}
sleep 1000
}
}
}

ExitApp

Esc::ExitApp


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: Google Feedfetcher, kkkddd1 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