AutoHotkey Community

It is currently May 26th, 2012, 11:01 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: June 18th, 2007, 3:27 am 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
The file in question is only 1K in size. so I'll be OK.

How do I keep the .ahk file in the System tray ?

So I can re-execute it by just selecting "Reload this script" ?

:) Thanks.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 18th, 2007, 3:30 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
drmurdoch wrote:
The file in question is only 1K in size. so I'll be OK.


I already wrote:
You would know better!


drmurdoch wrote:
How do I keep the .ahk file in the System tray ?


Add #Persistent in the beginning of the script.

:)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 18th, 2007, 3:49 am 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
This line opens a new IE window each time.

Run, c:\Program Files\Internet Explorer\iexplore.exe %siteurl%

Q: is there a way to search to see if a window is already open that has the words "AccountInfo" in the title, and if it does ... just use that window to open the %siteurl% ? and if no such window existed, just do this ( Run, c:\Program Files\Internet Explorer\iexplore.exe %siteurl%
) ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2007, 3:58 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Should be something like this:

Code:
SetTitleMatchMode, 2
TargetWID := WinExist( "AccountInfo ahk_class IEFrame" )

If TargetWID
 {
    WinActivate ahk_id %TargetWID%
    WinwaitActive ahk_id %TargetWID%
    Send !{D}
    Send % SiteUrl Chr(13)
  }
Else
  Run, c:\Program Files\Internet Explorer\iexplore.exe %SiteUrl%


:roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: skan = genius.
PostPosted: June 18th, 2007, 4:12 am 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
works perfectly.

You are a genius.

I added the
HTML :=

back in


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2007, 7:13 am 
Offline

Joined: May 13th, 2007, 5:40 pm
Posts: 47
I learned a bit of stuff I wished to learn from watching this thread. Helped me better understand a few things myself.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: So thankful for this.
PostPosted: February 10th, 2008, 9:55 pm 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
SKAN,

Thank you so much for this.
I use it ALOT.

How would I trigger this script with a keyboard shortcut ... say ... control + greater than symbol (ie. > ).


Report this post
Top
 Profile  
Reply with quote  
 Post subject: i figured it out.
PostPosted: February 10th, 2008, 10:00 pm 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
^>:: is what I wanted, but I kept pressing ^.::
:)
thx.

so the answer is ... just put
^.::

at the top of the script !


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 12:50 am 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
A question about strings and reading files.

The file I have to read has this format.

<html><body><pre>FirstName:Billy
LastName:Bobby
NHI/SSN:2887786765439014
Address:<textarea rows="5" cols="30">My House
Nowhereville
MA </textarea>
Envelope:<textarea rows="6" cols="30">Mr. Billy Bobby
My House
Nowhereville
MA </textarea>
</pre></body></html>


How do I extract Billy and assign it to patientfirstname ?
How do I extract Bobby and assign it to patientlastname ?
Ideas ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 1:00 am 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
In my first example.....

FileRead, HTML, C:\harddrive\www\current-patient.html
SearchStr := "NHI/SSN:"
FoundPos := InStr( HTML, SearchStr )
If FoundPos
patientnumber := SubStr( HTML, FoundPos+StrLen(SearchStr), 10 )

That worked because I knew I just needed the next ten parts of the string.
My problem now is the Names (first and last) are of variable length.

How can I determine the number of characters from FoundPos to the next end of line character ?

Note: first or last names *May* contain a space.

Thanks !


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 2:21 am 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
FileReadLine, LineOne, C:\harddrive\current-patient.html, 1
FileReadLine, LineTwo, C:\harddrive\current-patient.html, 2
SearchStr := "FirstName:"
FoundPos := InStr( LineOne, SearchStr )
StringTrimLeft, patientfirstname, LineOne, FoundPos+StrLen(SearchStr)-1
;MsgBox %patientfirstname%
SearchStr2 := "LastName:"
FoundPos2 := InStr( LineTWo, SearchStr2 )
StringTrimLeft, patientlastname, LineTwo, FoundPos2+StrLen(SearchStr2)-1
;MsgBox %patientlastname%

works for me !


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 2:47 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
drmurdoch wrote:
How do I extract Billy and assign it to patientfirstname ?
How do I extract Bobby and assign it to patientlastname ?
Ideas ?

Code:
FileRead, data, C:\harddrive\current-patient.html
RegExMatch(data,"(?<=FirstName:).*?(?=\n)",patientfirstname)
RegExMatch(data,"(?<=LastName:).*?(?=\n)",patientlastname)

MsgBox, % "First Name: " patientfirstname "`nLast Name: " patientlastname

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], hyper_, JSLover, Kirtman, Leef_me, Miguel, XstatyK, 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