AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sub Routines and Comparisons

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
bigred
Guest





PostPosted: Wed Jul 28, 2004 9:42 am    Post subject: Sub Routines and Comparisons Reply with quote

Does AHK have the ability to do SubRoutines? I am looking for an alternative to Macro Scheduler, and that ability is one that I am looking for.

My other question is, what are the main differences between AHK, and AutoIt? I realize that these two programs are similar, and share some code, but what are the main differences/advantages of each? Also is anyone here familiar with Macro Scheduler? As far as the abilities of the scripting language go, will I be able to do everything with AHK, that I can do with MS?
The reason I am drawn to AHK, is its open source format, ability to compile to .exe, and of course the price tag. Smile
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Wed Jul 28, 2004 8:08 pm    Post subject: Reply with quote

Quote:
Does AHK have the ability to do SubRoutines?

Yes, using the Gosub command as described at http://www.autohotkey.com/docs/commands/Gosub.htm

Quote:
My other question is, what are the main differences between AHK, and AutoIt?

To compare it to AutoIt v2, there is info here: http://www.autohotkey.com/docs/AutoIt2Users.htm

By contrast, AutoIt v3 has a more powerful syntax, much like Visual Basic. It supports different variable types, user defined functions (pass parameters, receive return values, etc), and more. It also supports hotkeys, but only as a relatively basic feature compared to AHK. It is my opinion that although AutoIt v3 is more powerful in terms of syntax (supporting complex expressions, for example), it is also harder to learn and remember than AHK.

Quote:
will I be able to do everything with AHK, that I can do with MS?

I think we have at least one user of Macro Scheduler on here who might be able to highlight some of the pluses and minuses of each. Clearly, AHK is not a scheduling program, although some additional scheduling features (probably with SetTimer) are planned. I believe Macro Scheduler specializes in scheduling jobs and tasks, thus it will naturally far surpass AHK in ease-of-use and functionality in that area. Even so, I believe you can schedule just about anything with AHK -- such as by using SetTimer or even the scheduler built into Windows -- it's just a little more work.
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Thu Jul 29, 2004 8:07 am    Post subject: Reply with quote

Ok great, thanks Chris!

Im not really sure what the implications of those AutoIt3 features are. I don't know how to program, but I am trying to learn. Someone suggested that I start with a scripting language to get me started, then move to VBS, or pure VB once I had the scripting language down. So thats why I looked at MS, and am now looking at AHK. I don't really want to keep switching between languages, so do you think I should make my home here with AHK? Smile

Yeah Im not really all that interested in the scheduling aspect. Tho that is useful, I believe there are 3rd part apps that I can use to schedule AHK scripts. (Any suggestions on that, by chance?)
Back to top
Beastmaster



Joined: 15 Apr 2004
Posts: 182

PostPosted: Thu Jul 29, 2004 8:16 am    Post subject: Reply with quote

Quote:
will I be able to do everything with AHK, that I can do with MS
(MS=MacroScheduler).

TBH, Macro Scheduler not only uses his own commands it's designed to work with optional embedded VBScript. But that means that you have to know/learn two separate scripting languages to be able to use its full power.

Marcus Tettmar (MSched developer) has done a tremendous job, but I'd to realize that there hasn't been no improvement for a long time and the level of support has decreased.

Quote:
I believe Macro Scheduler specializes in scheduling jobs and tasks, thus it will naturally far surpass AHK in ease-of-use and functionality in that area

I've migrated a Macro Scheduler script (> 1000 lines) to AHK as AHK provides a perfect set of advanced features. Haven't seen anything which could not been accomplished with AHK the same way, or better/easier. MSched commands like SMTPSendMail>, RetrievePOP3>, or ScreenCapture> could be "implemented" easily in AHK running free tools like The Blat and GetMail or Capture (from AnalogX).

Have fun (with AHK Very Happy )
Back to top
View user's profile Send private message
Beastmaster



Joined: 15 Apr 2004
Posts: 182

PostPosted: Thu Jul 29, 2004 8:21 am    Post subject: Reply with quote

Quote:
I believe there are 3rd part apps that I can use to schedule AHK scripts. (Any suggestions on that, by chance?)


Have a look at this. StartMenu\Run\cmd AT /?

cmd = W2K/XP/NT
command = W9x/ME
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Thu Jul 29, 2004 12:34 pm    Post subject: Reply with quote

Quote:
Im not really sure what the implications of those AutoIt3 features are. I don't know how to program, but I am trying to learn.

The advice about learning a scripting language before learning to program is a little iffy. I guess it depends on which scripting language. Although AHK supports gotoless programming (via blocks, if/else, and loops), it is not the best way to learn programming since it lacks (for example) user defined functions and complex expressions. But I can recommend it as an easy-to-use automation tool and of course, for hotkeys.

If GUI automation is not something you particularly need, you might consider one of the scripting languages mentioned at this link as a better way to learn programming: http://www.robvanderwoude.com (in addition to these, the Ruby language has also been recommended to me recently).
Back to top
View user's profile Send private message Send e-mail
bigred



Joined: 28 Jul 2004
Posts: 2

PostPosted: Thu Jul 29, 2004 1:42 pm    Post subject: Reply with quote

Beastmaster wrote:
Have a look at this. StartMenu\Run\cmd AT /?

Wow, what is that? I didn't read it all, but the parts I did read didn't make sense. What can that do?

Chris wrote:
The advice about learning a scripting language before learning to program is a little iffy... If GUI automation is not something you particularly need...

Yeah actually I need GUI automation. I'm try to develop this application for the maintenance and automation of some software. I think the first step is getting the sort of 'program manipulation scripts' working, and for that I believe I need to use macro's. But soon I want to build an program to control those macro's through a GUI interface. For that I plan on using VB.

I know this is probably an odd subject, but is AHK right for me? Maybe those AutoIt features you mentioned are things I could use in this project. Its just that I don't want to dev half my project, then realize I have to switch languages, yet again. Also I do not believe that I have any need for the hotkey feature, but ease of use is definitely a plus!
But then AHK does seem to be powerful enough for me needs (at least as far ahead as I am able to see), plus its versatile and ever expanding. From the announcements area it looks like you are adding new features every month, and if the idea of adding VBscript capabilities is implemented, I don't imagine there will be any limitations.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Thu Jul 29, 2004 7:14 pm    Post subject: Reply with quote

Quote:
Maybe those AutoIt features you mentioned are things I could use in this project.

Although you can do complex scripts with AHK (my main script is over 6000 lines long), it is geared more toward performance and simple stepwise automation. So if you need to do very elaborate scripts that would benefit from an interpreted, expression-parsing language, AutoIt would probably be best. You might want to try the AutoIt and/or AHK tutorials to get a feel for which one you would like better. The AHK basic tutorial probably takes less than 15 minutes to go through, and there is probably something similar for AutoIt.

Ultimately, neither of these languages is suitable to unleash the full power of the Windows API, such as creating windows/dialogs and having your own message loops. Visual Basic would be better in that case.
Back to top
View user's profile Send private message Send e-mail
bigred



Joined: 28 Jul 2004
Posts: 2

PostPosted: Fri Jul 30, 2004 7:05 am    Post subject: Reply with quote

Would VB let me do the things AHK can do? For example, mouse clicks/movment, send keys, etc... I guess I should also ask if it will let me do those things easily. Are they sort of built in, or would I have to make a "Mouse Move" function?

Is it a sound idea to have a VB GUI that drives AHK macro's?
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Fri Jul 30, 2004 11:56 am    Post subject: Reply with quote

You're right that those things exist in VB, but aren't as easy to use because they require you to use lower level functions. What would probably be better is to use the AutoIt DLL, whose functions can be called from a VB program. That way, you can use the full power of VB for everything except GUI automation, and just call the AutoIt functions to do those parts.

AHK doesn't have a DLL yet -- and probably won't for quite a while since AutoIt's DLL is suitable for just about any GUI automation need.
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Fri Jul 30, 2004 1:51 pm    Post subject: Reply with quote

Oh, wow that would be perfect!
I'll have to post in their forums about that. I looked around but couldn't find any info about that other than a link the file AutoItX3.dll.

Thanks for the info Chris! I really really appreciate you taking the time to steer me in the right direction.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group