Migrating from Smart macro

For former users of Smart Macro, there are lots of new and exciting features available. However, there are some unexpected changes in some areas, which are listed in this topic.

Incompatibilities

Function overview

This table shows all functions of SmartMacro and a way to accomplish the same with InteliMacro.NET. It does not show all you can do with IntelliMacro.NET, and not how to do that in Smart Macro either.

All words starting with g_ are ordinary global variables; you can, of course, use a different name if you want or eliminate the use of the variable completely.

ADDTEXT2FILE v eSaveFile(v, e, , 1)
ARRAY v ev = Split (v, e)
ARRAYFIND v w ev = Find(w, [e])
BREAKEXITIf KeyPressed(); Exit 2; End
BREAKGO lGoto l If !KeyPressed()
CHDIR eChangeDir e
COMBINE v ev = Join(v, e)
COMMENT x# x
CONSADD eAddConsole e
CONSCLSAddConsole "",-1
CONSDEL eAddConsole "",e
CONSGET vv = ReadConsole()
CONSOLE eConsole e
CONST(not supported any longer, use a variable instead)
CONSWIDTH eConsole , e
COPYSetClipboard
DATEDateInfo(GetDate(), format) (format strings might have changed)
GETDATEDateInfo(GetDate(), format) (format strings might have changed)
DELAYDelay
DOWNDown
DOWNUPDownUp
ELSEBLOCKElse
ELSEEXITIf !condition; Exit 2; End
ELSEGOGoto label If !condition
ELSEWAITif !g_LastCondition; WaitForKey; end
EMPTY;
ENDEXIT 0
ENDBLOCKEnd
ENDBLOCKBREAKIf KeyPressed(); Exit 2; End; End
ENDENDBLOCK (not supported any longer)
FILE2TEXTtext = LoadFile(filename)
FILECOPYCopyFile source, dest
FILEDELDeleteFile filename
FILEMASK eg_mask= e
FILEMOVEMoveFile source, dest
FILEMULTISELECT v ev = FileDialog(e, g_mask, 1)
FILESELECT v ev = FileDialog(e, g_mask)
FILETO(see: FILE(COPY|MOVE))
FORFOR var = 1 .. max
FOREACHFor var : list
FORMATv = Format(mask, v)
GETCLIPGetClipboard
GETENVvalue = GetEnv(name)
GETMOUSE[x, y] = GetMouse
GETMSECS vv = GetDate() / 10000
GETSCREEN[x, y]=GetScreen()
GETSETTING(no longer available)
GETWNDttl = WindowInfo(0,"title")
GOSUBCall
GOSUBX(Call)
GOTOGoto label
GOTOXGoto (expression)
HWNDCHECKv = WindowInfo(spec, "checked")
HWNDCLASSc = WindowInfo(spec, "");
HWNDFROMPOINTh = WindowFromPoint(x,y)
HWNDGET,HWNDSUBGET,HWNDTOPGETh = GetWindow(spec) / h = GetWindows(spec)[idx]
HWNDGETPOS[x,y,w,h] = GetPosition(spec)
HWNDMDIGETd = FindWindows("*&handle=" & h & "|**|*&mdi=1")[1]
HWNDMDISETWindow d
HWNDPROCESSpid = WindowInfo(spec, "ProcessID")
HWNDSETWindow h
HWNDSETPOSSetPosition(h,x,y,w,e)
HWNDSETSTATE_HSetPosition(h,,,,,"hide")
HWNDSETSTATE_MSetPosition(h,,,,,"min")
HWNDSETSTATE_RSetPosition(h,,,,,"n")
HWNDSETSTATE_SSetPosition(h,,,,,"n")
HWNDSETSTATE_XSetPosition(h,,,,,"max")
HWNDSETTOPSetPosition(h,,,,,,v)
HWNDTEXTt = WindowInfo(spec, "title")
HWNDUPh = WindowInfo(h, "parenthandle")
IFg_LastCondition = condition
IFARRAYg_LastCondition = %x == 2
IFBREAKg_LastCondition = KeyPressed()
IFFILEg_LastCondition = FileInfo(filename, "type") != ""
IFHOTKEYg_LastCondition = KeyPressed([hotkey (default=<BREAK>)])
IFPROCESSg_LastCondition = &FindProcesses("*&file=*" & var & "*") > 0
IFWNDg_LastCondition = $FindWindows("*&title=*" & title & "*") <> 0
IFYESg_LastCondition = Confirm(message, "?Yn" [,title])
INITHOTKEYSKeyPressed(-1)
INITMODULES(no longer supported)
INPUTvalue=Input(prompt[,default])
LABELlabel:
LCASEvar = LCase(var)
LISTDIRSvar = FindFiles(pattern,[basepath],1)
LISTFILESvar = FindFiles(pattern,[basepath],2)
LISTPROCESSESvar = FindProcesses("*")
LOADRun program
LOADMODULE (no longer available)
LOADWAITRun program,,,1
LOOPvar=var-1; Goto label If !var
LOOPBLOCKwhile 1
LTRIMvar = Trim(var,chars,1)
MKDIRChangeDir directory, 1
MOUSEMouse
MOUSERELMouseRel
MSGMsg
MSGBOXMsg
NEXTEnd
NOBREAKGOGoto label If !KeyPressed()
NOTTHENBLOCKIf !g_LastCondition
PASTEvar = GetClipboard()
POP[popped .. internalstack] = internalstack
PROCESSEXEfilename = ProcessInfo(pid, "file")
PUSHinternalstack = [pushed] & internalstack
QUITEXIT 0
REPEATRepeat [count]
RESETBLOCK(not supported)
RETURNSub .. End
RMDIRRmDir path
RTRIMvar=Trim(var,[chars],2)
RUNRun program
RUNWAITRun program,,,1
SELECTindex = Select(list)
SENDCOPYDownUp <CTRL>, <C>
SENDCUTDownUp <Ctrl>, <X>
SENDKEYSSendKeys keystring
SENDPASTEDownUp <Ctrl>, <V>
SENDTEXTSendText text
SENDTEXTCLIPSetClipboard text; DownUp <Ctrl>, <V>
SETvar = value
SETCLIPSetClipboard
SETENVSetEnv var, value
SETLtarget = source & target[$source+1..]
SETRtarget = target[1..$target-$source] & source
SETSETTING(no longer available)
SETWNDif $FindWindows(desc) = 1; Window desc; end
SETWNDXWINDOW
SORTARRAYarray = Sort(array[,direction])
STOPStop
TEXT2FILESaveFile(filename, text)
TEXTFIND p v ep = Find(v, e)
TEXTFROMvar = var[pos..]
TEXTTOvar = var[..pos]
THENBLOCKif g_LastCondition
THENEXITif g_LastCondition; exit 2; end
THENGOgoto label if g_LastCondition;
THENWAITif g_LastCondition; WaitForKey; end
TIPPMsg text,,1
TRIMvar = Trim(var[,chars])
UCASEvar = UCase(var)
UPUp
VARNAME(no longer needed)
WAITBREAKWaitForKey

Porting window strings