I finally understood all the syntax and how the program works...
The above Lite-c example is finally done and working in AutoHotkey Script language:
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Recommended for catching common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;Comment initialize variables
count := 1
model :=

;Comment wait wile selecting MED window
Sleep 10000 ;Comment 10 seconds


;Comment the start of the loop
Loop
{


;Comment open "import obj" menu by pressing "ALT f i m m m m m m ENTER"
Send {Alt}fimmmmmm{enter}
Sleep, 300  ;Comment 1/4th of a second


;Comment insert obj file name
Send EarthHEX
if count < 10
Send 0
if count < 100
Send 0
model = %count%
Loop, parse, model
{
    Send %A_LoopField%
}
if (count=1||count=17||count=33||count=49||count=65||count=81||count=97||count=113||count=129||count=145||count=161||count=177)
Send p
SendRaw .
Send obj


;Comment finalize import pressing "ENTER" twice
Send {enter}
Sleep, 250  ;Comment 1/4th of a second
Send {enter}
Sleep, 250  ;Comment 1/4th of a second


;Comment open "save as mdl" menu by pressing "ALT f a"
Send {Alt}fa
Sleep, 250  ;Comment 1/4th of a second


;Comment insert mdl file name
Send EarthHEX
if count < 10
Send 0
if count < 100
Send 0
model = %count%
Loop, parse, model
{
    Send %A_LoopField%
}
if (count=1||count=17||count=33||count=49||count=65||count=81||count=97||count=113||count=129||count=145||count=161||count=177)
Send p
SendRaw .
Send mdl


;Comment finalize "save as mdl" by pressing "ENTER"
Send {enter}
Sleep, 250  ;Comment 1/4th of a second


;Comment loop back to the start of loop or stop loop
count++

if count > 482
break
}


Thankyou very much for showing me this program! I can now start automating anything I want in any program!
And using alt+tab commands... tedious workflow between different programs can be automated too!
(for example load a .wing file in wings3d, export as .obj from wings3d, alt+tab to med, import .obj in med, save as .mdl from med, alt+tab back to wings3d, repeat a million times withought ever having to browse through menus, files, press a key or click the mouse...)
I love it!!! Thanks a million times!!!


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1