AutoHotkey Community

It is currently May 27th, 2012, 10:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: December 27th, 2007, 5:21 pm 
Offline

Joined: December 18th, 2007, 1:47 pm
Posts: 11
I feel like such a newb asking so many questions, not knowing where to begin trying to figure things out on my own.

I've made so many tedious tasks at work so simple and smooth so far, every day I find a new use for AHK.

ANYWAY......

So I'm trying to figure out a way to detect when a MAC address is typed in. (It's always 12 characters long, and hexadecimal (0-9, A-F)

After seeing a MAC address, I just want to send a {tab}.


I have the same thing for a serial number, but I think I can figure that out once I get the mac field taken care of. :)

Thanks in advance!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 27th, 2007, 6:38 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
Look at StringLen. That should let you determine the length of the string.

A thought would be to parse that string on the : and make sure the parts created are each 2 characters, to hopefully make sure it is a MAC addres.

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 27th, 2007, 7:21 pm 
Offline

Joined: December 18th, 2007, 1:47 pm
Posts: 11
Hrm. Basically what I'm doing is I have a barcode scanner that works as if you actually typed what it scans.

I scan a barcode with a MAC address (no spaces or colins), tab to the next field, scan a serial number, tab to the next field, scan a custom barcode that triggers a hotstring that saves the entry and opens a new window for the next entry.

I'm trying to eliminate the manual tabbing. (I know, lazy :) )


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 27th, 2007, 7:46 pm 
Offline

Joined: July 25th, 2006, 7:37 pm
Posts: 490
Location: Midwest, USA
Hey, that's what scripting is all about. I don't even want to tell you how many things I've scripted to avoid annoyances. If that's the case, then you just need to check if the StringLen is 12 or not I guess. :) Only other thing I might suggest is that you check to make sure you're in the proper field when checking.

_________________
SilverEdge78


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 27th, 2007, 7:57 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
you may need Regex powered Dynamic hotstrings. It may or may not suit your needs.

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 28th, 2007, 1:53 pm 
Offline

Joined: December 18th, 2007, 1:47 pm
Posts: 11
engunneer wrote:
you may need Regex powered Dynamic hotstrings. It may or may not suit your needs.


That looks like it should do what I need, it should be easy enough to build a regex that matches my serial number string or mac address string.

I was hesitant to reply in that thread, but am I doing this correctly:

Copy and paste entire function to my autohotkey.ahk, and use the the example anywhere else in the file?

My script seems to reload without errors, but my examples don't expand. Maybe I'm making some stupid newbie mistake?

Thx


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 28th, 2007, 1:58 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
scoob8000 wrote:
I was hesitant to reply in that thread
Please don't be.

scoob8000 wrote:
Copy and paste entire function to my autohotkey.ahk, and use the the example anywhere else in the file?
Save the script and #Include it in another script file where you have your hotstrings. If you used your StdLib you won't need to use include.

_________________
GitHubScriptsIronAHK Contact by email not private message.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, chaosad, specter333, Yahoo [Bot] and 71 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