Skip to content

Commit

Permalink
Fixed syntax of new commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pulover committed Apr 30, 2016
1 parent ce6910f commit b989e36
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 33 deletions.
18 changes: 9 additions & 9 deletions Documentation/MacroCreator_Help.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
Waits the specified amount of time before continuing.
Parameters:
Add Pause - The amount of time to pause (choose format in the options below).
Add Pause - The amount of time to pause (choose format in the options below). This field accepts [Variables & Expressions](Variables.html).
Miliseconds / Seconds / Minutes - Sets format of time (seconds and minutes will be converted to miliseconds when the command is added).
Random delay - Sets the command use a random value between Minimum and Maximum instead of a predefined value.
Disable random delays for this command - If the global option for *Random delays" is active the command won't be affected.
Expand All @@ -169,7 +169,7 @@
Parameters:
Message - Text to display in the message. If the Cancel button is pressed, execution will stop. This field accepts [Variables & Expressions](Variables.html).
Title - The title of the message box window.
Title - The title of the message box window. This field accepts [Variables & Expressions](Variables.html).
Icon - Sets the icon to be shown on the Message Box.
Buttons - Sets which buttons will be shown on the message box.
Default - Sets the default button.
Expand Down Expand Up @@ -219,7 +219,7 @@
Parameters:
Start X/Y / End X/Y - Defines the Search area of the screen/window.
Make Screenshot - Use this tool to take a screenshot of an area of the screen (see [Instructions](#make-screenshot-tool-instructions) for details on usage).
File - Path for the image file, which is assumed to be in the same folder as MacroCreator.exe if an absolute path isn't specified.
File - Path for the image file, which is assumed to be in the same folder as MacroCreator.exe if an absolute path isn't specified. This field accepts [Variables & Expressions](Variables.html).
Search - Opens the File Select dialog to select an Image File.
If found - Selects an action to execute when an image/pixel is found.
To execute a different action Select 'Continue' (or 'Break' to exit the command's loop) and use the 'If Image/Pixel Found' option in the If Statements window.
Expand Down Expand Up @@ -276,7 +276,7 @@
Parameters:
Start X/Y / End X/Y - Defines the Search area of the screen/window.
Color Picker - Opens the Color Picker Tool. Point the mouse to the desired location and Right-Click to get the pixel code (in RGB format).
ColorID - The decimal or hexadecimal color ID to search for, in Blue-Green-Red (BGR) format.
ColorID - The decimal or hexadecimal color ID to search for, in Blue-Green-Red (BGR) format. This field accepts [Variables & Expressions](Variables.html).
Search - Opens the Windows Color Pick dialog to select a pixel color.
If found - Selects an action to execute when an image/pixel is found.
To execute a different action Select 'Continue' (or 'Break' to exit the command's loop) and use the 'If Image/Pixel Found' option in the If Statements window.
Expand Down Expand Up @@ -708,7 +708,7 @@

/*!
Function: Send_Email(F11)
Sends emails using an user-defined account. All fields accept [variables](Variables.html#expressions).
Sends emails using an user-defined account. All fields accept [variables](Variables.html).
Parameters:
Message - Body of the message. It can be text or HTML.
Expand All @@ -732,7 +732,7 @@

/*!
Function: Download_Files(Shift+F11)
Downloads one or more files from the Internet. All fields accept [variables](Variables.html#expressions).
Downloads one or more files from the Internet. All fields accept [variables](Variables.html).
Parameters:
Destination folder - The name of the destination folder, which is assumed to be in %A_WorkingDir% if an absolute path isn't specified.
Expand All @@ -748,7 +748,7 @@

/*!
Function: Zip_Files(Ctrl+F11)
Compress or uncompress one or more zip files. All fields accept [variables](Variables.html#expressions).
Compress or uncompress one or more zip files. All fields accept [variables](Variables.html).
Parameters:
Zip files / Unzip files - Select the desired operation.
Expand All @@ -770,7 +770,7 @@

/*!
Function: Internet_Explorer(F12)
Creates an Internet Explorer COM Object and adds automation commands for it. All fields accept [variables](Variables.html#expressions).
Creates an Internet Explorer COM Object and adds automation commands for it. All fields accept [variables](Variables.html), except *Commands*.
Parameters:
Commands - The dropdown list contains some of the most used IE Methods and Properties. Select the correct one to manipulate the browser window or page elements.
Expand Down Expand Up @@ -826,7 +826,7 @@

/*!
Function: PostMessage_and_SendMessage(Ctrl+F12)
Sends a message to a window or control (SendMessage additionally waits for acknowledgement).
Sends a message to a window or control (SendMessage additionally waits for acknowledgement). All fields accept [variables](Variables.html).
Parameters:
Message Number - The message number to send.
Expand Down
12 changes: 12 additions & 0 deletions LIB/Class_PMC.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@
, SetUserWords(UserDefFunctions)
}
}
If (Code.Version < "5.0.2")
{
If (Col[6] = "SendEmail")
{
Action := Col[2]
StringSplit, Act, Action, :
Action := SubStr(Col[2], StrLen(Act1) + 2)
, Col[2] := Act1, Col[3] := Action "=" Col[3]
}
If ((Col[6] = "DownloadFiles") || (Col[6] = "Zip") || (Col[6] = "Unzip"))
Col[8] := Col[7], Col[7] := Col[2], Col[2] := "[" StrReplace(Col[6], "Files") "]"
}
If (Code.Version = "")
{
Col[3] := CheckForExp(Col[3])
Expand Down
14 changes: 7 additions & 7 deletions LIB/Export.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,11 @@
}
Else If (Type = cType52)
{
StringSplit, Act, Action, :
Action := SubStr(Action, StrLen(Act1) + 2)
StringSplit, Tar, Target, /
CDO_To := CheckExp(SubStr(Tar1, 4), 1)
, CDO_Sub := CheckExp(Action, 1)
CDO_Sub := SubStr(Step, 1, RegExMatch(Step, "=\d:") - 1)
, Step := SubStr(Step, RegExMatch(Step, "=\d:") + 1)
, CDO_To := CheckExp(SubStr(Tar1, 4), 1)
, CDO_Sub := CheckExp(CDO_Sub, 1)
, CDO_Msg := SubStr(Step, 3)
, CDO_Html := SubStr(Step, 1, 1)
, CDO_Att := Window
Expand All @@ -509,7 +509,7 @@
, User_Accounts := UserMailAccounts.Get(true)
For _each, _Section in User_Accounts
{
If (Act1 = _Section.email)
If (Action = _Section.email)
{
SelAcc := _each
break
Expand Down Expand Up @@ -537,14 +537,14 @@
}
Else If (Type = cType53)
{
RowData := "`nWinHttpDownloadToFile(" CheckExp(Step, 1) ", " CheckExp(Action, 1) ")"
RowData := "`nWinHttpDownloadToFile(" CheckExp(Step, 1) ", " CheckExp(Target, 1) ")"
, RowData := Add_CD(RowData, Comment, DelayX)
If ((TimesX > 1) || InStr(TimesX, "%"))
RowData := "`nLoop, " TimesX "`n{" RowData "`n}"
}
Else If ((Type = cType54) || (Type = cType55))
{
RowData := "`n" Type "(" CheckExp(Step, 1) ", " CheckExp(Action, 1) ", " (Target ? "true" : "")
RowData := "`n" Type "(" CheckExp(Step, 1) ", " CheckExp(Target, 1) ", " (Window ? "true" : "")
, RowData := RTrim(RowData, ", ") . ")"
, RowData := Add_CD(RowData, Comment, DelayX)
If ((TimesX > 1) || InStr(TimesX, "%"))
Expand Down
1 change: 1 addition & 0 deletions LIB/Internal.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,7 @@ WinHttpDownloadToFile(UrlList, DestFolder)
ado.Type := 1 ; adTypeBinary
ado.Open
ado.Write(whr.ResponseBody)
OutputDebug, %FileName%
ado.SaveToFile(FileName, 2)
ado.Close
}
Expand Down
8 changes: 4 additions & 4 deletions LIB/Playback.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ PlayCommand(Type, Action, Step, TimesX, DelayX, Target, Window, Pars, Flow, Cust
,%cType10%,%cType12%,%cType24%,%cType22%,%cType23%,%cType25%,%cType31%,WinWait,WinWaitActive
,WinWaitNotActive,WinWaitClose,WinGetTitle,WinGetClass,WinGetText,WinGetPos,%cType52%,%cType53%
,%cType54%,%cType55%,%cType32%,%cType33%
CheckVars(CustomVars, Action, Step)
CheckVars(CustomVars, Step)
Else If Type not in %cType34%,%cType43%
{
For _each, _value in Pars
Expand Down Expand Up @@ -1873,15 +1873,15 @@ PlayCommand(Type, Action, Step, TimesX, DelayX, Target, Window, Pars, Flow, Cust
return

pb_DownloadFiles:
WinHttpDownloadToFile(Step, Action)
WinHttpDownloadToFile(Step, Target)
return

pb_Zip:
Zip(Step, Action, Target)
Zip(Step, Target, Window)
return

pb_Unzip:
Unzip(Step, Action, Target)
Unzip(Step, Target, Window)
return

pb_IECOM_Set:
Expand Down
26 changes: 13 additions & 13 deletions MacroCreator.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -9234,17 +9234,17 @@ SB_SetText("lines: " 0, 3)
SB_SetIcon(ResDllPath, IconsNames["help"])
If (s_Caller = "Edit")
{
Subject := SubStr(Details, 1, RegExMatch(Details, "=\d:") - 1)
Details := SubStr(Details, RegExMatch(Details, "=\d:") + 1)
StringReplace, Details, Details, ``n, `n, All
StringSplit, Act, Action, :
Action := SubStr(Action, StrLen(Act1) + 2)
StringSplit, Tar, Target, /
GuiControl, 39:, IsHtml, % SubStr(Details, 1, 1)
GuiControl, 39:, TextEdit, % SubStr(Details, 3)
GuiControl, 39:, To, % SubStr(Tar1, 4)
GuiControl, 39:, Cc, % SubStr(Tar2, 4)
GuiControl, 39:, Bcc, % SubStr(Tar3, 5)
GuiControl, 39:ChooseString, From, %Act1%
GuiControl, 39:, Subject, %Action%
GuiControl, 39:ChooseString, From, %Action%
GuiControl, 39:, Subject, %Subject%
GuiControl, 39:, TimesX, %TimesX%
GuiControl, 39:, EdRept, %TimesX%
GuiControl, 39:, DelayX, %DelayX%
Expand Down Expand Up @@ -9282,7 +9282,7 @@ If (From = "")
return
}
StringReplace, TextEdit, TextEdit, `n, ``n, All
Action := From ":" Subject, Details := IsHtml ":" TextEdit, Type := cType52
Action := From, Details := Subject "=" IsHtml ":" TextEdit, Type := cType52
, Target := "To=" To "/CC=" Cc "/BCC=" Bcc
, DelayX := InStr(DelayC, "%") ? DelayC : DelayX
, TimesX := InStr(EdRept, "%") ? EdRept : TimesX
Expand Down Expand Up @@ -9467,17 +9467,17 @@ If (s_Caller = "Edit")
StringReplace, Details, Details, ``n, `n, All
If (A_ThisLabel = "EditDownload")
{
GuiControl, 40:, DlFolderVar, %Action%
GuiControl, 40:, DlFolderVar, %Target%
GuiControl, 40:, DlLinks, %Details%
}
Else
{
If (Type = cType55)
GuiControl, 40:, Unzip, 1
GoSub, ZipMode
GuiControl, 40:, ZipFileVar, %Action%
GuiControl, 40:, ZipFileVar, %Target%
GuiControl, 40:, ZipFilesVar, %Details%
If (Target = "Separate")
If (Window = "Separate")
GuiControl, 40:, Separate, 1
}
}
Expand Down Expand Up @@ -9511,7 +9511,7 @@ If (TabControl = 1)
return
}
StringReplace, DlLinks, DlLinks, `n, ``n, All
Type := cType53, Action := DlFolderVar, Details := DlLinks, Target := ""
Type := cType53, Action := "[Download]", Details := DlLinks, Target := DlFolderVar, Window := ""
If (A_ThisLabel != "DownloadApply")
{
Gui, 1:-Disabled
Expand All @@ -9528,7 +9528,7 @@ Else
return
}
StringReplace, ZipFilesVar, ZipFilesVar, `n, ``n, All
Type := Zip ? cType54 : cType55, Action := ZipFileVar, Details := ZipFilesVar, Target := Separate ? "Separate" : ""
Type := Zip ? cType54 : cType55, Action := "[" Type "]", Details := ZipFilesVar, Target := ZipFileVar, Window := Separate ? "Separate" : ""
If (A_ThisLabel != "ZipApply")
{
Gui, 1:-Disabled
Expand All @@ -9538,10 +9538,10 @@ Else
Gui, chMacro:Default
RowSelection := LV_GetCount("Selected"), LV_GetText(RowType, LV_GetNext(), 6)
If (s_Caller = "Edit")
LV_Modify(RowNumber, "Col2", Action, Details, TimesX, DelayX, Type, Target)
LV_Modify(RowNumber, "Col2", Action, Details, TimesX, DelayX, Type, Target, Window)
Else If ((RowSelection = 0) || ((RowType = cType47) || RowType = cType48))
{
LV_Add("Check", ListCount%A_List%+1, Action, Details, 1, DelayG, Type, Target)
LV_Add("Check", ListCount%A_List%+1, Action, Details, 1, DelayG, Type, Target, Window)
, LV_Modify(ListCount%A_List%+1, "Vis")
}
Else
Expand All @@ -9551,7 +9551,7 @@ Else
Loop, %RowSelection%
{
RowNumber := LV_GetNext(RowNumber)
, LV_Insert(RowNumber, "Check", RowNumber, Action, Details, 1, DelayG, Type, Target)
, LV_Insert(RowNumber, "Check", RowNumber, Action, Details, 1, DelayG, Type, Target, Window)
, LVManager.InsertAtGroup(RowNumber)
, RowNumber++
}
Expand Down

0 comments on commit b989e36

Please sign in to comment.