topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 8:27 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Next step up from Autohotkey  (Read 17254 times)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Next step up from Autohotkey
« on: August 11, 2011, 05:30 AM »
I like a practical approach of autohotkey, but once I started doing more advanced things such as robust gui apps, I noticed that the community code is a bit underdocumented and fragile. Quickly it seems, one has to deal with DLLCalls, com objects and resort to code such as:
Code: Text [Select]
  1. VarSetCapacity( HexClr,14,0 ), SClr := DllCall( "GetSysColor", UInt,DisplayElement )
  2. A_Index & 1 ? ( _ := A_LoopField ) : ( %_% := A_LoopField )
  3. DllCall( NumGet( NumGet( _ppunk+0 )+4*0 ), UInt,_ppunk, UInt,_pIWEB, UIntP,_ppwb )

.. that to me seems like coding against the limits of the language. However I like the fact that a lot of functionality comes with the language and that you are not dealing with putting dozens of lines of code in place just in order to put a notification up for example.

What do people recommend as the natural next step up from AHK without sacrificing too much of the 'high level programming' attitutde? Or is there nothing out there that is an intermediate step between this and .net for example.
« Last Edit: August 11, 2011, 05:34 AM by justice »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #1 on: August 11, 2011, 05:39 PM »
It probably depends a little on how windows-centric you are looking for.  One of the .net languages would be a natural thing to try if you want to focus on windows intricacies.   Python might be a natural thing to try if you are interested in going more platform neutral, and are willing to work a little harder to do some of the windows tricks that ahk can help you with.

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,857
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #2 on: August 11, 2011, 06:47 PM »
Take a look at this post from Carol Haynes regarding Real Studio if the .Net approach doesn't appeal to you.

Not free ($99 and up depending on version), but there's a 30-day full-feature evaluation download available. And it comes with a 90-day money back guarantee if you later decide not to keep it.

I noodled with the eval and was pretty impressed with it. But I'm also not much of a coder so take anything I say about it with a grain of salt.  :D



« Last Edit: August 11, 2011, 06:56 PM by 40hz »

mrainey

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 439
    • View Profile
    • Website
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #3 on: August 11, 2011, 08:06 PM »
You might enjoy working with Creative BASIC - easily develop GUI applications in an interpreted environment, then create standalone executables.  It costs ten bucks.

http://www.ionicwind.com/cbasic.html
Software For Metalworking
http://closetolerancesoftware.com

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #4 on: August 11, 2011, 09:56 PM »
I don't want to set off a religious war.  AHK and AutoIt3 have the same roots.  I use both.

I find AHK superior in the area of Mouse Hotkeys.  Also you can use the library functions without listing a bunch of include files.

I find AutoIt3 has better scoping.  It's easier to create user libraries of general purpose routines to include in your scripts. Also AutoIt3 string handling is much simpler.  Just double quote strings as in most programming languages.

Often I will code the main app in AutoIt3 and have a helper exe to do the Mouse Hotkey handling in AHK.

For alternatives the big dividing line other than to Window or not to Window is COM support.  FreeBASIC is a free basic compiler that doesn't require run-times.  It produces very small stand-alone 32 bit Windows applications. But the COM support, well, you might as well say there isn't any.  It is easy to call WinAPI functions or other functions in DLLs though.

I guess I'm beating around the bush because there's no way to answer your question without knowing what you want to do.

Mouser is right that if you want platform interoperability then you are better off looking at languages such as Python, Perl, Java, Rexx flavors etc.. and for compiled languages C/C++.

If we are talking Windows only I would try AutoIt3 first. If you can do AHK the AutoIt3 code blocks are much easier to deal with.  There's no "expression mode" where things act one way and non expression mode where stuff acts another way. It's just blocks, functions, loops, select and switch like most procedural languages.  AutoIt3 has native support for objects.  It doesn't have associative arrays but you can get one on XP or later just by using Scripting.Dictionary.

I wrote some wrapper functions to make Scripting.Dictionary easy to use in my AutoIt3 programs.  The compare mode 1 is compare as strings with no case sensitivity as that's the most generally useful for me.


;use Scripting.Dictionary object for simple associative arrays
Func _AssocArray()
Local $aArray = ObjCreate("Scripting.Dictionary")
If @error Then
Return SetError(1, 0, 0)
EndIf
$aArray.CompareMode = 1
Return $aArray
EndFunc   ;==>_AssocArray

Func _AssocArrayDestroy(ByRef $aArray)
If Not IsObj($aArray) Then
Return False
EndIf
$aArray.RemoveAll()
$aArray = 0
Return True
EndFunc   ;==>_AssocArrayDestroy


Here's one I use frequently to get the hex color code when indexing the color list by the name of the color:

Func _ColorList()
Local $colorList = _AssocArray()
If @error Then
Return SetError(1, 0, 0)
EndIf
$colorList("AntiqueWhite") = 0xFAEBD7
$colorList("Black") = 0x000000
$colorList("Blue") = 0x0000FF
$colorList("Brown") = 0xA52A2A
$colorList("CadetBlue") = 0x5F9EA0
$colorList("Chocolate") = 0xD2691E
$colorList("Coral") = 0xFF7F50
$colorList("CornflowerBlue") = 0x6495ED
$colorList("DarkBlue") = 0x00008B
$colorList("DarkCyan") = 0x008B8B
$colorList("DodgerBlue") = 0x1E90FF
$colorList("ForestGreen") = 0x228B22
$colorList("Gold") = 0xFFD700
$colorList("Gray") = 0x808080
$colorList("Green") = 0x008000
$colorList("HotPink") = 0xFF69B4
$colorList("LightGreen") = 0x90EE90
$colorList("LightPink") = 0xFFB6C1
$colorList("LightSeaGreen") = 0x20B2AA
$colorList("Lime") = 0x00FF00
$colorList("Magenta") = 0xFF00FF
$colorList("Maroon") = 0xB03060
$colorList("MediumTurquoise") = 0x48D1CC
$colorList("MediumVioletRed") = 0xC71585
$colorList("MistyRose") = 0xFFE4E1
$colorList("Navy") = 0x000080
$colorList("Olive") = 0x808000
$colorList("Orchid") = 0xDA70D6
$colorList("PaleGreen") = 0x98FB98
$colorList("PaleVioletRed") = 0xDB7093
$colorList("Pink") = 0xFFC0CB
$colorList("Plum") = 0xDDA0DD
$colorList("Purple") = 0x800080
$colorList("Red") = 0xFF0000
$colorList("RoyalBlue") = 0x4169E1
$colorList("Sienna") = 0x00A0522D
$colorList("Silver") = 0xC0C0C0
$colorList("SkyBlue") = 0x87CEEB
$colorList("SteelBlue") = 0x004682B4
$colorList("Tan") = 0xD2B48C
$colorList("Teal") = 0x008080
$colorList("Violet") = 0xEE82EE
$colorList("Wheat") = 0xF5DEB3
$colorList("White") = 0xFFFFFF
$colorList("Yellow") = 0xFFFF00
Return $colorList
EndFunc   ;==>_ColorList


« Last Edit: August 11, 2011, 10:00 PM by MilesAhead »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #5 on: August 12, 2011, 04:06 AM »
Thanks for all the comments so far. Will look at all suggestions, was interested to try out AutoIt to see how it compares, and also python as it will be useful for both desktop clients and web.  :up:

The thing I don't understand about .NET is though (and I had the same trying to wrap my head around asp.net) How does anyone remember all the .net imports,  when to use them, and what libraries are required when you want to achieve certain functionality. Say you want to do x (run a command line program and capture its output or whatever trivial thing), how do you go about finding the required imports etc.. There's too many of them. :-\

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,857
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #6 on: August 12, 2011, 07:55 AM »
I don't know if this is a step up, but a friend I occasionally work with spoke kindly about this development tool.

It's called Illumination. Its a visual cross-platform development environment that supports: Windows, Mac, Linux, iOS, Android, Flex/Flash, and Maemo. (It was designed by Bryan Lunduke who's one of the hosts of the Linux Action Show in case anybody's interested,)

My buddy used it for quick prototyping a combo iOS/Android project he worked on. He says the "Tinker Toy" snap-together methodology won't appeal to some of  the "real programmers" out there. But within the scope of what Illumination is designed to do, he says it gets the job done handily.

Being a former professional programmer and senior project manager for two of the big software publishers (and an absolute C/C++/Mono wizard) I tend to trust his opinions when it comes to software development.

Might be worth a look. 8)


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #7 on: August 12, 2011, 03:40 PM »

The thing I don't understand about .NET is though (and I had the same trying to wrap my head around asp.net) How does anyone remember all the .net imports,� when to use them, and what libraries are required when you want to achieve certain functionality. Say you want to do x (run a command line program and capture its output or whatever trivial thing), how do you go about finding the required imports etc.. There's too many of them. :-\

It is massive. You just have to get skilled with the help search.  The example code has the Using statements to put at the top of the module. That's equivalent to #include in other languages. If you search how to do a particular thing in C# or whatever with a general search engine you can nearly always find a small example.

The nice thing about AHK, AutoIt3, and Python for Windows for that matter, is you can wrap the interpreter into the exe so that the user doesn't need it installed.  As far as they are concerned it's just a program exe file.  I think there are some people out there still averse to .NET.  Or at least don't like to add more versions than what are already loading with the OS.  Some people see .NET they will just bypass your utility.

« Last Edit: August 12, 2011, 03:43 PM by MilesAhead »

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #8 on: August 14, 2011, 10:42 AM »
You might enjoy working with Creative BASIC

@mrainey: do you have any comments on Creative BASIC versus FreeBASIC (free, Windows, Linux & DOS) and PureBasic (79 euros, but that covers all future updates and Amiga, Linux Windows and MacOS X)?

mrainey

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 439
    • View Profile
    • Website
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #9 on: August 14, 2011, 05:36 PM »
@mrainey: do you have any comments on Creative BASIC versus FreeBASIC (free, Windows, Linux & DOS) and PureBasic (79 euros, but that covers all future updates and Amiga, Linux Windows and MacOS X)?

I haven't worked with either of those.  Creative is easy to learn and surprisingly powerful, but it's Windows-only.
Software For Metalworking
http://closetolerancesoftware.com

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #10 on: August 14, 2011, 06:58 PM »
Although it may seem counter-intuitive, picking up some assembler doesn't hurt.  Then you see what programming languages have in common under the covers.  Also helps when debugging compiled apps.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #11 on: August 15, 2011, 02:43 PM »
picking up some assembler doesn't hurt.
As I understand it, PureBasic converts source code into assembler, which is then compiled by NASM.  I think that's part of the reason Horst Schaeffer uses it, as he has long experience as an assembler programmer.


This isn't a new idea.  Rowan Crowe's MoonRock compiler did the same for DOS, using a free version of Arrow Assembler.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #12 on: August 15, 2011, 02:45 PM »
Creative is easy to learn and surprisingly powerful
I think the low $10 price puzzles me.  Rhetorical question - why isn't it either free, or a higher price?

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #13 on: August 15, 2011, 06:20 PM »
picking up some assembler doesn't hurt.
As I understand it, PureBasic converts source code into assembler, which is then compiled by NASM.  I think that's part of the reason Horst Schaeffer uses it, as he has long experience as an assembler programmer.


This isn't a new idea.  Rowan Crowe's MoonRock compiler did the same for DOS, using a free version of Arrow Assembler.

FreeBASIC was using gas assembler.  But I think now it's emitting C. I'm not positive though. If it isn't yet I believe it's on the ToDo list. In either case it does produce stand-alone exe for Win32.

My first programming language was GWBasic on Dos.  As was the rage at that time PC Magazine had a TSR written in assembler in just about every issue. I learned asm for 80x86 and later Vax.  It made it a bit easier when I took on other languages like C and C++ that I had an idea what went on under the covers. I bought one of the Borland packages that had Turbo Assembler along with the high level language.  Turn the Dos programming manual to Int 21H and you were right 90% of the time! :)

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #14 on: August 16, 2011, 02:50 PM »
Dos programming manual to Int 21H
I'm no programmer, and even I've heard of that!  :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #15 on: August 16, 2011, 04:07 PM »
Dos programming manual to Int 21H
I'm no programmer, and even I've heard of that!  :)

Heh heh.  They used to call it "the Dos Interrupt." If you wanted to fake it you new assembler to non asm types all you had to say was "There's an interrupt for that. Int 21H subfunction yadda yadda" and they'd go for it. :)

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #16 on: August 17, 2011, 03:22 PM »
all you had to say was "There's an interrupt for that. Int 21H subfunction 
For which, I believe, the C equivalent is "I think you'll find that in Knuth?"  :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #17 on: August 17, 2011, 03:56 PM »
all you had to say was "There's an interrupt for that. Int 21H subfunction 
For which, I believe, the C equivalent is "I think you'll find that in Knuth?"  :)

I knuth you were going to say that. :)
Unfortunately I don't have a para-digms to rub together these days.

kwacky1

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 182
  • i am Cody's cousin
    • View Profile
    • CrazyLittleWebsite
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #18 on: August 22, 2011, 08:42 AM »
+1 for AutoIt, I use it every second of every day at work, I have 100's of scripts that I use all the time for all sorts of tasks (deploying software, managing active directory etc).  :-*

I also use AutoHotkey but pretty much as MilesAhead says, only for Hotkey type things, but I learnt about AHK after I already was well into AutoIt (learnt AHK via the DC programming school!).

I also started way back in the day with GW-BASIC, mastered Turbo Pascal and dabbled in C/C++.  But nowadays it's all autoit/asp(vbscript)/php/tsql/mysql for me.

LibertyToad

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #19 on: September 01, 2011, 07:20 AM »
Python is a logical step up from AutoHotKey.  Python is a wonderful language.  Concise, easy to use, and pretty clear.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,199
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #20 on: September 01, 2011, 04:13 PM »
AHK and AutoIt3 have the same roots.  I use both.
You know the watch-my-fingers automatic script generating utility that comes with AHK?  Does it work any better with AutoIt3?

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Next step up from Autohotkey
« Reply #21 on: September 01, 2011, 11:08 PM »
AHK and AutoIt3 have the same roots.  I use both.
You know the watch-my-fingers automatic script generating utility that comes with AHK?  Does it work any better with AutoIt3?

I haven't tried it.